Skip to content

Commit

Permalink
patch(release_snap.yaml): Fix core22 architectures parsing
Browse files Browse the repository at this point in the history
Follow up to #258
  • Loading branch information
carlcsaposs-canonical committed Jan 16, 2025
1 parent 92d0a9f commit 51d2cf8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,15 @@ def collect(craft_: craft.Craft):
platforms.append({"name": platform, "runner": RUNNERS[architecture]})
elif yaml_data["base"] == "core22":
for entry in yaml_data["architectures"]:
# Example: ["amd64"]
platforms = entry["build-on"]
if not (isinstance(platforms, list) and len(platforms) == 1):
raise ValueError(
"Expected snapcraft.yaml 'build-on' value with type 'list' and length 1, "
f"got: {repr(platforms)}"
)
# Example: "amd64"
platform = entry["build-on"]
platform = platforms[0]
architecture = craft.Architecture(platform)
platforms.append({"name": platform, "runner": RUNNERS[architecture]})
else:
Expand Down

0 comments on commit 51d2cf8

Please sign in to comment.