Re: build.snapcraft.io and GitHub groups

2017-03-18 Thread Joseph Rushton Wakeling

On 18/03/17 01:29, Mark Shuttleworth wrote:

On 17/03/17 16:49, Joseph Rushton Wakeling wrote:

... but is it possible to do this via a project registered on behalf
of a team, instead of an individual user account?


It *should* be, so if it isn't, thanks for the bug report :)


It's all working fine AFAICT, with the new ldc-developers team and a couple of 
snap package builds in the pipeline :-)



--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: build.snapcraft.io and GitHub groups

2017-03-18 Thread Joseph Rushton Wakeling

On 18/03/17 02:42, Colin Watson wrote:

As others have mentioned, this is definitely in our backlog.  It's
tricky to map the different models together in a way that doesn't end up
locking people out just because (e.g.) a previous administrator of their
GitHub organisation once created a snap for a repository and later
deleted it, but I'm sure we'll get there in the end.


That's great to hear.  I have things set up with Launchpad for now in any case 
(which was a super-friendly experience).


My builds seem to have run into git-clone issues related to my using `git://` 
urls instead of `https://`, but that should be straightforward enough to fix in 
the snap package definition ;-)



(We actually don't intentionally ask for organisation access at the
moment; I guess perhaps GitHub does that as part of admin:repo_hook?
Anyway, it's immaterial since we'll need it eventually.)


Yes, I would guess that GitHub defaults to offering hooks into everything a user 
can access with the option to exclude certain groups from the offering.



The "Create a new snap package" page in Launchpad allows you to select
an owner for the snap, which can be yourself or any team you're a member
of.  This will allow anyone in that team to modify that snap in
Launchpad (including requesting builds of it).

You still need to authorise this for upload to the snap store on behalf
of an individual user, though: the store doesn't have an equivalent of
organisations.  It's possible (though I don't know the exact details) to
add other team members as collaborators, allowing them to publish new
versions of that snap too.


Yes, this is the approach I took, although it would be great at some point if 
snap packages in the store could have actual team ownership.


Minor usability note on that: I added my 'regular' user account as a 
collaborator on the ldc2 snap, but have never uploaded using that account.  The 
snap store insisted that I add a 'unique short namespace' to my account details 
and I was worried that would be used for the published snap instead of that of 
the account that really owns the package.


Thanks & best wishes,

-- Joe

--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


git clone and Launchpad build system

2017-03-18 Thread Joseph Rushton Wakeling
Is there an issue with using git source for parts of snap packages when using 
the Launchpad build system?  I'm having consistent build failures for this; 
originally I tried switching from `git://` URLS to `https://`, but I'm still 
seeing the same errors, see e.g. 
https://launchpadlibrarian.net/311390659/buildlog_snap_ubuntu_xenial_amd64_ldc2_BUILDING.txt.gz:


Command '['git', 'clone', '--recursive', '--branch', 'v0.17.3', 
'https://github.com/ldc-developers/ldc.git', 
'/build/ldc2/parts/ldc-bootstrap/src']' returned non-zero exit status 128

Traceback (most recent call last):
  File "/usr/share/launchpad-buildd/slavebin/buildsnap", line 202, in main
builder.pull()
  File "/usr/share/launchpad-buildd/slavebin/buildsnap", line 139, in pull
env=env)
  File "/usr/share/launchpad-buildd/slavebin/buildsnap", line 92, in 
run_build_command

self.chroot(["/bin/sh", "-c", command], echo=echo)
  File "/usr/share/launchpad-buildd/slavebin/buildsnap", line 66, in chroot
