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
go plugin: Add support for cross-compilation #1338
Conversation
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.
a few small details to change from the team review.
if snapcraft.ProjectOptions().deb_arch != 'amd64': | ||
self.skipTest('The test only handles amd64 to armhf') | ||
|
||
expected_arch = 'arm64' |
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.
rename to target_arch, please.
os.path.basename(self.path)) | ||
arch = subprocess.check_output(['file', '-b', binary], | ||
universal_newlines=True) | ||
self.assertThat(arch, Contains('aarch64')) |
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.
Kyle and Sergio think that this will be better as a matcher in this branch.
'go-hello') | ||
binary = os.path.join(self.parts_dir, 'go-hello', 'install', 'bin', | ||
os.path.basename(self.path)) | ||
arch = subprocess.check_output(['file', '-b', binary], |
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.
use python magic instead of file.
snapcraft/tests/plugins/test_go.py
Outdated
|
||
patcher = mock.patch('sys.stdout') | ||
patcher.start() | ||
self.addCleanup(patcher.stop) |
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.
This shouldn't be needed, it's done by the base test case.
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.
thank you @kalikiana !
Support doing
snapcraft snap --target-arch=
with parts using the go plugin