Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
New plugin: jhbuild #812
Conversation
|
Hey @attente! You could probably use some test coverage, here |
attente
commented
Sep 19, 2016
|
Ah, of course. On the way :) |
| + - modules (required): a list of modules to include in the part, modules that | ||
| + should be skipped should be prefixed with '-' | ||
| + - moduleset: the module set JHBuild should use (default: gnome-world) | ||
| + - snap-name (required): the name of the snap this part is included in |
elopio
Sep 20, 2016
Member
This will always be $SNAPCRAFT_PROJECT_NAME. We probably can drop this attribute.
| + should be skipped should be prefixed with '-' | ||
| + - moduleset: the module set JHBuild should use (default: gnome-world) | ||
| + - snap-name (required): the name of the snap this part is included in | ||
| + - snap-revision: the revision of the snap this part is included in |
| + - release: the release of the distribution the LXC container is based off of | ||
| + (default: host release) | ||
| + - architecture: the architecture of the LXC container | ||
| + (default: host architecture) |
elopio
Sep 20, 2016
Member
I like that you can select the image you want, but I think this should be more general, not just for this plugin.
We had https://bugs.launchpad.net/snapcraft/+bug/1597952 for this.
| + - jhcheckout: the directory on the host container DVCS checkout repositories | ||
| + - ccache: the directory on the host to use for ccache caching | ||
| + - disable-pull: True to skip the pull stage (default: False) | ||
| + - disable-build: True to skip the build stage (default: False) |
| + - Using the debmirror option in combination with a local apt-cacher-ng | ||
| + installation can prevent repeated downloading of .deb packages. Use the IP | ||
| + address of your lxcbr0 interface with the port number apt-cacher-ng uses. | ||
| + For example, debmirror: http://10.0.3.1:3142 |
elopio
Sep 20, 2016
Member
https://bugs.launchpad.net/snapcraft/+bug/1602085
Here again, I think it should be general, not only for this plugin.
| + - Specify directories on your host for jhtarballs and jhmirror to prevent | ||
| + repeated downloading of the JHBuild module sources. It is best to reserve | ||
| + directories on your local machine that can be used for all snaps you might | ||
| + want to build. |
elopio
Sep 20, 2016
Member
We have caching for debs. This makes me wonder if we should offer a simple and generic caching solution for all plugins. It might be a mess, though.
attente
Sep 22, 2016
Right, I'm just not sure how to make the LXC container grab the debs that Snapcraft already caches. If there's a way, I'd gladly prefer to use that instead.
| + | ||
| + - If you are debugging your snap, but don't need to rebuild the sources (for | ||
| + example, to determine the list of plugs required under confinement), use | ||
| + the disable-pull, disable-build, and disable-jhupdate options. |
elopio
Sep 20, 2016
Member
Ah, I see. But the problem here IMO is that if you want to debug your snap, you usually do it outside of the lxc cleanbuild. So you run pull once, and the next time it will be skipped.
I think we need some cool design to allow us to keep and reuse a lxc machine for cleanbuild, so we could do something similar.
| + | ||
| + - To add a shell for debugging your snap, add an extra app whose command is: | ||
| + jhbuild -f $SNAP/etc/jhbuildrc shell. You might also want to add gdb, | ||
| + strace, etc. to your list of stage-packages for debugging purposes. |
| +# build dependencies that JHBuild doesn't know about | ||
| +MODULE_EXCEPTIONS = { | ||
| + 'vala': ['valac'], | ||
| + 'gst-plugins-bad': ['libgl1-mesa-dev'], |
elopio
Sep 20, 2016
Member
I don't think it's common in python to use spaces like this, to format a table. I would prefer just one space between the : and the element. You might even get pep8 errors for this, I'm not sure.
| + | ||
| + @property | ||
| + def skipped_modules(self): | ||
| + return [module[1:] for module in self.options.modules if module.startswith('-')] |
attente
Sep 22, 2016
It's just to remove the initial '-' that's present for the skipped modules, like '-Webkit' -> 'WebKit'.
| + | ||
| + /<path to snapcraft.yaml>/parts/<part name>/src/jhtarballs | ||
| + """ | ||
| + return self.options.jhtarballs or os.path.join(self.sourcedir, 'jhtarballs') |
| + | ||
| + /snap/<snap name>/<snap revision>/usr/share | ||
| + """ | ||
| + return os.path.join(self.prefix, 'usr', 'share') |
elopio
Sep 20, 2016
Member
We usually define the attributes in the init, not as properties. Because then the statement is executed only once, not every time the attribute is accessed.
attente
added some commits
Sep 7, 2016
attente
commented
Nov 22, 2016
|
Superceded by #924 which doesn't require the use of LXC any more. |
attente commentedSep 19, 2016
No description provided.