New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Meson build definition #20
Conversation
As mentioned on biod/BioD#26, I think
|
Testing it with Travis would mean dropping the |
There seems to be another way without the Docker container (I am not sure how long the provisioning on Travis takes) by directly download a newer ninja binary: https://github.com/mesonbuild/meson/wiki/Continuous-Integration |
4853fb3
to
3ae0b27
Compare
I found a way to have the Meson build work without sudo or Docker in Travis :-) |
74fd6ea
to
a6f4190
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice :)
Sorry, I don't understand this PR. I understand that undeaD can be used as a source library without requiring any particular build tool (rdmd would work), but I see there are also makefiles and a
IMHO, I think we are good the way things are. There are a few build tools/systems which are common across D projects (Make, Dub, rdmd) and supporting those is sufficient for official / semi-official projects. If there is interest in making Meson more popular for D projects, I think this is the wrong place to start; it would have to be either the top (DMD/Phobos/Druntime) or the bottom (great popularity among D users' projects). If there is desire to support more build systems, this can be done in a separate repository tracking this one, which delimits the maintenance burden according to the maintainers' interests better. |
This is frowned upon by distro policy - we would need to justify doing that, which is annoying. Even static libraries are a bad thing, but due to D's ABI instability having a static lib is more justified.
As long as the package is in Debian, you can count on us fixing issues, since we want to have it build. In any case, except for adding new files to the
If someone added cmake, we would happily use that. What we want from the build system is:
If there is any one such buildsystem doing the job and providing all requirements, we are happy and don't really care which one it is (it should be packaged in Debian though ^^). The install requirements aren't even strictly necessary, but the reduce the amount of work packaging this software is for us. So, in general I don't care about the buildsystem, if there is just any one working there, I am happy - I just find Meson to be particularly easy to work with compared to cmake+D and Automake+D.
No. Rdmd isn't even in Debian yet, dub doesn't work for distro packaging at least until a lot of its bugs are fixed (no write to home, install missing, discover local packages and global locations, use shared libraries instead of building everything from source, etc.) and Makefiles don't provide all features unless someone adds all features manually (which is possible, but not work I want to do).
Nah, this is just to scratch an itch - if someone writes a cmake build definition, or any other solution, we're happy too. DMD can't be packaged in Debian (non-free) and the other interesting pieces (runtime/phobos) are in LDC and GDC which provide Automake and cmake buildscripts, so there is not much need to add another buildsystem if the existing one is sufficient. In any case, even if you would not accept this patch, we will patch it in downstream to be able to build BioD in Debian (which is Andreas' goal here). FTR: https://anonscm.debian.org/git/debian-med/libundead.git |
Thanks for the explanation. Could you please elaborate why the build definition needs to be in the project's source tree, and not part of the distro's package specification? For example, in the case of Arch Linux, the package build instructions (the Also, would it be reasonable to just improve the makefiles to handle whatever's missing there for Debian packaging?
I was surprised by this. |
Because it's not distro-specific. Anyone can use the Meson build file, even Fedora and Arch might want it, while a
Of course that would be an option - adding a pkg-config file is relatively easy, the biggest annoyance is usually multiarch support. But expanding the Makefiles is - at least from my perspective - much more work than adding ~50 lines of Meson build definitions.
Each package has a maintenance cost, and the D team in Debian consists of only two active people. Also, nothing is using rdmd yet, the DebianMed team (which is actually packaging undeaD/BioD/Sambamba) just encountered the first one with Sambamba, and replacing rdmd was easier than taking on the cost of maintaining dlang/tools - at least for now. This might change in future. |
Understood. However, if a build system is only used in practice when building a package for one distribution, it's still effectively distro-specific :) If another distro tomorrow proposes adding a build specification for a different build system and argument that they can't use either Meson or dub/rdmd/make for reasons similar to your arguments above, we are back to the same dilemma. Granted, this is probably unlikely in this case, but I'm also interested in finding the correct solution here so that it could work as a precedent for future similar situations. I hold the opinion that files specific to tools which are immediately useful to a single party should be maintained in a repository under that party's control. Though, of course, this is just my personal opinion and it's ultimately up to @dlang. Since this is becoming political, pinging @andralex @WalterBright @MartinNowak to weigh in. |
Since BioD is using Meson too, having it in undeaD would be kind of necessary to make their Meson builds work outside of Debian. Granted, technically Meson isn't required here but something installing a pkg-config file to the right place, but Meson is one way to achieve that.
Any distro shipping GNOME will have Meson, since many GNOME tools are switching to it - some developers even claimed that they will support Meson exclusively soon. I don't know any distro which doesn't have it yet. If someone wants a cmake build file or extend the Makefile, do it and we can drop the Meson file. I really don't care as long as there is any one build system available which works well with distro packaging. We can always patch stuff downstream, but especially stuff which is useful for many parties makes sense to submit back to upstream projects (like in this case). |
OK, but I see that the Meson build file was also added there by yourself, so I think it wouldn't be fair to count BioD as an additional party using Meson, as they likely wouldn't have added one from their initiative. Here is the discussion for that change: biod/BioD#26
Good to know. Full disclosure, I went into this conversation biased by having never heard of it before today.
Would you actually need to patch anything in this case, though? I understand that you would simply need to include and invoke
I don't disagree, I just think it would be prudent for there to be evidence that the contribution is indeed immediately useful to multiple parties before accepting it into the source tree. I hope we can agree on that. I think the proper way forward is to keep this PR open until a second party will find the addition here immediately useful (but that's just my opinion). |
Jup, but BioD initially only had a dub file which we can do nothing with at the moment, until dub is changed to work well for distros. So, in case of BioD, anyone who wants it in their distro will need to use the Meson file at time (I seriously tried to make dub work for packaging last year, and it only sort of worked with loads of hacks and ultimately writing Makefiles and Meson files for each project was by far the easier way).
I was also very skeptic, but after going to lunch with one of the Meson developers at the last GUADEC conference I was convinced (and at the time, this neatly solved the dub issues we had at Debian, and Meson upstream helped me a lot in adding support for the D language to it. So far, this is a great success :) )
Classical henn-and-egg problem here ;-) I am not aware of other distros wanting to package undeaD (I originally asked Andreas who is doing the packaging at Debian to port BioD away from undeaD, but that is way more work than I expected and not feasible for us downstream at time - aspecially since it will break ABI and API, which is a no-go). But when it happens, they will find the Meson file helpful. Btw, for me it's all a matter of how much effort it is to make stuff work for Debian. For GtkD for example, a pretty complete makefile existed already, so the easiest way to make that work for us was to just submit a few patches to make it follow the Debian FHS. Here, adding a Meson file was just simpler. |
I think any D package being packaged by two different distros using a Meson build would work, as then that would be the precedent that this PR could follow. |
At least appstream-generator is built using Meson in Arch (and its dependency mustache-d is as well): https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/appstream-generator |
Another submission: #33 |
Meson does nog allow for wild cards. It is also considered bad practice for reproducible build systems.
I think it is done in #33. |
I wonder who is still using unDead outside sambamba? Maybe I should just merge the code into our tree and be done with it. Not much of a point of having an unDead package in major distros if no one uses it. |
https://github.com/search?q=%22import+undead%22+language%3AD&type=Code
Never heard of that project before now. Did I misunderstand the question? |
Woops! I stand corrected. Code never dies, as they say. Very much unDead. sambamba is used around the word in sequencing centers. 43K downloads on Bioconda. https://github.com/biod/sambamba |
I think we can leave this out. BioD was the main driver for meson. See #33. |
Jup - I have no interest in undeaD other than for making BioD work. Ideally, each project should just drop undeaD dependencies as soon as possible anyway. |
This adds a Meson build definition to this project, to allow projects using Meson to easily use it, and to make packaging undeaD in Linux distributions like Debian and Fedora much easier.
(Meson is already well supported in Debian, we need to have D include files installed properly, and having a pkg-config file is very useful to help other tools find the library when building)
The build can be tested by installing Meson, then running:
You can learn more about Meson here: http://mesonbuild.com/