www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Snap packages for DMD and DUB

reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
Hello all,

As announced at DConf 2017, snap packages are now available for 
DMD 2.074.0 and DUB 1.3.0 in the official snap store.  These 
should allow for installation on multiple different Linux distros 
(see below) on i386 and amd64 systems.

Installing them is simple: first follow the `snapd` installation 
instructions here:
https://snapcraft.io/docs/core/install

... and then:

     sudo snap install --classic --channel=edge dmd
     sudo snap install --classic --channel=edge dub

where the `--classic` flag grants permission for the confinement 
options required by the packages.

The `dmd` package also contains `rdmd`, `dustmite` and 
`ddemangle`.  Note that by default the snap package exposes these 
namespaced on the name of the package (i.e. `dmd.rdmd`, etc.).  
To avoid this, use the `snap alias` command:

     sudo snap alias dmd rdmd
     sudo snap alias dmd dustmite
     sudo snap alias dmd ddemangle

... and then it should be possible to use the regular commands.

Currently these packages are only released in the `edge` channel 
(out of `edge`, `beta`, `candidate` and `stable`).  It would be 
good to have as many people (on as many different supported 
distros) try them out in order to get confirmation that they are 
working properly.  Currently they are expected to work on at 
least:

   * Ubuntu 14.04, and 16.04 or later

   * Debian Testing and Unstable

   * OpenSUSE Leap

In principle they ought to work on any system with a recent 
enough `snapd` (2.21 or later), but the above are the ones I have 
tried them on.

On systems with snapd 2.24 (the latest release) it looks like 
there is an issue with rdmd: the sandboxing interferes with rdmd 
writing to the `/tmp` directory.  It's not clear at this point if 
this is an issue with snapd or with rdmd itself, but I'm looking 
into it.

Special thanks to Martin Nowak who took time with me at DConf to 
help in setting up the snap store account for these packages.

Enjoy, and let me know how you all get on with these packages!

For more info on snap packages and how to use (and create) them, 
see:
https://snapcraft.io

Thanks & best wishes,

     -- Joe
May 08 2017
next sibling parent reply bachmeier <no spam.net> writes:
On Monday, 8 May 2017 at 20:05:01 UTC, Joseph Rushton Wakeling 
wrote:
 Hello all,
[...]
 Enjoy, and let me know how you all get on with these packages!

 For more info on snap packages and how to use (and create) 
 them, see:
 https://snapcraft.io

 Thanks & best wishes,

     -- Joe
Thanks for making these available. I needed to install ldc today, so I used the snap package. Installation was trivial (Ubuntu 16.04).
May 08 2017
parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Monday, 8 May 2017 at 20:23:36 UTC, bachmeier wrote:
 Thanks for making these available. I needed to install ldc 
 today, so I used the snap package. Installation was trivial 
 (Ubuntu 16.04).
That's great to hear. Note that it's also trivial to swap between the current stable release and the latest beta, if you want to try things out: sudo snap refresh --channel=1.3/beta [to switch to the 1.3.0-beta1 release] sudo snap refresh --channel=stable [to switch back to the latest stable release]
May 08 2017
prev sibling next sibling parent reply Piotr Mitana <a niepodam.pl> writes:
On Monday, 8 May 2017 at 20:05:01 UTC, Joseph Rushton Wakeling 
wrote:
 Hello all,

 As announced at DConf 2017, snap packages are now available for 
 DMD 2.074.0 and DUB 1.3.0 in the official snap store.  These 
 should allow for installation on multiple different Linux 
 distros (see below) on i386 and amd64 systems.
Hello, I have tried those snaps recently on Ubuntu 16.10. There were -fPIC related errors (if you need the output, I can install the snap again and post it tomarrow).
May 11 2017
parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Thursday, 11 May 2017 at 11:47:10 UTC, Piotr Mitana wrote:
 Hello, I have tried those snaps recently on Ubuntu 16.10. There 
 were -fPIC related errors (if you need the output, I can 
 install the snap again and post it tomarrow).
Ouch! Thanks for reporting this: it sounds like something similar to what Attila was reporting for his attempts at building on Arch. I'll look into it and see if I can fix packaging side (it's probably possible by tweaking CFLAGS), before submitting fixes upstream if it's something that can reasonably be addressed there.
May 11 2017
parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Thursday, 11 May 2017 at 14:46:10 UTC, Joseph Rushton Wakeling 
wrote:
 On Thursday, 11 May 2017 at 11:47:10 UTC, Piotr Mitana wrote:
 Hello, I have tried those snaps recently on Ubuntu 16.10. 
 There were -fPIC related errors (if you need the output, I can 
 install the snap again and post it tomarrow).
OK, looks like `-fPIC` was missing from some of the druntime and phobos build commands. I've pushed a patch to the `dmd` package definition that should fix this. Can I confirm whether you had these problems with `dmd` only or also with the `dub` package?
May 11 2017
parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Thursday, 11 May 2017 at 22:30:52 UTC, Joseph Rushton Wakeling 
wrote:
 OK, looks like `-fPIC` was missing from some of the druntime 
 and phobos build commands.  I've pushed a patch to the `dmd` 
 package definition that should fix this.
Hmm, no dice. I'll look into this further in the next days.
May 11 2017
parent reply Petar Kirov [ZombineDev] <petar.p.kirov gmail.com> writes:
On Thursday, 11 May 2017 at 22:52:54 UTC, Joseph Rushton Wakeling 
wrote:
 On Thursday, 11 May 2017 at 22:30:52 UTC, Joseph Rushton 
 Wakeling wrote:
 OK, looks like `-fPIC` was missing from some of the druntime 
 and phobos build commands.  I've pushed a patch to the `dmd` 
 package definition that should fix this.
Hmm, no dice. I'll look into this further in the next days.
This should fix it: https://github.com/dlang-snaps/dmd.snap/pull/7 It seems that you added PIC on the tools repo, instead of druntime. I missed that too when debugging the snapcraft build myself. Looking at the diff without expanding it on github (https://github.com/dlang-snaps/dmd.snap/commit/b82fb60cb33e6ed42534e 6f8703f75702f2c9fb) can be quite confusing. I came back to that file only after reading the druntime, phobos and tools makefiles several times and scratching my head for about an hour :D
May 15 2017
parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Monday, 15 May 2017 at 21:07:05 UTC, Petar Kirov [ZombineDev] 
wrote:
 This should fix it: 
 https://github.com/dlang-snaps/dmd.snap/pull/7
Thanks ever so much for that. It's really nice to have the first not-by-me patch in that repo, especially when it comes with such a nicely-written commit message :-)
 It seems that you added PIC on the tools repo, instead of 
 druntime.
 I missed that too when debugging the snapcraft build myself. 
 Looking
 at the diff without expanding it on github 
 (https://github.com/dlang-snaps/dmd.snap/commit/b82fb60cb33e6ed42534e
6f8703f75702f2c9fb) can
 be quite confusing. I came back to that file only after reading
 the druntime, phobos and tools makefiles several times and
 scratching my head for about an hour :D
D'oh! Thanks again for taking that time. I think I'm going to hold some of the shorter-term effects of DConf responsible for the misplaced PICs ... :-P With your patch in the repo, the packages should be automatically rebuilt and uploaded some time in the next hours. I'll follow up with an announcement here once that has happened.
May 16 2017
parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Tuesday, 16 May 2017 at 19:56:56 UTC, Joseph Rushton Wakeling 
wrote:
 With your patch in the repo, the packages should be 
 automatically rebuilt and uploaded some time in the next hours.
  I'll follow up with an announcement here once that has 
 happened.
Patches with Petar's PIC fix in them have now been uploaded to the store. I've tested on Ubuntu 16.10 and 17.04 and they seem to work well.
May 16 2017
parent Petar Kirov [ZombineDev] <petar.p.kirov gmail.com> writes:
On Tuesday, 16 May 2017 at 20:35:51 UTC, Joseph Rushton Wakeling 
wrote:
 On Tuesday, 16 May 2017 at 19:56:56 UTC, Joseph Rushton 
 Wakeling wrote:
 With your patch in the repo, the packages should be 
 automatically rebuilt and uploaded some time in the next hours.
  I'll follow up with an announcement here once that has 
 happened.
