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

Let Rust plugin fetch dependencies in pull #908

Merged
merged 11 commits into from Dec 6, 2016
Merged

Conversation

@ChrisMacNaughton
Copy link
Contributor

@ChrisMacNaughton ChrisMacNaughton commented Nov 16, 2016

Pulling the dependencies in the pull stage allows
building Rust snaps on Launchpad builders,
which are offline during the build stage

Pulling the dependencies in the pull stage allows
building Rust snaps on Launchpad builders,
which are offline during the build stage
@sergiusens
Copy link
Collaborator

@sergiusens sergiusens commented Nov 16, 2016

Thanks for the PR, seems the unit tests need updating though.
You can try locally by running

./runtests.sh unit

Also might as well run

./runtests.sh static

Before pushing again. Thanks again

@ChrisMacNaughton
Copy link
Contributor Author

@ChrisMacNaughton ChrisMacNaughton commented Nov 16, 2016

It looks like the tests failed because travis couldn't update packages?

Copy link
Contributor

@elopio elopio left a comment

Thanks @ChrisMacNaughton
I think it would be nice to add an integration test with a simple rust project that has dependencies.
You can take a look at integration_tests/test_rust_plugin.py

@@ -86,7 +86,7 @@ def test_pull(self, run_mock, script_mock):

plugin.pull()

self.assertEqual(1, run_mock.call_count)
self.assertEqual(2, run_mock.call_count)

This comment has been minimized.

@elopio

elopio Nov 16, 2016
Contributor

This test would require more than checking that rust was called twice. Please take a look at the next statement that checks the arguments of the first call, and do something similar to the second.

'build-essential',
'git',
'curl',
'file',

This comment has been minimized.

@elopio

elopio Nov 16, 2016
Contributor

I don't know rust, so I will trust you here that these are needed. But just curious, is there a doc that mentions these requirements?

This comment has been minimized.

@ChrisMacNaughton

ChrisMacNaughton Nov 16, 2016
Author Contributor

These are the things that were required for me to get rustc installed on one of the launchpad builders. Can't find specific documentation about it but that's where this list came from.

@ChrisMacNaughton
Copy link
Contributor Author

@ChrisMacNaughton ChrisMacNaughton commented Nov 21, 2016

@elopio tests should be accurate now, and the integration rust project now pulls in a dependency 😄

@elopio
elopio approved these changes Nov 22, 2016
Copy link
Contributor

@elopio elopio left a comment

Thanks!

Copy link
Member

@kyrofa kyrofa left a comment

A few suggestions on the build packages.

@@ -54,6 +54,12 @@ def schema(cls):

def __init__(self, name, options, project):
super().__init__(name, options, project)
self.build_packages.extend([
'build-essential',
'git',

This comment has been minimized.

@kyrofa

kyrofa Nov 22, 2016
Member

Git should be pulled in simply by using a git source. It shouldn't be required here.

This comment has been minimized.

@kyrofa

kyrofa Nov 22, 2016
Member

Unless the pull of rust eventually turns into a git clone. Is that the case?

This comment has been minimized.

@ChrisMacNaughton

ChrisMacNaughton Nov 22, 2016
Author Contributor

Pulling Rust shouldn't clone, but using Cargo for the build can

@@ -54,6 +54,12 @@ def schema(cls):

def __init__(self, name, options, project):
super().__init__(name, options, project)
self.build_packages.extend([
'build-essential',

This comment has been minimized.

@kyrofa

kyrofa Nov 22, 2016
Member

This is a large meta package. Are you sure you need all of it?

@kyrofa
kyrofa approved these changes Nov 23, 2016
Copy link
Member

@kyrofa kyrofa left a comment

Looks good to me 👍

Copy link
Collaborator

@sergiusens sergiusens left a comment

Thanks for this great functionality improvement on separating pull and build effectively in the plugin. I do however need to ask you to revert the change on the wiki downloader test as master has a proper (air quotes) fix for this (at least one where the endpoint won't change underneath us).

@@ -27,7 +27,8 @@ def test_downloader_with_wiki_parts(self):
snap_path = self.build_snap(self.snap_content_dir)
self.install_snap(snap_path, 'downloader', '1.0')
expected = (
'.*<title>The leading OS for PC, tablet, phone and cloud '
'.*<title>The leading operating system for PCs, tablets, '

This comment has been minimized.

@sergiusens

sergiusens Nov 24, 2016
Collaborator

This should be reverted as it was fixed in master with a more permanent solution.

This reverts commit bac4b74.
@ChrisMacNaughton
Copy link
Contributor Author

@ChrisMacNaughton ChrisMacNaughton commented Nov 28, 2016

@sergiusens I've reverted that change, and it looks like that is the issue with the autopkgtests still.

@codecov-io
Copy link

@codecov-io codecov-io commented Dec 6, 2016

Current coverage is 97.06% (diff: 100%)

Merging #908 into master will increase coverage by <.01%

@@             master       #908   diff @@
==========================================
  Files           161        161          
  Lines         16600      16603     +3   
  Methods           0          0          
  Messages          0          0          
  Branches       1244       1244          
==========================================
+ Hits          16113      16116     +3   
  Misses          302        302          
  Partials        185        185          

Powered by Codecov. Last update 97af16f...02f4e1f

@kyrofa kyrofa merged commit a87decf into snapcore:master Dec 6, 2016
4 of 5 checks passed
4 of 5 checks passed
zesty-amd64 autopkgtest running
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-armhf autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017
Pulling the dependencies in the pull stage allows
building Rust snaps on Launchpad builders,
which are offline during the build stage

LP: #1647847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.