/srv/irclogs.ubuntu.com/2018/04/23/#snappy.txt

=== sergiusens_ is now known as sergiusens
=== chihchun_afk is now known as chihchun
=== chihchun is now known as chihchun_afk
=== chihchun_afk is now known as chihchun
=== iMadper` is now known as iMadper
mborzeckimorning05:08
zygagood morning!05:38
Son_Gokugah05:45
Son_Gokuwhy am I still awake...05:45
mborzeckizyga: hey05:50
zygaHey05:55
zygaIt’s much colder today05:55
mborzeckizyga: and expecting rain in the afternoon as well05:56
zygaYeah, the “summer” is over05:56
zygaAfk, walk05:57
mborzeckii have #5073 open, but it's failing on linode, specifically ubuntu-16.04-32 and opensuse-42.2, looks like the linode images are gone and they do not boot anymore06:48
mupPR #5073: set up journal streams in user session application autostart (2.32) <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/5073>06:48
mborzeckimaster is using gce06:49
=== chihchun is now known as chihchun_afk
mborzeckiaccording to travis relase/2.32 branch is failing06:54
zygaHmmm06:55
zygaDid we drop lindoe already?06:55
mborzeckiit looks like that only some images were dropped06:56
mborzecki16.04-32 and openssue, this is what's failing06:56
mborzeckizyga: see the dial timeouts https://api.travis-ci.org/v3/job/368660863/log.txt06:56
mborzeckiand it keeps repeating06:56
zygaHmmm06:57
mborzeckii've restarted 5073 numerous times now06:57
=== chihchun_afk is now known as chihchun
kalikianamoin moin07:05
=== pstolowski|afk is now known as pstolowski
pstolowskimorning07:06
zygaback from walk07:11
mborzeckikalikiana: pstolowski: hey07:15
mborzeckipstolowski: trivial review https://github.com/snapcore/snapd/pull/5078 :)07:15
mupPR #5078: interfaces/builtin, daemon: cleanup mocked builtin interfaces in daemon tests <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/5078>07:15
mborzeckipstolowski: ta07:18
mupPR snapd#5078 closed: interfaces/builtin, daemon: cleanup mocked builtin interfaces in daemon tests <Created by bboozzoo> <Merged by stolowski> <https://github.com/snapcore/snapd/pull/5078>07:18
Chipacamo'in all07:56
Chipacamborzecki: what am I missing for a +1 from you on #5066?07:57
mupPR #5066: overlord/snapshotstate/backend: introducing the snapshot backend <Created by chipaca> <https://github.com/snapcore/snapd/pull/5066>07:57
pstolowskimorning Chipaca07:59
mborzeckiChipaca: i'll go over it again once i'm done with the watchdog, iirc i left some more comments, but those might have been for the overlord pieces that were later pulled07:59
* zyga is stuck on the apparmor issue :/08:03
Chipacazyga: stuck how?08:04
zygathere's something wrong with my logic but I cannot see it yet08:05
* zyga tries to summarise the problem08:05
zygawhen pawel tried to use a layout that had deep directory like /usr/a/b/c/d08:05
zygathings were broken because our permissions were too strict and prevent us from making /usr writable08:06
zygaI fixed that08:06
zyganow what I find is that we make /usr writable but things subsequently fail to create /usr/a/b/c/d in a way I don't understand08:06
zygait seems that after making most of that path we end up with EROFS08:07
zygabut.. how?08:07
zygahttp://paste.ubuntu.com/p/h8QkcWWQSy/08:07
zygaon line 1120 we are done with making /bin writable08:07
zyga(after writing a loot of things to a tmpfs mounted over /bin08:08
zyganow on line 1141 we fail with EROFS08:08
Chipacais it meant to be mounting everything in /bin ?08:08
zygayes08:08
Chipacaor is that just your test08:08
zygawe re-create /bin in a writable place08:09
zygathis is the writable mimic logic08:09
zygarbind /bin -> /tmp/.snap/bin08:09
zygamount -t tmpfs none /bin08:09
zygatouch /bin/a && mount --bind /tmp/.snap/bin/a /bin/a08:09
zyga(then all the way till we "mimic" everything over08:09
zygathen mount /tmp/.snap/bin to clean up08:10
zygathis works so far08:10
zygawhat is odd is next we try to mkdir /bin/very/weird/place08:10
zygaand this works by opening / then /bin/ then /bin/very/ and so on08:10
zyga(mkdirat'ing them as we go)08:10
zygaowowow08:11
zygaMAN08:11
zygahow did I miss this08:11
Chipacazyga: because you don't have a sock puppet to talk to08:11
zygathe error is for /snap/test-snapd-layout/x1/bin/very/weird/place08:11
zyganot for /bin/very/weird/place08:11
zygathe bug is completely different!!!08:11
* zyga is dumb08:11
* zyga hugs Chipaca 08:11
zygathank you John08:11
* Chipaca tries to make his eyes wobble like a good sock puppet would08:12
zygaI see what the problem is now08:13
zygait's my silly test08:13
zygathe bug is fixed now08:13
* zyga wonders if there's an emoji for <man holding hand on forehead>08:13
Chipacazyga: U+1F92608:15
Chipacazyga: (not quite, but close enough imo)08:15
zygahaha, thank you :-)08:16
zygathis will be my motto of the day08:16
zygaI was looking at this issue all Friday :/08:16
Chipacazyga: unicode 9 so not in xenial ¯\_(ツ)_/¯08:16
zygafixed, fingers crossed08:20
mupPR snapcraft#2095 opened: lxd: proper error classes for container errors <Created by kalikiana> <https://github.com/snapcore/snapcraft/pull/2095>09:05
jameshzyga: so, is there anything that needs to be done before https://github.com/snapcore/snapd/pull/3963 can be merged?09:07
mupPR #3963: cmd/snap-confine: add support for per-user mounts <Created by jhenstridge> <https://github.com/snapcore/snapd/pull/3963>09:07
jameshit got a tick from jdstrand09:07
zygaI asked mborzecki or Chipaca to have a quick look just in case we missed something09:07
zygabut otherwise no09:07
popeycoregrrr. installing a snap blew my x session up again :|09:08
zygaI plan to merge it today09:08
popeycoreit blows up just at the point when it prints that its connecting the opengl interface09:08
jameshzyga: cool.  As written, it should have no effect when there isn't a .user-fstab file for a snap09:08
popeycoreWimpress: getting coffee while my machine updates/reboots. back shortly :)09:12
Wimpresspopeycore: OK.09:13
mborzeckiany clue why NOTIFY_SOCKET set by system is @/org/freedesktop/systemd1/no09:24
mborzeckitify/3197004134137770178 on 14.04?09:24
zygamborzecki: what is is normally?09:31
mborzeckizyga: /run/systemd/notify09:31
zyga14.04 has older systemd, maybe that just was the thing at the time09:31
mborzeckihmm service-watchdog assumed that the communication happens on a unix socket with filesystem path, not an abstract one09:36
mborzeckithen apparmor rules probably need to change too09:36
zygahmm09:39
zygaapparmor_parser spins at 99%CPU09:39
mborzeckizyga: does `unix (connect, receive, send) type=stream peer=(label=unconfined,addr="@/org/freedesktop/systemd1/notify*")` look ok to you?09:39
zygaI think that's nog great09:39
zygamborzecki: yes though I honestly don't recall the syntax09:39
zygadon't forget the trailing ,09:39
mborzeckiaah09:39
mborzeckithx09:39
* Chipaca goes to see a man about a dog^W^W my back09:43
zygahttps://github.com/bartzaalberg/snaptastic09:45
zygainteresting09:46
* zyga wrote a profile that makes apparmor_parser run for a very very long time09:49
popeydiddledan: fyi, i am backing up and deletingr repos from snapcrafters that are broken / never been published09:49
diddledanright-oh - any I should take a look at to get working?09:49
popeyI put them in dropbox snapcrafters_deleted09:50
diddledancoolbeans09:50
popeythe only one that would be nice to fix is wire09:50
diddledanyup09:50
popeyit crashes, not looked at it for a while09:50
diddledanit might be fixed by the work jdstrand did on converting seccomp kills to EPERMs09:50
popeypossibly, yes.09:51
diddledanalso the electron/chrome-style peer to peer thingy works now09:51
diddledan(which fixed webtorrent!)09:51
popeyyay09:51
diddledannot many files then : "Alan Pope just added 365 files"...09:52
diddledanhttps://usercontent.irccloud-cdn.com/file/iybhSeuM/image.png09:53
mborzeckizyga: intersting, 14.04 manpage for systemd mentions /run/systemd/notify as notification socket, yet snapd got something else09:53
popey:D soz09:53
zygamborzecki: hmm09:53
zygadunno :)09:53
mborzeckiheh and /run/systemd/notify is not there in the system09:53
pedronisthe systemd enablement in 14.04 was a bit of  an adventure, not sure the manpages were updated10:12
zygaso I can get my apparmor changes to work10:16
zygabut with some manual tweaking10:16
zygathere's something wrong with an expression apparently10:17
mupPR snapcraft#2096 opened: tests: don't use os_release and repo from snapcraft <Created by kalikiana> <https://github.com/snapcore/snapcraft/pull/2096>10:18
mborzeckirunnig systemd spread again, hopefully all of it works this time10:19
mborzeckis/systemd/watchdog/10:19
mborzeckialso tiny default in Result property of services, when killed by watchdog i've seen it to be signal, or watchdog (recent sytemd) or core-dump (since it got SIGABRT)10:20
zygaOMG10:24
zygaso weird10:24
zygaI mean10:24
zygaapparmor parser and apparmor10:24
zygaok, fixed one more thing and running spread10:31
zyga* matches files but not directories10:31
zygaso to match anything in the /some/path10:31
zygayou need /some/path/{*,*/}10:31
zygaweird, huh?10:31
zyga** matches anything at all so it will match /some/path/dir/evil10:31
zygamborzecki, Chipaca: can you please review the user mounts PR, it is the oldest one around10:52
zygaI'd like to land it but I think it deserves one more look10:52
cjwatson~/wg 5410:54
cjwatsonsorry10:54
mborzeckihmm NOTIFY_SOCKET on ubuntu-14.04 changes with each reboot, @/org/freedesktop/systemd1/notify/13334051644891137417, the last element looks like a timestamp, meaning we cannot just put the path in apparmor rule :/11:07
zygawell11:08
zygawe can just put @/org/freedesktop/systemd1/notify/*11:08
zyga,11:08
mborzeckiyeah, just have the fact that it becomes a special case11:10
KoneHi, can someone explain/link how i can set start parameters for an app that is installed as a snap-package?11:29
mupPR snapd#5079 opened: tests: update the bionic image to the latest one uploaded <Created by sergiocazzolato> <https://github.com/snapcore/snapd/pull/5079>11:29
=== pstolowski is now known as pstolowski|lunch
mborzeckiwell, ubuntu 14.04 systemd watchdog does not appear to work at all11:40
zygamborzecki: maybe it is compiled out partially?11:42
mborzeckino clue, the service is not pinging systemd and it's not getting killed11:43
* cachio afk11:45
mborzeckifwiw it works on 16.04+11:47
jdstrandif the systemd-notify denial is @/org/freedesktop/systemd1/notify/13334051644891137417, you'll need a unix rule for that. eg: unix (receive, send) type=??? peer=(addr=@/org/freedesktop/systemd1/notify/[0-9]&, label=unconfined),12:00
jdstranderr12:00
zygatype=???12:00
jdstrand...addr=@/org/freedesktop/systemd1/notify/[0-9]*...12:00
jdstrandI was going to say, I don't have the whole denial so can't say what it should be exactly12:01
jdstrandI suspect type=stream, but I don't know12:01
zygaah, I get it now12:02
zygajdstrand: btw, I got that apparmor thing to work12:02
zygafrom last week12:02
zygajust iterating to simplify now12:02
zygawith spread passing and everything12:02
jdstrandzyga: as for your CPU pegging profile, perhaps file a bug and try to write a rule that works better12:02
zygait was missing no-simplify-expr12:02
zygait's sad that is on12:02
zygait's pretty much broken IMO12:02
jdstrandzyga: aiui, its utility is profile dependent. idr the details, but jjohansen would12:04
jdstrandzyga: please test the rule on armhf though12:04
jdstrands/rule/profile/12:04
zygajdstrand: ack, will do12:05
jdstrandzyga: we shouldn't have to worry about the performance of certain rules, but the reality is that some things compile faster than others12:06
zygathe current profile compiles very quickly but I will test it on arm as well12:07
mupPR snapd#5080 opened: many: support 'system' nickname in interfaces <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/5080>12:08
mborzeckioff to pick up the kids from school12:08
mborzeckijdstrand: i've updated the interface in https://github.com/snapcore/snapd/pull/4504/commits/6206e555fdbcd94680aa98103cc1aa50b120b84012:10
mupPR #4504: snap, wrappers: systemd WatchdogSec support <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/4504>12:10
=== seb128_ is now known as seb128
=== pstolowski|lunch is now known as pstolowski
zygajdstrand: hey, I published working fix for the apparmor + layouts issue from last week https://github.com/snapcore/snapd/pull/507413:26
mupPR #5074: many: allow mimics in parents of layout <Blocked> <Created by zyga> <https://github.com/snapcore/snapd/pull/5074>13:26
zygajdstrand: I marked the branch as blocked so please don't review it13:26
zygajdstrand: I will split it into a smaller chunk that I will ask you to review13:27
zygajdstrand: I also simplified the "xmas tree" code into a useful generic function that splits a path into read/write rules13:28
* zyga loves this week (starts well)13:34
zygabut hates this evening (rain for the rest of the week starts today)13:34
zygano more biking :(13:34
zygabiking in the rain when it is cold is an acquired taste I lack13:34
mupPR snapcraft#2097 opened: packaging: include changelog for setup.py's version detection <bug> <Created by sergiusens> <https://github.com/snapcore/snapcraft/pull/2097>13:37
mupPR snapcraft#2098 opened: lxd: wait for on-going refreshes to finish <Created by kalikiana> <https://github.com/snapcore/snapcraft/pull/2098>14:10
mupIssue snapcraft#2099 opened: Issues building snap from my favorite and best GUI RSS reader, Feedreader <Created by sirredbeard> <https://github.com/snapcore/snapcraft/issue/2099>14:13
ads20000Wimpress: could you get in touch with Discord about this (I think that's the right action here)? :) https://forum.snapcraft.io/t/discord-ptrace-apparmor-denials/5099/5?u=ads2000014:13
ads20000or popey14:13
matlocksergiusens I tried your advice on my snapcraft post, didn't sort it out, and then the forum blocked my post for spam for linking to github, so here is the status of the issue https://github.com/snapcore/snapcraft/issues/209914:22
matlocksergiusens I am running into 3 different issues trying 3 different approaches to build this snap, you suggested I just let cmake plugin handle everything, but if you will see #1 of my issues is that cmake is not properly handling nested cmake builds, thanks in advance for your assistance14:24
zygajdstrand: the chop tree PR: https://github.com/snapcore/snapd/pull/508114:25
mupPR #5081: interfaces/apparmor: add chopTree <Created by zyga> <https://github.com/snapcore/snapd/pull/5081>14:25
mupPR snapd#5081 opened: interfaces/apparmor: add chopTree <Created by zyga> <https://github.com/snapcore/snapd/pull/5081>14:25
Chipacapedronis: niemeyer: #1766248 fwiw14:30
mupBug #1766248: snap install fails with 'cannot update disabled snap "core"' after 'snap refresh core' <snapd:New> <https://launchpad.net/bugs/1766248>14:30
cpaelzerwhere would I look for snap install logs?14:48
cpaelzerwe are looking at a case wondereing why the install hooks did not run14:49
cpaelzerSaviq: ^^ that is for the libvirt.conf in multipass14:49
kyrofacpaelzer, `snap changes` and `snap change` is the best I know of15:00
Saviqcpaelzer: `snap change --last=install` has «Run install hook of "multipass" snap if present» here15:02
Saviqnothing more15:02
Chipacakyrofa: Saviq: 'snap change' is an alias of 'snap tasks' fwiw15:03
kyrofaChipaca, i.e. snap tasks is the newer, shinier one?15:03
kyrofaIs there also a `snap task`?15:04
Chipacakyrofa: we thought it better reflected what the thing does, yeah15:04
Chipacakyrofa: NO.15:04
kyrofaHahaha15:04
Saviqcpaelzer: mystery solved - install hook only runs on (d'uh) installs - not refreshes15:21
cpaelzeryep15:21
cpaelzerthat matches what I just posted to the forum15:21
cpaelzersoemthing you can resolve on the next version15:21
cpaelzerglad I could help to spot that15:21
cpaelzerSaviq: thanks15:21
Saviqyup, will be fixed before we release15:21
Saviqcpaelzer: thanks!15:22
ogra_hmm15:23
ogra_https://forum.snapcraft.io/t/notepadqq-classic-confinement-request/502415:23
ogra_does "snap install --classic" for a strict confined snap suddenly turn it into a classic snap ?15:23
ogra_or is that guy seeing a bug ?15:24
* ogra_ thought that wasnt possible at all 15:24
Chipacaogra_: you can install strict snaps with --classic15:29
cachioniemeyer, hey, so I need a # SPREAD_GOOGLE_KEY to add to the .travis.yml for the spread-cron branches15:29
Chipacaogra_: if your snap is built appropriately, it'll even work15:29
cachioniemeyer, not sure if this is the only one think we need15:29
cachioand the other issue that you mention is already fixed15:30
cachiothe issue with the elopio keys that were deprecated on travis15:30
niemeyercachio: Ack15:40
jjohansenzyga: yes simpify-expr is sub-optimal and needs to be rewritten, but on average it actually sitll improves most compiles. It isn't so important any more as other parts of the pipeline have been rewritten.15:45
jjohansenFixing it is on the long to do list, it just always seems there are other more important things15:46
zygajjohansen: I'd say it should be off by default, I haven't read the source to say what it does but it was spinning for 10m+ on my beefy box15:46
jjohansenzyga: I haven't seen it do that15:46
jjohansencan you shoot me the profile that triggered it15:47
zygayes, let me re-create it15:47
=== chihchun is now known as chihchun_afk
mupPR snapcraft#2100 opened: build_providers: new build provider using multipass <Created by sergiusens> <https://github.com/snapcore/snapcraft/pull/2100>15:59
zygajjohansen: http://paste.ubuntu.com/p/hPcBjdnSwd/16:03
Facuquestion, if I install a snap as "classic", the process runing from it should be able to see the whole system, right?16:33
naccFacu: yes16:33
zygaFacu: yes16:35
Facunacc, zyga, it's strange... with sparkiegeek we're seeing that Pythons inside the snap are "installed" in a way that don't have access to system libraries... http://linkode.org/#iWFk2Akf4EU6owgbpH4hu116:39
zygaFacu: what I mean is that there's no confinement preventing that, what happens is that for classic snaps the PATH (or PYTHONPATH) is probably altered by snapcraft itself (snapd doesn't touch that) so the snaps "prefers" to see the things it shipped.16:40
zygaAs classic snap can always see what is on the system if it wants to16:40
naccFacu: right, you should check the PYTHONPATH from the snapped python16:40
naccFacu: and e.g., you might need to munge the environment if you need access to the 'host' env16:41
Facunacc, how can I check that?16:41
Facunacc, it's something in the installed snap, or in snapcraft when being built?16:41
naccFacu: something like `snap run --shell <snap>; python (or python3).` And at the interpreter, examimen sys.path ?16:41
naccFacu: both :)16:41
naccFacu: so you're a classic snap that wants to use python package from the host?16:42
Facuzyga, nacc, this "the snap prefer to see the things it shipped" may be useful for snapping apps done in Python, not so much for Python itself (as it's the case of pypy3) or fades, whose purpose is automate virtualenv usage16:42
Facunacc, yeap16:43
zygaFacu: my point is that snapd doesn't touch that16:43
zygait's snapcraft or the snap that needs to be investigated16:43
zygasnapd doesn't constrain anything16:43
zygaor doesn't change PATH16:43
naccFacu: right, what zyga is saying16:43
Facuzyga, perfect! now I'm trying to understand how to fix this :)16:43
zygaFacu: look at the generated launcher inside your prime/ directory16:43
zygait probably sets some environment16:43
naccFacu: so it's by virtue of how snaps are built, that results in their runtime behavior16:43
sparkiegeekFacu: I think it's gonna need some twisting and poking of snapcraft to e.g. ditch the wrapper16:44
naccFacu: so, tbh, we build our own python in our snap -- because you get xenial's python of course, in all envs. Which may or may not work in all host envs.16:44
naccFacu: and because of things like you're seeing :)16:44
zygaAFAIR there's an option to disable the wrappers16:44
zygabut perhaps I'm wrong16:44
zygaI rarely use snapcraft and typically construct my test snaps by hand16:45
naccbut zyga is special that way :)16:45
naccand seems to not be dogfooding :-P16:45
zygawell16:45
Facujajaja16:45
zygaI'm dogfooding things snapcraft doesn't support yet :)16:45
zygabut yeah16:45
naccheh16:45
zygaI actually would like a simpler snapcraft16:45
zygathat is less magic now16:45
zygabut that's a story for another day16:45
nacczyga: +10016:45
nacczyga: it's 'smarter' now, but that has made it more fragile, it seems (and it's hard to know, IMO, what is changing each release from a snap owner perspective)16:46
Facuzyga, with "generated launcher inside prime dir" you meant this exec? prime/command-fades.wrapper16:47
naccFacu: yeah, i think so16:47
Facuexec "$SNAP/usr/bin/python3" "$SNAP/bin/fades" "$@"16:47
Facuno PATH mangling16:47
zygacan you run snap run --shell that thing16:47
zygaand explore $PATH and $PYTHONPATH16:47
naccthat implies there'16:47
zygaand run your $SNAP/usr/bin/python316:48
zygaand explore that too16:48
nacc*there's a python3 in your snap, separate from the one in the core snap?16:48
zygaif you are building python from source it is doing one more thing16:48
naccFacu: are you ?16:48
zygawhen prefix is set to /foo it doesn't look in /usr16:48
zygajust into /foo16:48
zygaso that may be a side effect of your build16:48
naccyeah, that's something we have done in git-ubuntu (on purpose)16:48
Facunacc, I don't put (on purpose at least) a different python in my snap... what I'm packaging is just a lib/script that needs Python to run16:49
Facuit has a     plugin: python16:50
Facu(because it needs Python to be run, right?)16:50
naccoh maybe the plugin pulls it in; but i thought it didn't ...16:50
naccFacu: i thought it used the core snap's python (again, i might be wrong)16:50
Facunacc, it would be great if I can get that! the snap itself (the binary) will be much smaller16:51
sparkiegeekFacu: FTR, using the python inside the snap, from that wrapper, then manually adding /usr/lib/python3/dist-packages to sys.path does the right thing16:51
naccsparkiegeek: right, that makes sense16:51
naccsparkiegeek: i assume your code is defensive enough for when an expected dist-package is not present, btw ? :)16:51
sparkiegeekFacu, nacc: AIUI the python plugin always ships its own python because of the shenanigans that it does to Python to get the import path right16:51
Facuzyga, nacc, I'm not sure how to use "snap run --shell"16:52
naccsparkiegeek: ah ... that could be16:52
naccsparkiegeek: it did not, at some point :)16:52
naccFacu: if you ran it, `snap run --shell <snap name>`16:52
sparkiegeekFacu: snap run --shell fades16:52
naccit will put in a shell that is the same environemnt as your snap runs in16:52
nacc`env | grep SNAP` to see what is set16:52
nacccd $SNAP to switch to the snap''s directory, etc.16:52
Facuit doesn't, just ends16:53
naccFacu: what doesn't, what ends?16:53
naccFacu: the shell won't say anything16:53
naccFacu: it literally spawned a new shell process16:53
zygaare you inside the snap run --shell shell by any chance?16:53
Facuoh!16:53
Facuno prompt change or anything?16:53
naccFacu: right :)16:53
Facupff16:53
zygaI think we tried but it was not working well16:53
zygaor is not in stable yet16:54
zygaI forgot16:54
naccyeah, it's not something that is easy to do, in some sense, because what the prompt will be is sensitive to the snap's env now16:54
sparkiegeekwell, you might have a classic snap that wants to do something with $PS1 :)16:54
naccright16:54
naccor even to what 'bash' is :)16:54
Facunacc, zyga, snap env: http://linkode.org/#Txhr9JNzC4iueywyfA3bx316:55
naccFacu: what is sys.path by default (run `python3` then import sys\nprint(sys.env) or so16:55
naccFacu: from what i can tell it's what sparkiegeek already said, though, the system paths are not in PYTHONPATH (sys.path at runtime)16:56
sparkiegeek$ $SNAP/usr/bin/python3 -c 'import site; print(site.PREFIXES)'16:57
sparkiegeek['/snap/fades/169/usr', '/snap/fades/169/usr']16:57
sparkiegeekI think that's the key point16:57
Facubeing inside the snap shell (confirmed) it looks that python3 is from the system?16:57
Facu$ which python316:57
sparkiegeekFacu: $SNAP/usr/bin/python3 is what the wrapper uses16:57
naccFacu: right, so PATH isn't changed for classic snaps (iirc)16:57
naccFacu: unless you manually change it16:57
Facusparkiegeek, nacc, this looks like the responsible: SNAP/usr/lib/python3.5/sitecustomize.py17:01
Facuforgot the $17:01
* sparkiegeek nods17:01
sparkiegeeksergiusens: ^ that's deliberate right?17:01
* zyga -> break17:02
naccsparkiegeek: Facu: so what we do in our yaml is in the environment: field for the app, we set PYTHONPATH to something specific (in our case, internal to the snap). You could just as easily set it to something outside the snap, e.g. the host's python env)17:02
naccsparkiegeek: but i believe you are right, that is a deliberate thing (not 100%, i'm not a snapcraft developer :)17:03
sparkiegeeknacc: trying to determine the target host's python env at "compile"-time is fraught with error though  :)17:03
Facunacc, but me, as a developer doing stuff in snapcraft, I don't know the host's python env for the all users running my snap17:04
naccyou can do, iirc17:04
naccORIG_PYTHONPATH: "$PYTHONPATH"17:04
naccin your environemnt yaml17:04
naccthen you'd need to have your own wrapper17:04
naccnow, i'm not sure if that's actually necessary, i'd wait for sergiusens :)17:05
naccbut i believe it would work17:05
sparkiegeekright, but once you go for 'have your own wrapper', the whole problem goes away AFAICS17:05
sergiusens_sparkiegeek: not following, what is deliberate, using sitecustomize instead of PYTHONPATH? If that is the question, yes; there are multiple reasons, one is, using a staged python to build other parts, another a python application calling into another python application17:05
naccsparkiegeek: yeah :)17:05
mupPR snapd#5079 closed: tests: update the bionic image to the latest one uploaded <Created by sergiocazzolato> <Merged by zyga> <https://github.com/snapcore/snapd/pull/5079>17:05
sergiusens_like snapcraft being a python application, if PYTHONPATH were set and we called into bzr (which is also python2) a mess will occur17:06
Facusergiusens_, we may have wandered badly around the original problem, maybe you have another POV on the original problem and may focus us better17:06
sparkiegeeksergiusens_: basically the issue we're seeing is that a classic snap is not using the system python interpreter, and doesn't have the system python's environment17:06
=== sergiusens_ is now known as sergiusens
Facusparkiegeek, which, written that way, may be a feature :/17:07
sparkiegeekFacu: well... *classic*17:07
sparkiegeeksergiusens: so Facu makes 'fades' which allows you to maintain virtualenvs. It has a --system-site-packages flag, which is broken, because the 'system' that it's seeing is the one inside the snap, which ain't all that helpful17:07
sergiusenssparkiegeek: oh, yeah, the python plugin is meant to use an in_snap python; you'd need to roll your own for other things, then again, just `dump`17:08
Facusergiusens, "dump"?17:08
sergiusenswhat if I `apt purge python`? will fades work?17:08
sparkiegeekFacu: https://docs.snapcraft.io/reference/plugins/dump17:09
sergiusensFacu: and  https://docs.snapcraft.io/build-snaps/pre-built17:10
zygapstolowski: I found one more interesting bug in layouts thanks to you. :-) we don’t preserve permissions on directories mimicked as writable17:10
zygaAnd some software complains when certain things get world writable17:10
zygaI will fix it next17:10
Facusergiusens, sparkiegeek, ubuntu core already brings a Python, right? it's Py 3? does it have access to system's libs? may I use *that* from the snap?17:11
sergiusensFacu: yes, you can, but not if it is classic as there will be ABI breakages when using that on a newer system such as 18.0417:12
Facusergiusens, well, I should leave "classicness" at some point17:13
sparkiegeekFacu, sergiusens: right - that, plus it has similar issues17:13
sparkiegeek['', '/snap/core/current/usr/lib/python35.zip', '/snap/core/current/usr/lib/python3.5', '/snap/core/current/usr/lib/python3.5/plat-x86_64-linux-gnu', '/snap/core/current/usr/lib/python3.5/lib-dynload', '/snap/core/current/usr/local/lib/python3.5/dist-packages', '/snap/core/current/usr/lib/python3/dist-packages']17:13
sergiusensit should have the same issues with different paths17:13
sparkiegeekthat's sys.path from the python in core17:13
sparkiegeeksergiusens: indeed17:14
sparkiegeekI mean, that's expected17:14
Facusparkiegeek, I'm not sure if we have a clean good solution for this :/17:21
Facusparkiegeek, not even a reasonable hack17:22
Facusparkiegeek, it will be great if there's a workaround a user (you) could do17:22
sparkiegeekFacu: well I think nacc's suggestion of ORIG_PYTHONPATH might be reasonable17:22
naccsparkiegeek: Facu: the advantage of it is that it makes some sense that only the snap-generator knows about this nuance, and then the app wrapper itself17:23
Facusparkiegeek, but my PYTHONPATH doesn't include system libs17:23
naccoh it's your sys.path in the host environment, probably17:24
sparkiegeekFacu: sure, I mean it doesn't *have* to be exactly like that but could be something like ' run python from the host, grab it's sys.path, add them to the one inside the snap'17:24
naccso your wrapper, could, technically do what sparkiegeek is suggesting17:25
Facusparkiegeek, and that at "snap install" time, right?17:25
sparkiegeekFacu: no, that would be a wrapper for the command, which then invokes fades17:25
Facuah, everytime it runs?17:25
sparkiegeekyes17:25
naccFacu: right it's part of your (snapped) app's definition17:26
naccwhich in this case, I think, makes sense17:26
naccand your app code wouldn't need to change at all, hopefully, as it's all in the yaml and the wrapper17:26
Facunacc, sparkiegeek, something like the following? export PYTHONPATH=`python3 -c "import sys, os; print(os.pathsep.join(path for path in sys.path if path.startswith('/usr')))"`17:33
naccFacu: why do you only want what is in /usr ?17:35
naccFacu: e.g., what if user is using some special python installation by default17:35
Facunacc, makes sense; I should just filter out the empty one17:37
naccFacu: yeah, i think that's sensible17:37
kyrofazyga, if I install a snap and get "error: cannot install snap file: snap is unusable due to missing files; contact developer"17:41
kyrofazyga, is there a way for me to determine what exactly is missing?17:41
zygaYes17:41
zygaJust apps are inspected17:42
kyrofazyga, oh, it was seeing if the app actually exists?17:42
zygaI think there is some more places where you can run a command and see17:42
zygaBut I’m AFK now, chipaca would know17:42
zygaCheck your declared app command17:43
kyrofazyga, yep, that was it, thank you! Some nice feedback in that error (what the actual issue is) would be helpful17:44
mupPR snapcraft#2101 opened: errors: implement an always option to send to sentry <Created by sergiusens> <https://github.com/snapcore/snapcraft/pull/2101>17:44
Facusergiusens, nacc, sparkiegeek, do you know about any doc to how provide wrapper changes/replacement?17:45
naccFacu: i did it with trial and error, but basiclaly in your app defintion, you chang ethe command: to point at some script you install into your snap17:47
Facunacc, currently the "command" points to a Python script called "bin/fades"... it looks it's building the wrapper around that... you say that if I change it to "bin/fades_wrapper_for_snaps.sh" it will not build a wrapper around it?17:51
* Facu tries17:51
naccFacu: well, it will, but the wrapper will call your script17:51
naccFacu: (iirc) -- and then your script calls bin/fades17:51
Facunacc, snapcraft crashes badly :/  http://linkode.org/#5b4uN7fV4HG2rbCTBkxtU318:02
naccFacu: you have to be careful18:02
nacc'python3' in your snap wrapper is running in the context of the snap18:02
naccah that's one reason not to do it in the wrapper i suppose18:03
Facunacc, what if I do /usr/bin/python318:03
Facu?18:03
naccFacu: right, i'd try that18:04
Facuin any case, you say that's why it crashes now?18:04
naccFacu: i'm not sure :/ -- but i'd use absolute paths for everything in your wrapper18:04
Facuabsolute path fixed, snapcraft still crashing18:04
naccFacu: hrm, it seems to think there is no pip installed in the part18:05
nacc(iiuc)18:06
pstolowskizyga: wow, amazing....18:08
niemeyerChipaca: #5066 finally reviewed..18:09
mupPR #5066: overlord/snapshotstate/backend: introducing the snapshot backend <Created by chipaca> <https://github.com/snapcore/snapd/pull/5066>18:09
Facummm... snapcraft just crashes, without any change in the project18:11
naccFacu: i was going to ask that next18:11
Facuja! my bad! I was using it where I played with PYTHONPATH18:11
naccFacu: :)18:11
* Facu slappes himself18:11
Chipacakyrofa: hello18:56
Chipacakyrofa: I'm past my EOD, but, when you get that 'cannot be installed' thing, the log will have the details18:56
Chipacakyrofa: the 'journalctl -u snapd' log18:56
kyrofaChipaca, ah, good to know, okay, thank you :)18:57
Chipacakyrofa: it's not just the apps18:57
Chipacait also checks that all of meta is sane18:57
Chipaca(and things that count as 'not sane' include vim scratch files for example)18:57
Chipacakyrofa: let me know what you find18:58
mupPR snapcraft#2102 opened: tests: use a common cache for the integration tests <Created by sergiusens> <https://github.com/snapcore/snapcraft/pull/2102>19:30
mupPR snapcraft#2103 opened: package: make use of snapcraftctl snapcraft features <Created by sergiusens> <https://github.com/snapcore/snapcraft/pull/2103>21:33
mupPR snapcraft#2097 closed: packaging: include changelog for setup.py's version detection <bug> <Created by sergiusens> <Merged by kyrofa> <https://github.com/snapcore/snapcraft/pull/2097>21:51

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!