-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Conversation
I would like to shepherd this. I would also recommend @edolstra and @thufschmitt. |
`meson_builds_nix` is a more cool name.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/brainstorming-for-rfc-using-meson-to-build-nix-evaluator/21141/8 |
@AndersonTorres should add that the end goal is to have a nix be capable of building nix too? or is that out of the scope of the RFC |
Self-hosting Nix is something that deserves its own soutenance de thèse. I will not pursue it here. The references on "minimal bloat on the bootstrap route" are enough for now. |
|
||
Over time, this build system has been modified to keep up with the development needs of Nix projec. However, it has reached a state where the build system became clunky and plastered, hard to understand and modify, consequently making improvements to the project as a whole very difficult. | ||
|
||
In particular, many changes have been introduced that impact compatibility outside Linux and NixOS niches. These issues can hinder development on other platforms, including but not limited to Unix-like systems. |
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:
The first commit is just #5145 and again #6015
Previous efforts that actually used a different tactic include:
#5185
#6005Issues include:
#5140
#5184
#5781
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.
rfcs/0132-meson-builds-nix.md
Outdated
- This particular setting brings concerns about complexifying the bootstrap route. | ||
+ Given that Nix is currently written in C++, we can assume a C++ compiler as part of such a bootstrap route. | ||
+ There are full-featured alternative tools that replace Meson and Ninja. | ||
+ Namely, Muon and Samurai are implementations of Meson and Ninja that require only a C compiler and a set of POSIX standard tools. |
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 definitely keep this drawback in mind and explore alternatives that don't expand the bootstrap closure.
Maybe you could also mention what the current bootstrap closure 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.
@asymmetric please read the prior PR to read discussions; meson does not increase bootstrap dependencies, it dramatically decreases them. available tools are provided that only require a working c compiler; c --> muon --> samurai --> nix. the benefit & end goal of this is removing gnu userland tools as a requirement of building, dramatically decreasing the amount of tools needed for bootstrapping.
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.
please read the prior PR to read discussions
You mean NixOS/nix#3160?
meson does not increase bootstrap dependencies
Didn't you say in the RFC that Meson is in Python? What I wanted to say with my comment is to emphasize the idea that we shouldn't increase the bootstrap closure, and so I approve that you mentioned it and provided alternatives that don't increase it.
But AFAIU Python is not part of the current Nix bootstrap closure, so if we use straight Meson, rather than muon and/or Ninja, we would indeed increase it. Is that correct?
If that's the case, why wouldn't we choose muon directly?
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.
Who said that muon isn't "directly" chosen?
Maybe the confusion here is that the RFC is to use "Meson" the buildsystem description DSL, but not specifically to bootstrap Nix with "Meson" the reference implementation of "Meson".
What's the goal of this review comment? To rename this RFC to
[RFC 0132] Muon Builds Nix
???
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 the confusion here is that the RFC is to use "Meson" the buildsystem description DSL, but not specifically to bootstrap Nix with "Meson" the reference implementation of "Meson".
That was indeed the thing that confused me
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 we need a line in the RFC that says "meson the dsl language != meson.py the tool"
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 you could also mention what the current bootstrap closure is?
As far as I know, M4 (the somewhat obscure macro language) and Bash, and whatever autoconf brings.
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.
some required build programs include
- flex
- bison
- sed
- tar
- dot
- jq
- bash
- tar
- patch
- gcc (last time i attempted, clang compilation is very sketch)
- autotools
- m4
It is unneeded to make a distinction between Nix language and its implementation.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfcsc-meeting-2024-03-19/41829/1 |
currently working on adding support to build nix-perl, waiting for assistance from @Ericson2314 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfcsc-meeting-2024-04-02/42643/1 |
NixOS/nix#10378 we should use this small PR to decide what we want to do. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfcsc-meeting-2024-04-16/43512/1 |
We finally have some progress! NixOS/nix#10378 is merged -- Nix's Perl bindings are now built with Meson. This is far from a complete port --- in particular, the most exciting feature Meson provides to me, subprojects, is not yet in use since we have only one single project so far. However, I hope it is sufficient to demonstrate to the Nix team what the overall costs/benefits of Meson are in practice. With that information, I hope we will be able to make a final decision on this RFC. |
Considering that the first step towards this has now been merged, it sounds like this is on a good path. Could the shepherds consider going into FCP? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfcsc-meeting-2024-05-14/45414/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfcsc-meeting-2024-05-28/46113/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfcsc-meeting-2024-06-10/46817/1 |
RFCSC: Since there's no progress, we'll mark this as a draft. Feel free to undraft at any time when you're continuing with it. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfcsc-meeting-2024-06-24/47589/1 |
I thought I'd seen a fair few meson related commits and merges recently - am I misunderstanding something? Or is that work happening separately to this RFC? |
they definitely are related :) im not sure entirely how the RFC process works, im just part of the team. |
Calling the shepherds @Ericson2314 @edolstra @thufschmitt |
We just sort of kept on discussing it in Nix team meetings, which includes all shepherds. It's agreed upon and its happening so I think we can accept this. :) The remaining milestone is finishing the conversion and then removing the old build system, the latter of which signifies we are committed. |
As I have said before, I am merely the public relations guy here, I will not deal with code (at least not now). |
Due to $stuff I will have to recuse myself from shepherding that RFC. Do hope it will get merged though! Good luck to the authors and shepherds |
AFAIU this was implemented in 2.24, so can this PR be closed? |
I don't know why this was neither merged nor closed. |
NixOS/nix#11804 Guess we're done here? :) |
What comes next? |
https://github.com/NixOS/nix/milestone/58 there is milestone for things that should be done before Nix 2.26 ships using Meson, at that point it's really finished. |
This RFC proposes to use Meson description files to deploy Nix.
Rendered!