"/usr/bin/sudo", "/usr/sbin/chroot", self.chroot_path] + args)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['/usr/bin/sudo', '/usr/sbin/chroot', 
'/home/buildd/build-SNAPBUILD-28577/chroot-autobuild', 'linux64', '/bin/sh', 
'-c', 'cd /build/ldc2 && env LANG=C.UTF-8 
https_proxy=http://snap-proxy.launchpad.net:3128 SNAPCRAFT_SETUP_CORE=1 
http_proxy=http://snap-proxy.launchpad.net:3128 SNAPCRAFT_LOCAL_SOURCES=1 
snapcraft pull']' returned non-zero exit status 1

Revoking proxy token...
RUN: /usr/share/launchpad-buildd/slavebin/scan-for-processes 
['scan-for-processes', 'SNAPBUILD-28577']
Scanning for processes to kill in build 
/home/buildd/build-SNAPBUILD-28577/chroot-autobuild...
RUN: /usr/share/launchpad-buildd/slavebin/umount-chroot ['umount-chroot', 
'SNAPBUILD-28577']

Unmounting chroot for build SNAPBUILD-28577...
RUN: /usr/share/launchpad-buildd/slavebin/remove-build ['remove-build', 
'SNAPBUILD-28577']


The corresponding part of the snapcraft.yaml:
https://github.com/ldc-developers/ldc2.snap/blob/da18a99f4c66c219b4cf9d06b4087a5fe9acce79/snap/snapcraft.yaml#L53-L55

  ldc-bootstrap:
source: https://github.com/ldc-developers/ldc.git
source-tag: v0.17.3

--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Triggering CI/snap builds on changes to snapcraft parts

2017-03-18 Thread Loïc Minier
Hi!

Currently, setting up a snap build from a git branch in Launchpad or via
build.snapcraft.io is a pleasure, and this allows for an easy CI whenever a
change is pushed to the repo. But non-trivial projects have multiple
components to build to deliver the snap, with chains of build-deps.

What's the best practice to trigger snap builds/CI builds when changes are
pushed to build-dependencies / parts of a snap? Should there be a way to
parse part sources in snapcraft.yaml and check whether these have changed?

Thanks!
- Loïc Minier
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: git clone and Launchpad build system

2017-03-18 Thread Joseph Rushton Wakeling

On 18/03/17 14:46, Joseph Rushton Wakeling wrote:

Is there an issue with using git source for parts of snap packages when using
the Launchpad build system?  I'm having consistent build failures for this;
originally I tried switching from `git://` URLS to `https://`, but I'm still
seeing the same errors, see e.g.
https://launchpadlibrarian.net/311390659/buildlog_snap_ubuntu_xenial_amd64_ldc2_BUILDING.txt.gz:


Still failing despite updating to make sure the `source-type` is explicitly 
specified as git.  The same snap package builds fine for me with a `snapcraft 
cleanbuild`.


I'm a bit baffled here because I compared to the openhab snap, which also uses 
git source and seems to build fine in Launchpad:

https://git.launchpad.net/~openhab/openhab-snap/+git/master/tree/snapcraft.yaml

--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: git clone and Launchpad build system

2017-03-18 Thread Gregory Lutostanski
Launchpad builders have an issue with git where they do not proxy that
connection, only https. Here the issue is that that github repo has
submodules specified with the git: url schema (and its doing a recursive
checkout of the source).

The bug is https://bugs.launchpad.net/launchpad-buildd/+bug/1663920

As a workaround you can change the submodules to https: rather than git:
annoying indeed, that is what I had to go with personally. Dunno if anybody
else has other ideas.

--Greg

On Sat, Mar 18, 2017 at 3:28 PM, Joseph Rushton Wakeling <
joseph.wakel...@webdrake.net> wrote:

> On 18/03/17 14:46, Joseph Rushton Wakeling wrote:
>
>> Is there an issue with using git source for parts of snap packages when
>> using
>> the Launchpad build system?  I'm having consistent build failures for
>> this;
>> originally I tried switching from `git://` URLS to `https://`, but I'm
>> still
>> seeing the same errors, see e.g.
>> https://launchpadlibrarian.net/311390659/buildlog_snap_ubunt
>> u_xenial_amd64_ldc2_BUILDING.txt.gz:
>>
>
> Still failing despite updating to make sure the `source-type` is
> explicitly specified as git.  The same snap package builds fine for me with
> a `snapcraft cleanbuild`.
>
> I'm a bit baffled here because I compared to the openhab snap, which also
> uses git source and seems to build fine in Launchpad:
> https://git.launchpad.net/~openhab/openhab-snap/+git/master/
> tree/snapcraft.yaml
>
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm
> an/listinfo/snapcraft
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: git clone and Launchpad build system

2017-03-18 Thread Joseph Rushton Wakeling

On 18/03/17 21:28, Joseph Rushton Wakeling wrote:

On 18/03/17 14:46, Joseph Rushton Wakeling wrote:

Is there an issue with using git source for parts of snap packages when using
the Launchpad build system?  I'm having consistent build failures for this;
originally I tried switching from `git://` URLS to `https://`, but I'm still
seeing the same errors, see e.g.
https://launchpadlibrarian.net/311390659/buildlog_snap_ubuntu_xenial_amd64_ldc2_BUILDING.txt.gz:



Still failing despite updating to make sure the `source-type` is explicitly
specified as git.  The same snap package builds fine for me with a `snapcraft
cleanbuild`.


A look a bit further back in the build log reveals what I think may be the 
problem: the submodules of one of the git repositories have their URLs specified 
using `git://` URLs:


Submodule 'druntime' (git://github.com/ldc-developers/druntime.git) registered 
for path 'runtime/druntime'
Submodule 'phobos' (git://github.com/ldc-developers/phobos.git) registered for 
path 'runtime/phobos'
Submodule 'tests/d2/dmd-testsuite' 
(git://github.com/ldc-developers/dmd-testsuite.git) registered for path 
'tests/d2/dmd-testsuite'

Cloning into 'runtime/druntime'...
fatal: unable to connect to github.com:
github.com: Name or service not known

fatal: clone of 'git://github.com/ldc-developers/druntime.git' into submodule 
path 'runtime/druntime' failed


Are `git://` URLS genuinely not supported by the launchpad build system?  And if 
so, is there a chance this could be addressed?


--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: git clone and Launchpad build system

2017-03-18 Thread Joseph Rushton Wakeling

On 18/03/17 22:11, Gregory Lutostanski wrote:

Launchpad builders have an issue with git where they do not proxy that
connection, only https. Here the issue is that that github repo has
submodules specified with the git: url schema (and its doing a recursive
checkout of the source).

The bug is https://bugs.launchpad.net/launchpad-buildd/+bug/1663920


Ah, cheers.  I'd looked through the bug list and seen that one, but not realized 
the submodules were using `git://` URLs until just before your email arrived.



As a workaround you can change the submodules to https: rather than git:
annoying indeed, that is what I had to go with personally. Dunno if anybody
else has other ideas.


Yup.  It's a bit finnicky for me to do that given that the submodules are 
defined by my upstream (I can send them a patch, but it's a PITA to ask them to 
make a patch release just to deal with this issue).


I did look into just downloading a tarball of the source, but that has some 
issues of its own -- since the CMakeLists.txt of the project I'm building 
defines some rules for comparing the version number against the output of `git 
describe`, I run into some rather nasty issues where the git history compared to 
is that of the snap package itself (!).


I'll follow up with my upstream and see what I can do, anyway.  Thanks again for 
the help and advice!


--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft