Add godeps plugin. #691

Merged
merged 7 commits into from Aug 2, 2016

Conversation

Projects
None yet
4 participants
Member

kyrofa commented Jul 27, 2016

Snapcraft currently has a go plugin, but go has a number of dependency management systems. One very common one is godeps. This PR resolves LP: #1595981 by adding a plugin for it.

+ 'ant catkin copy godeps gulp kbuild make nil '
+ 'plainbox-provider python3 rust tar-content\n'
+ 'autotools cmake go gradle jdk kernel maven nodejs '
+ 'python2 qmake scons\n')
@kyrofa

kyrofa Jul 27, 2016

Member

Kill me now. I thought we got rid of these?

@elopio

elopio Jul 27, 2016

Member

we left just one.

Add godeps plugin.
Snapcraft currently has a go plugin, but go has a number of dependency
management systems. One very common one is godeps. Add a plugin for it.

LP: #1595981

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
+ 'autotools godeps kernel plainbox-provider scons \n'
+ 'catkin gradle make python2 tar-content\n'
+ 'cmake gulp maven python3 \n'
+ 'copy jdk nil qmake \n')
@elopio

elopio Jul 27, 2016

Member

oh, well, two :p

Member

elopio commented Jul 27, 2016

👍 thank you.

+ Path to the godeps dependencies file contained within the source
+ (default: dependencies.tsv)
+
+ - go-importpath:
@sergiusens

sergiusens Jul 28, 2016

Collaborator

can you please make this required?

@kyrofa

kyrofa Jul 28, 2016

Member

Sure, done.

snapcraft/plugins/godeps.py
+ if self.options.go_importpath:
+ go_package = self.options.go_importpath
+ else:
+ logger.warning(
@sergiusens

sergiusens Jul 28, 2016

Collaborator

this should not be needed as gopath would be mandatory.

@sergiusens

sergiusens Jul 28, 2016

Collaborator

the logic here would be greatly simplified if so ;-)

@kyrofa

kyrofa Jul 28, 2016

Member

Indeed!

snapcraft/plugins/godeps.py
+ env['GOPATH'] = self._gopath
+ env['PATH'] = '{}:{}'.format(
+ os.path.join(self._gopath, 'bin'), env.get('PATH', ''))
+ linker_flags = ' '.join([
@sergiusens

sergiusens Jul 28, 2016

Collaborator

can't you retrieve this from common, I bet you also want the stage ones here (to link against dependant parts)

@kyrofa

kyrofa Jul 28, 2016

Member

Haha, I completely forgot about those functions already! How sad. Definitely should use them here-- done.

kyrofa added some commits Jul 28, 2016

Make go-importpath required.
Also use the common library handling functions instead of hard-coding
them.

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Update integration test to use go-importpath.
Signed-off-by: Kyle Fazzari <kyle@canonical.com>

@stevenwilkin stevenwilkin referenced this pull request in snapcore/snapweb Jul 29, 2016

Merged

[WIP] Use Snapcraft to build snap #4

nskaggs commented Aug 2, 2016

+1 from me. Tested and working for building juju. This made my juju snapcraft.yaml file much simpler, and added tags support! Thanks!

Collaborator

sergiusens commented Aug 2, 2016

👍

@sergiusens sergiusens merged commit a073503 into snapcore:master Aug 2, 2016

4 checks passed

autopkgtest integration Success
Details
autopkgtest snaps Success
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.04%) to 97.008%
Details

@kyrofa kyrofa deleted the kyrofa:feature/1595981/godeps branch Oct 14, 2016

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

Add godeps plugin. (#691)
Snapcraft currently has a go plugin, but go has a number of dependency
management systems. One very common one is godeps. Add a plugin for it.

LP: #1595981

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment