Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
snapcraft.yaml: add support for building a snap package #77
Conversation
|
@kyrofa Is this correct? Can you review please? |
kyrofa
requested changes
Feb 19, 2017
Thanks @3v1n0! Good work here, although I have a number of suggestions/comments/questions. And perhaps the kicker: this doesn't run at all for me, it just seems to hang. Not sure if that's because of the snap or because I'm trying to run master, though.
| @@ -0,0 +1,62 @@ | ||
| +name: nextcloud-client | ||
| +version: 2.2.4-git | ||
| +summary: nextcloud desktop client |
kyrofa
Feb 19, 2017
Member
At least for the time being, Ubuntu Software shows this field as the title. I suggest capitalizing it: "Nextcloud Desktop Client."
| +name: nextcloud-client | ||
| +version: 2.2.4-git | ||
| +summary: nextcloud desktop client | ||
| +icon: ../client/theme/colored/owncloud-icon.svg |
kyrofa
Feb 19, 2017
Member
I'm gonna go out on a limb and say you probably want something in ../nextcloudtheme/theme/colored/
| +icon: ../client/theme/colored/owncloud-icon.svg | ||
| +description: | | ||
| + The ownCloud Desktop Client is a tool to synchronize files from ownCloud | ||
| + Server with your computer. |
| + Server with your computer. | ||
| + | ||
| +grade: devel | ||
| +confinement: strict |
kyrofa
Feb 19, 2017
Member
Personally, until LP: #1653769 is resolved, I'd prefer classic confinement. Password prompts at start-up make it too annoying for me to use.
3v1n0
Feb 22, 2017
Contributor
Ok, agree... Still not sure if devmode is better though as an interim step to the final confined (if that is ever wanted).
| + source: ../ | ||
| + source-subdir: client | ||
| + build-packages: | ||
| + - libqt5webkit5-dev |
| + configflags: | ||
| + - -DCMAKE_INSTALL_PREFIX=/usr | ||
| + - -DCMAKE_INSTALL_LIBDIR=/usr/lib | ||
| + - -DDOEM_THEME_DIR=../src/nextcloudtheme |
kyrofa
Feb 19, 2017
Member
This doesn't actually pick up the theme (which is why, as you may have noticed, everything still says ownCloud). -DOEM_THEME_DIR=$SNAPCRAFT_PART_INSTALL/../src/nextcloudtheme will make you happier. Note that you'll need to update other sections in the YAML (such as the .desktop file and LD_LIBRARY_PATHs) that are set for something related to ownCloud.
| + - -DDOEM_THEME_DIR=../src/nextcloudtheme | ||
| + after: | ||
| + - desktop-qt5 | ||
| + - indicator-qt5 |
kyrofa
Feb 19, 2017
Member
Can you explain why indicator-qt5 is required? I was able to get the icon working fine simply by setting TMPDIR.
kyrofa
Feb 19, 2017
•
Member
Take a look at this (and test with sudo snap install --edge nextcloud-client-kyrofa on amd64) to see what I did specifically. I'm curious what this part adds on top of that. As I mentioned, I couldn't get this to run, so I was unable to see for myself.
3v1n0
Feb 22, 2017
Contributor
That is an "hack" that I actually was using (although now you should now use TMPDIR set as XDG_RUNTIME_DIR, as that is guaranteed to be cleaned up), however when snaps are confined that's not enough because this also would try to connect to dbus to get if running under unity or not.
There's an SRU for appmenu-qt5 in progress which will make this optional, but in the mean time that is the cleanest solution for this problem (see trunk appmenu-qt5 code).
| + source-depth: 1 | ||
| + plugin: dump | ||
| + organize: | ||
| + data/xdg-open: bin/xdg-open |
kyrofa
Feb 19, 2017
Member
Can you explain this part, please? Obviously snapd-xdg-open needs to run as an external "trusted helper" if you will (i.e. outside of confinement). You're just copying a piece of it so as to not use the one xdg-utils, it seems, but I was under the impression that nothing "special" was needed within a snap to use snapd-xdg-open as long as it was installed on the system. Is that not the case?
3v1n0
Feb 22, 2017
Contributor
This kind of xdg-open right now is needed in order to be able to call that trusted service.
At least, without it there's no way for me to open links (while file:// protocol is not supported unfortunately) when confined.
kyrofa
Mar 3, 2017
Member
I just saw this, by the way. Can you use the one in /usr/local/bin of the core snap?
| + command: | | ||
| + env LD_LIBRARY_PATH=$SNAP/usr/lib/owncloud:$LD_LIBRARY_PATH | ||
| + desktop-launch owncloud | ||
| + desktop: usr/share/applications/owncloud.desktop |
kyrofa
Feb 19, 2017
Member
This wasn't picked up for me (i.e. doesn't show in the dash). Did you test this?
|
Can you please fix the rest @3v1n0 Thanks! :) |
Ah, I've noticed that too when you only build it confined. So, I'm moving to So @enoch85 I guess we need your word and let us know how you prefer the snap to be. |
Wait... what? Why? The example client snap to which I linked runs in confinement. What's missing here? |
|
@kyrofa oh, sorry that was because it was missing the So let's decide if for now we prefer it to be classic or devmode. |
|
@kyrofa Can you please have another look, this is more your area than mine. Thanks! |
| + - home | ||
| + - network | ||
| + - network-bind | ||
| + - network-manager |
3v1n0
Feb 28, 2017
Contributor
See this bug, Qt network status checker needs it, and so this client if it wants to know the connection status.
This is not an auto-connected interface, though.
kyrofa
Mar 1, 2017
Member
Ah, okay. It still works if the interface is not connected, though? What features do we lose by not having it automatically connected?
3v1n0
Mar 1, 2017
Contributor
Things will work properly anyway... I'm not sure if this client is actually using this feature, but consider that as an "optimization". When Qt knows if there's a connection or not, it won't try to transfer data.
Users will be free to manually connect to this interface if they want an optimized client though.
| + # XXX: This is an hack to have a kind of bind-mount with absolute prefix. | ||
| + - -DCMAKE_INSTALL_PREFIX=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr | ||
| + - -DCMAKE_INSTALL_LIBDIR=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib | ||
| + - -DSYSCONF_INSTALL_DIR=/snap/$SNAPCRAFT_PROJECT_NAME/current/etc |
kyrofa
Feb 26, 2017
Member
What is the purpose behind this? The commit mentions remembering config, but I don't have that issue with nextcloud-client-kyrofa. Am I misunderstanding?
3v1n0
Feb 28, 2017
•
Contributor
Without this, the client won't be able to access to $SNAP/etc/Nextcloud/sync-exclude.lst (which causes syncing not to work here; I deleted the log stating it, but if you want, I can paste it), the same with any other possibly hardcoded path. We need to be sure that the client will be able to access to such files.
kyrofa
Mar 1, 2017
Member
Have you tried simply -DSYSCONF_INSTALL_DIR=config (or etc if you prefer, though that meaning breaks down in a snap)? That works for me.
3v1n0
Mar 1, 2017
Contributor
I tried that, but then my snap was trying to access located in $PATH_WHERE_I_WAS_BUILDING_THIS_SNAP/part/client/build/config not sure why...
3v1n0
Mar 1, 2017
Contributor
Also translations are there... For example:
for i in $(grep /snap/nextcloud-client prime/ -rl); do echo - $i:; strings $i | grep /snap/nextcloud-client; done gives me:
- prime/usr/bin/nextcloud:
/snap/nextcloud-client/current/usr//snap/nextcloud-client/current/usr/lib/nextcloud
/snap/nextcloud-client/current/usr/share/nextcloud/i18n/
- prime/usr/bin/nextcloudcmd:
/snap/nextcloud-client/current/usr//snap/nextcloud-client/current/usr/lib/nextcloud
- prime/usr/lib/libnextcloudsync.so.2.3.0:
/snap/nextcloud-client/current/usr//snap/nextcloud-client/current/usr/lib/nextcloud
/snap/nextcloud-client/current/etc/%1
/snap/nextcloud-client/current/etc/%1/%1.conf
Let me see what happens using your way...
3v1n0
Mar 1, 2017
•
Contributor
I've tried that too, but it's not fine, the same command (with different pattern) gives me:
/media/marco/M.2-SSD/client_theming/linux/parts/client/build/client/config/%1
/media/marco/M.2-SSD/client_theming/linux/parts/client/build/client/config/%1/%1.conf
where /media/marco/M.2-SSD/client_theming is the local repo path.
3v1n0
Mar 1, 2017
•
Contributor
I've tried that too, but it's not fine, the same command (with different pattern) gives me:
/media/marco/M.2-SSD/client_theming/linux/parts/client/build/client/config/%1
/media/marco/M.2-SSD/client_theming/linux/parts/client/build/client/config/%1/%1.conf
where /media/marco/M.2-SSD/client_theming is the local repo path.
kyrofa
Mar 3, 2017
Member
You say you get a log denying access. Do you still get that message? Do you get that message with nextcloud-client-kyrofa?
3v1n0
Mar 6, 2017
Contributor
Mh, no... I can't either test what's the log saying though since the run-clientis missing a $*.
I'll try to build it locally
|
cc @kyrofa Can you please review? |
|
After discussing with @3v1n0 on IRC I think we should go for strict confinement because: Anyway, would be cool to get this merged asap. Waiting for what @kyrofa has to say. |
This is exactly why I was suggesting classic confinement, which allows for no password prompt and release to stable channels at the expense of confinement. My only question is: what happens to the currently-installed snaps (using classic confinement) if that keyring interface lands and we move to strict confinement? Bad things? If we're okay with the password prompt until that interface lands, then I'm all for strict confinement. But like I said, the prompt at startup will cause me to prefer the deb version. |
I agree with you @kyrofa, but at the same time releasing with classic interface would need more work for now (as the desktop-helper needs some love too, as some things such as Also, if we release with classic, we still need to set the Instead by doing this change now, we can just say this to all the users that will install the snap. So they will know it and nothing will change. |
Sounds good. I can't imagine that keyring interface will be that difficult, anyway. |
Not really (and I'm looking into that), but... There still could be concerns as once the user has unlocked the keyring and if he saves the informations for the session, then I think that any app could access to such credentials (I've to check the APIs better though). |
Indeed, though if that's true it'll likely be an interface that is not automatically connected, which still works. That's up to the security team, anyway |
|
So What is left do do before this can be merged? |
|
@oparoz Can you please also take a look at this? You need to register the name under the Nextcloud store account, and afaik you are the only one with access. I also suggest that we release this in the same phase as the ordinary ownCloud client, but without betas. |
|
@3v1n0 how do you envision this being released? Since the |
|
@kyrofa check this branch: https://github.com/3v1n0/nextcloud-client_theming/blob/travis-snap-build/linux/travis-build.sh (and the relative Also I think we'd need a way to tell launchpad where the snapcraft.yaml can be found. As it's not always in |
|
@enoch85 As for release, the branch linked above, will release any git revision to PS: @oparoz you can add multiple accounts to manage a snap, in the store collaboration section. |
3v1n0
and others
added some commits
Feb 15, 2017
|
If you want to test a built snap in this way, here's a binary: https://transfer.sh/XW1As/nextcloud-client-2.2.4-git-amd64.snap |
|
@3v1n0 We can make it so that Nextcloud is the publisher of the snaps you create. |
|
@oparoz of course... That's the plan! But all the snap concept is around the fact that you (upstream) will then manage the releases... No others will be able to upload it then. |
|
I registered |
|
@oparoz good..
Of course it does: https://travis-ci.org/3v1n0/nextcloud-client_theming/builds/204436924 |
|
Ah, yes, we don't run into the same timeout issues we have with the nextcloud server snap. So what are the next steps then?
? |
|
Will you be able to build for both amd64 and i386 on Travis? |
|
@kyrofa of course, it's already doing it, see the travis matrix. |
|
Once we decided if you want to go with devmode or strict confinement (I guess you accept for the strict limitations for now) the steps are
I don't need to be a collaborator for the snap, as you can manage that alone, but I can help if you want... PS: @kyrofa please re-consider your review as that issue seems to be addressed. |
It has not. You still haven't answered my question. |
|
@kyrofa which one you mean, am I missing something? The one related to |
Sorry, I added the link in an edit. I don't like the absolute path hack, and the spike I built seemed to work without it. You imply that there are issues, but you haven't addressed why those issues don't seem to be present in my spike. Perhaps they are present and I'm not seeing them for some reason, but you haven't addressed that either. |
|
@kyrofa ah, ok... Since the review was pointing to something else. |
Yeah I don't typically "request changes" multiple times. The red X is already there
Or you can just install from edge as I've suggested. The snapcraft.yaml will pull a tag that doesn't build without modifications (i.e. it was pre-this-PR). |
|
Yeah @kyrofa, I already installed it from edge, but as said, I wasn't able to see the full log since you can't pass arguments to that version... So I wanted to rebuild it, however even the snap in the store points to the wrong conf path:
Building is the same, of course [as for the GIT_SHA edit, I already figured that, but thanks :-)]... PS: sorry I've just noticed I didn't submit some comments |
|
@kyrofa so I've just rebuilt your snap... It works when using version (git tag) 2.2.4, not with master: See this log: http://paste.ubuntu.com/24127025/ : And the client error: |
Ah ha! That's what I wanted to know! That explains the discrepancy. I wonder what changed. With that in mind, I'm okay with this, but I very very much dislike the hack. We should consider patches to make the client more flexible, because things like this can get in the way of cross-distro support. For example, this is currently some output from a Fedora machine:
Note how |
kyrofa
approved these changes
Mar 6, 2017
•
I approve with the caveat that we should investigate making the client more flexible at runtime. Using absolute paths and an organize is a hack from which we should move away as soon as we can.
enoch85
merged commit 461d146
into
nextcloud:master
Mar 6, 2017
1 check passed
|
Ouch, I though this was somewhat decided that Keep in mind that most of desktop apps we snapped already use this assertion... We can probably fix things in code, but it's annoying for now, as I think it needs some deeper changes. |
An older snapd and an older snap-confine. Other distros are the same. Things trickle down, I'm afraid. I see code in the newest snap-confine that mentions dealing with this issue, but I have yet to see it in use.
Any time someone asked me this I said it was a bad idea for this very reason. |
|
Hope I wasn't too quick on the merge button... |
|
I think this is fine for now, it's just an ubuntu-only solution, but we can improve in different branch. |
|
Could someone track @kyrofa's review comment in an issue so that we don't forget to address it as soon as we can? |

3v1n0 commentedFeb 15, 2017
The package is generated to be completely confined right now, and this might cause some minor annoyances, for example: it's not possible to access (sync) .dotted folders, the home is in the
~/snap/nextcloud-client, password can't be saved to the system keyring.If you prefer not have these limitations, and make this client to run without any sandbox, we can move to the
classicconfinement, and this will work as it used to be.The build can also be easily integrated with travis-CI and you can upload the new revisions automatically to the 'edge' channel of the snap store.
If you need any help for this, I'm available.