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

rust plugin: Add support for cross-compilation #1350

Merged
merged 15 commits into from Jun 22, 2017

Conversation

Projects
None yet
5 participants
@kalikiana
Contributor

kalikiana commented Jun 2, 2017

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

@kalikiana kalikiana self-assigned this Jun 2, 2017

@sergiusens sergiusens changed the title from Rust rust: Add support for cross-compilation to rust plugin: Add support for cross-compilation Jun 7, 2017

@kalikiana kalikiana requested review from elopio and kyrofa Jun 12, 2017

@elopio

Nice, nice :)
Please add a manual test. And please ping @ChrisMacNaughton to get his expert review on this.

Show outdated Hide outdated integration_tests/plugins/test_rust_plugin.py
Show outdated Hide outdated snapcraft/plugins/rust.py
Show outdated Hide outdated snapcraft/plugins/rust.py
Show outdated Hide outdated snapcraft/plugins/rust.py
Show outdated Hide outdated snapcraft/plugins/rust.py
Show outdated Hide outdated snapcraft/tests/matchers.py
@kyrofa

A few niggly things from me, but great job here! I agree that someone more qualified in Rust than us needs to take a look before this should land, though.

Show outdated Hide outdated integration_tests/plugins/test_rust_plugin.py
Show outdated Hide outdated snapcraft/plugins/rust.py
Show outdated Hide outdated snapcraft/plugins/rust.py
Show outdated Hide outdated snapcraft/plugins/rust.py
try:
arch = magic.split(',')[1]
except IndexError as e:
raise ValueError('Failed to parse magic {!r}'.format(magic)) from e

This comment has been minimized.

@kyrofa

kyrofa Jun 15, 2017

Member

Thank you for this, very nice.

@kyrofa

kyrofa Jun 15, 2017

Member

Thank you for this, very nice.

@kyrofa kyrofa added this to the 2.32 milestone Jun 17, 2017

@ChrisMacNaughton

This comment has been minimized.

Show comment
Hide comment
@ChrisMacNaughton

ChrisMacNaughton Jun 20, 2017

Contributor

Been watching this one, code looks OK but I don't have any ARM hardware to test on ;-)

Contributor

ChrisMacNaughton commented Jun 20, 2017

Been watching this one, code looks OK but I don't have any ARM hardware to test on ;-)

@elopio

This comment has been minimized.

Show comment
Hide comment
@elopio

elopio Jun 20, 2017

Member

Thanks @ChrisMacNaughton!
@cholcombe973 would you like to give it a look too?

We want to get more expert knowledge into our plugins, so if the two of you could help us with the rust plugin it would be great.

Member

elopio commented Jun 20, 2017

Thanks @ChrisMacNaughton!
@cholcombe973 would you like to give it a look too?

We want to get more expert knowledge into our plugins, so if the two of you could help us with the rust plugin it would be great.

@cholcombe973

Overall I think it looks good. Nicely done :)
I have some small questions like why gcc, binutils, libc6-dev was removed.

self.project_options)
os.makedirs(plugin.sourcedir)
plugin.enable_cross_compilation()

This comment has been minimized.

@cholcombe973

cholcombe973 Jun 20, 2017

This needs to catch NotImplementedError

@cholcombe973

cholcombe973 Jun 20, 2017

This needs to catch NotImplementedError

This comment has been minimized.

@kalikiana

kalikiana Jun 21, 2017

Contributor

Good catch (no pun intended). I added a separate test for that.

@kalikiana

kalikiana Jun 21, 2017

Contributor

Good catch (no pun intended). I added a separate test for that.

1. Go to integration_tests/snaps/rust-hello.
2. Run `snapcraft snap --target-arch=armhf`.
3. Copy the snap to a Raspberry Pi.

This comment has been minimized.

@cholcombe973

cholcombe973 Jun 20, 2017

We could also probably help users without a Raspberry Pi test with qemu instructions.

@cholcombe973

cholcombe973 Jun 20, 2017

We could also probably help users without a Raspberry Pi test with qemu instructions.

This comment has been minimized.

@kalikiana

kalikiana Jun 21, 2017

Contributor

I was talking about this with @elopio a couple of weeks ago. We could consider an integration test using qemu. But we can't run the test snap on a native armhf machine. So the manual test is specifically for this.

@kalikiana

kalikiana Jun 21, 2017

Contributor

I was talking about this with @elopio a couple of weeks ago. We could consider an integration test using qemu. But we can't run the test snap on a native armhf machine. So the manual test is specifically for this.

This comment has been minimized.

@cholcombe973

cholcombe973 Jun 21, 2017

I see. Ok I was just wondering

@cholcombe973

cholcombe973 Jun 21, 2017

I see. Ok I was just wondering

Show outdated Hide outdated snapcraft/plugins/rust.py
@kyrofa

kyrofa approved these changes Jun 22, 2017

After the latest changes, looks good to me!

@elopio elopio merged commit 94fb106 into snapcore:master Jun 22, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

kalikiana added a commit to kalikiana/snapcraft that referenced this pull request Aug 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment