-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(remote): parse comma-separated architectures #4543
Conversation
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
help=HIDDEN, | ||
) | ||
parser.add_argument( | ||
"--build-for", | ||
type=lambda arg: [arch.strip() for arch in arg.split(",")], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this support something wacky like --build-for=amd64 --build-for=arm64,armhf
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. When there are duplicates, argparse/craft-cli uses the last --build-{on|for}
, silently ignores the other --build-{on|for}
s, and always provides a single string for this lambda.
Normally I wouldn't add a test for standard behavior, but since this is a delicate situation, I added an extra unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be clear, this wouldn't be a change in behavior right? The previous code would also only use the last --build-x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, this behavior is unchanged.
The only "loss" is that snapcraft remote-build --build-for amd64 arm64
doesn't work.
And I think that "loss" is OK because it is a regression in the new remote builder: snapcraft 7 only supported comma-separated architectures, not space-separated architectures.
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## hotfix/8.0 #4543 +/- ##
==============================================
+ Coverage 89.18% 89.19% +0.01%
==============================================
Files 321 322 +1
Lines 21763 21814 +51
==============================================
+ Hits 19409 19457 +48
- Misses 2354 2357 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thankss
Merging because spread test failures are completely unrelated (appears to be an issue with the devel image to be resolved via canonical/craft-providers#501 |
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
tox run -m lint
?tox run -e test-py310
? (supported versions:py39
,py310
,py311
,py312
)2 commits:
--build-for
and--build-on
mutually exclusiveFixes #4516
(CRAFT-2386)