Skip to content
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

Merged
merged 8 commits into from Jun 2, 2017

Conversation

kalikiana
Copy link
Contributor

Support doing snapcraft snap --target-arch= with parts using the go plugin

@kalikiana kalikiana requested a review from come-maiz June 1, 2017 09:25
@kalikiana kalikiana self-assigned this Jun 1, 2017
@kalikiana kalikiana added this to the 2.31 milestone Jun 1, 2017
@kalikiana kalikiana added the Enhancement New features or optimizations label Jun 1, 2017
Copy link
Contributor

@come-maiz come-maiz left a 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'
Copy link
Contributor

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'))
Copy link
Contributor

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],
Copy link
Contributor

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.


patcher = mock.patch('sys.stdout')
patcher.start()
self.addCleanup(patcher.stop)
Copy link
Contributor

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.

Copy link
Contributor

@come-maiz come-maiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @kalikiana !

@sergiusens sergiusens modified the milestones: 2.31, 2.30.1 Jun 1, 2017
@sergiusens sergiusens merged commit a167ec4 into snapcore:master Jun 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New features or optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants