Skip to content

Commit

Permalink
patch(release_snap.yaml): Fix core22 architectures parsing (#269)
Browse files Browse the repository at this point in the history
Follow up to #258
  • Loading branch information
carlcsaposs-canonical authored Jan 17, 2025
1 parent 6fab380 commit 9948453
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 9948453

Please sign in to comment.