Patches with Petar's PIC fix in them have now been uploaded to the store. I've tested on Ubuntu 16.10 and 17.04 and they seem to work well.
Nice, thanks for the quick merge :)
May 16 2017
prev sibling next sibling parent reply Piotr Mitana <a niepodam.pl> writes:
On Monday, 8 May 2017 at 20:05:01 UTC, Joseph Rushton Wakeling 
wrote:
 Hello all,

 As announced at DConf 2017, snap packages are now available for 
 DMD 2.074.0 and DUB 1.3.0 in the official snap store.  These 
 should allow for installation on multiple different Linux 
 distros (see below) on i386 and amd64 systems. [...]
Hi, I got yet another error - this time Ubuntu 16.04 and rdmd. Failed to flush stdout: Permission denied Failed: ["dmd", "-v", "-o-", "main.d", "-I."] It seems like (despite classic confinement) apps ran by rdmd cannot print things on the screen...
Jun 06 2017
parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Tuesday, 6 June 2017 at 08:20:54 UTC, Piotr Mitana wrote:
 Hi, I got yet another error - this time Ubuntu 16.04 and rdmd.

 Failed to flush stdout: Permission denied
 Failed: ["dmd", "-v", "-o-", "main.d", "-I."]

 It seems like (despite classic confinement) apps ran by rdmd 
 cannot print things on the screen...
Yes, this is a known issue :-( It's related to how AppArmor is used by snapd, rather than anything in the package. See discussion here: https://forum.snapcraft.io/t/failed-to-flush-stdout-permission-denied/485 You can use a workaround, which is to explicitly point `rdmd` to the actual compiler binary rather than relying on $PATH: rdmd --compiler=/snap/dmd/current/bin/dmd or, instead of `rdmd --compiler=ldmd2`, try: rdmd --compiler=/snap/ldc2/current/bin/ldmd2 etc.
Jun 06 2017
prev sibling parent reply Johan Engelen <j j.nl> writes:
On Monday, 8 May 2017 at 20:05:01 UTC, Joseph Rushton Wakeling 
wrote:
 The `dmd` package also contains `rdmd`, `dustmite` and 
 `ddemangle`.  Note that by default the snap package exposes 
 these namespaced on the name of the package (i.e. `dmd.rdmd`, 
 etc.).  To avoid this, use the `snap alias` command:

     sudo snap alias dmd rdmd
     sudo snap alias dmd dustmite
     sudo snap alias dmd ddemangle
Have you thought about creating a `dtools` package with rdmd, dustmite, and ddemangle in it? They are useful for LDC and GDC too, perhaps people would like to be able to install them without needing to install DMD. (Perhaps the DMD/LDC/GDC package can automatically install such a "dtools" package?) cheers, Johan
Jun 06 2017
parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Tuesday, 6 June 2017 at 14:27:40 UTC, Johan Engelen wrote:
 Have you thought about creating a `dtools` package with rdmd, 
 dustmite, and ddemangle in it?
 They are useful for LDC and GDC too, perhaps people would like 
 to be able to install them without needing to install DMD.  
 (Perhaps the DMD/LDC/GDC package can automatically install such 
 a "dtools" package?)
Yes, I did consider this, and I may do it if there is an ongoing issue with `rdmd`. It might for example be possible to entirely disable confinement for such a dtools package, as a short term measure to avoid the current problems. I did have some discussion over the advisability of splitting up the `dmd` snap package in this discussion thread: https://lists.ubuntu.com/archives/snapcraft/2017-March/003645.html ... albeit I was coming at things from a slightly different angle there. The short version is, keeping everything in one snap might reduce the amount of duplication; but I'm not sure that it's a very big deal in any case. AFAIK snap packages don't have an equivalent of deb packages' "Recommends", but I can raise the issue. On a different note: does anyone have an interest in there being dmd versions available other than the most recent?
Jun 06 2017