Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[RFC 0132] Meson Builds Nix #132
base: master
Are you sure you want to change the base?
[RFC 0132] Meson Builds Nix #132
Changes from 53 commits
9714f41
85759af
003393e
3e0be88
d4497fd
18c732d
a843fb1
0bf382d
6c3f5d2
bd4bfe9
e1a0620
0060937
265020c
b7b859b
3eea629
8650a36
ab2dec1
6980048
b58c8b6
17069b6
9821ad2
ab42c2f
3111e49
9d89692
dca9276
38f3c44
714457b
894946b
72dec20
6d8f6bd
94eb5c7
934555d
16e2033
8dadf6a
587d349
86bc4bc
9ad0874
5e621af
3de1372
c5a9e48
3f1182c
e361407
a228c6f
aef0827
212bf63
4df4944
0a41323
e071944
d8904e9
680e6b8
0430b71
61ad7c4
afca581
9bb63e0
e6b4e05
719562c
e4715c4
f37cedd
5b0a734
56c86fa
b03e5b6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you provide examples to changes that affect compatibility? Are there issues you can link?
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.
@asymmetric bunch of stuff; some of the issues were to do with hardcoded library dependencies that are set up differently on *BSD, the wrong versions of some headers were included on BSD (sometimes headers have names that differ). there were also issues with locating external components iirc.
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.
Right, but I was suggesting these issues could be mentioned in the RFC itself, possibly with references!
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.
thats a fair point, but more detailed info of these issues would require someone to attempt building nix on multiple different platforms, and take notes. not saying its a bad idea/shouldnt be done but it would take some time
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.
I agree with @asymmetric, this needs some concrete examples for the point to really stand
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.
NixOS/nix#6991 << example :)
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.
Yes, and that PR has a very illuminating comment from me:
This issue has been separately discovered by a variety of people building nix for use as a packager manager but not as an OS. Meson would solve the problem for free, as part of providing functionality that Make doesn't have and is apparently needed.
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.
I can see why that could be so in the long run, but it's an indirect and non totally obvious consequence. It's probably worth explaining a bit more
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.
I believe @p01arst0rm can provide more tangible evidence for it.
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.
meson allows standardised methods of creating targets; dependencies, libraries, binary files, macros, etc. due to design these blocks are incredibly easy to understand in their design, and the implementation of each is standard no matter the project; each of these implementations is heavil documented, explain how and how not to format these targets. meson code is well known for being self documenting;- not in a "read the code and you'll understand it maybe", more like every single piece of standard meson code explains exactly what its doing and includes a short essay of exceptional documentation regarding its use. this style is so influential that competing build systems are already attempting to follow in mesons' footsteps. the only time things maaay get confusing are when you start creating non standard targets to do weird things (known as custom_targets). good meson code should have as little of these as possible.
tldr meson code easy to read and lots of docs means you're never looking at a meson build command confused about what it does.
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.
I trust you on that, but I'd rather see this written in the RFC than hidden in a comment thread ;)
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.
Shouldn't that be part of the “bootstrapping” subsection?
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.
Not so much. Bootstrapping is mostly useful for the Nix team.
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.
Aren't both paragraphs answering the question of “how hard it it to get Nix to build from scratch?”
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.
Yes, but from different perspectives.
For an already consolidated package manager like, say, Gentoo, they will merely put Meson and Ninja as build dependencies in their ebuilds.
For the "bootstrappers" with a C/C++ toolchain (already required for building Nix), they will need to compile Python from sources in order to compile Meson - or alternatively compile Muon.
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.
For the sake of completeness there should probably also be an item here about bazel, buck & friends
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.
I believe it is well summarized on the examples of waf and premake.
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.
Not exactly. The argument against them is that they are a language-specific DSL, but that's not the case of Bazel or Buck.
They do have a bootstrap problem ofc, but it's a different one (single implem, lots of deps)
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.
A different one, and considerably worse than Meson. Cmake would be way better than them.
I do not believe they deserve more than a mention. If anyone is interested on picking Buck or Bazel or Imake, kudos to them!
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.
Well now, let's be fair, there's definitely more than one implementation of Bazel.
The original design of it is Google's internal closed-source thing designed specifically to meet Google's distributed cloud computing needs, after all. ;) Bazel itself is just an open-source attempt to make
BUILD
/*.bzl
files look like an acceptable thing for other projects to include to make Google's life easier. ;)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.
My list of complaints:
I know nothing about them
They are built in Java
There is no alternative implementation in another language like C or C++ or even Python
I do not like Java
Java support on Nixpkgs is not the best in this planet
Bootstrap Java is a hell:
Java is heavier than Python
Have I said I do not like Java?
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.
yep sounds about right 🤣
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.
Maybe too late. Has Zig been considered? It claims being an alternative:
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.
the entire point of meson is it offers the ability to compile all projects regardless of source language, build environment, linker, or compiler configurations. it offers flexibility and simplicity which allows easy maintainability into the future. the zig buildsystem is designed for c/c++ and is not nearly as well documented or flexible.
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.
Also Zig is oriented to Zig itself, while Meson is general-purpose.
Using Zig as Autotools replacement would be as worse as - or even worser than - using Bazel or Waf.
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.
Just as a comment, adding (TM) after "Google" seems a bit snarky/edgy/weird especially considering that "Meson is a registered trademark of Jussi Pakkanen" per https://mesonbuild.com/legal.html - so should every mention of it in this RFC also be rewritten to "Meson(TM)"?
I get that apparently Bazel or Google isn't popular or it might also not be the right choice for building/bootstrapping
nix
, but this whole section feels very unprofessional in style and argumentation, both in the document itself as well as the discussion here in the PR.If you for example just want a simple way to define build steps and save time on rebuilds, you could even just use https://gittup.org/tup/ instead of adopting a complicated system like Meson.
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.
I have years experience with tup. It is a really bad choice, because tup projects lack modular structure.
The only alternative to c and c++ projects is CMake.
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.
Another possible reason for the snark is because specifically Google is well known for:
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.
I don't see how this explains this sort of wording or style of discussion/argumentation. If Bazel is a bad fit, I'm sure this can be phrased in a better way with clearer arguments than "Backed by Google(TM)."
It might be easier if there are clear goals and clear no-gos stated in the RFC (e.g. "bootstrapping
nix
with its build system SHOULD not require significantly more dependencies than bootstrapping all build tools and building thenix
binaries itself" - which would exclude Bazel, since it requires a JVM, or the Python implementation of Meson, since it requires a Python interpreter). Ideally even with performance numbers that show that there is actually an improvement in the stated expected goals (which don't include "keeping the bootstrap dependency graph small" btw. even though a large portion of the text of the RFC and the discussions seem to center around this).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.
You need/want a less sarcastic paragraph? I can possibly reword it.
On the other hand, my intention with this RFC is not to advocate generically for some better build system.
Rather, it is to advocate especifically for Meson.
The clear goal is "Meson builds Nix"; the no-gos are not so clear.
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.
I would also like to point out that glibc depends on python to build itself for a while now. Python on its own is not actually a meaningful additional dependency unless you are committed to equally supporting musl, which my understanding is that NixOS isn't, even if
nix
is.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.
Yet another good reason to push for Muon+Samurai :)