-
-
Notifications
You must be signed in to change notification settings - Fork 161
[RFC 0132] Meson Builds Nix #132
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
Merged
asymmetric
merged 61 commits into
NixOS:master
from
atorres1985-contrib:meson-builds-nix
Mar 3, 2025
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
9714f41
Use Meson to build Nix
AndersonTorres 85759af
Modify feature attribute
AndersonTorres 003393e
Small clarification
AndersonTorres 3e0be88
Reformulates the alternatives section
AndersonTorres d4497fd
Answer new drawback
AndersonTorres 18c732d
Typo
AndersonTorres a843fb1
Rewording
AndersonTorres 0bf382d
Unfill the paragraphs
AndersonTorres 6c3f5d2
Rename RFC file
AndersonTorres bd4bfe9
Small punctuation fixes
AndersonTorres e1a0620
Rewording
AndersonTorres 0060937
Add usage example
AndersonTorres 265020c
Add references
AndersonTorres b7b859b
Improvements on the wording
AndersonTorres 3eea629
Reword the reference to Nix
AndersonTorres 8650a36
Typo
AndersonTorres ab2dec1
Typo
AndersonTorres 6980048
Reword a paragraph
AndersonTorres b58c8b6
Reword the detailed design
AndersonTorres 17069b6
Reword the examples
AndersonTorres 9821ad2
Add a paragraph about the current (quasi-) autotools
AndersonTorres ab42c2f
Reword commentary about transition
AndersonTorres 3111e49
Reword alternatives
AndersonTorres 9d89692
Reword commentary about Cmake
AndersonTorres dca9276
Remove commentary about backport
AndersonTorres 38f3c44
Bring more items to future work
AndersonTorres 714457b
Add references
AndersonTorres 894946b
Reorder references
AndersonTorres 72dec20
Reword motivation section
AndersonTorres 6d8f6bd
Reword paragraph
AndersonTorres 94eb5c7
Rework examples and interactions
AndersonTorres 934555d
Rework drawbacks
AndersonTorres 16e2033
Rework alternatives
AndersonTorres 8dadf6a
Some fixups
AndersonTorres 587d349
Include some more examples of build systems
AndersonTorres 86bc4bc
Reorder references
AndersonTorres 9ad0874
Reword cmake subsection
AndersonTorres 5e621af
Move paragraphs about Meson and Ninja to detailed design section
AndersonTorres 3de1372
Remove unneeded paragraph
AndersonTorres c5a9e48
Include Bazel as alternative
AndersonTorres 3f1182c
Reword paragraph
AndersonTorres e361407
Punctuation
AndersonTorres a228c6f
More references
AndersonTorres aef0827
Reword
AndersonTorres 212bf63
Typo
AndersonTorres 4df4944
Reword
AndersonTorres 0a41323
A bit more about Bazel
AndersonTorres e071944
add feature: out-of-source build
AndersonTorres d8904e9
Typos, typos and more typos
AndersonTorres 680e6b8
Link to the now free-as-in-beer book from the creator of Meson
AndersonTorres 0430b71
Another typo
AndersonTorres 61ad7c4
Add shepherds
edolstra afca581
add cross-compilation support to the criteria of evaluation of altern…
AndersonTorres 9bb63e0
Typo
AndersonTorres e6b4e05
Reword examples
AndersonTorres 719562c
Add some more advantages for Bazel
AndersonTorres e4715c4
Reword and add more disadvantages for Bazel
AndersonTorres f37cedd
More references
AndersonTorres 5b0a734
Reword Google company name
AndersonTorres 56c86fa
Add Prior Art section
AndersonTorres b03e5b6
Rewords and comparisons
AndersonTorres File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| --- | ||
| feature: use_meson_to_build_nix | ||
| start-date: 2022-08-25 | ||
| author: Anderson Torres | ||
| co-authors: @p01arst0rm | ||
| shepherd-team: | ||
| shepherd-leader: | ||
| related-issues: | ||
| --- | ||
|
|
||
| # Summary | ||
| [summary]: #summary | ||
|
|
||
| Use meson as an alternative build system for the reference implementation of | ||
| Nix. | ||
|
|
||
| # Motivation | ||
| [motivation]: #motivation | ||
|
|
||
| Currently, the reference implementation of Nix evaluator and its companion | ||
| toolset generated from the Nix source tree are built using an autotools-like | ||
| script. | ||
|
|
||
| This quasi-autotools script became clunky and plastered, and consequently hard | ||
| to understand, modify, improve and port to other systems besides Linux. | ||
AndersonTorres marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Such state of things hinders development, specially outside the Linux and NixOS | ||
| niches. | ||
|
|
||
| In light of this, we propose a novel, from-scratch alternative build | ||
| infrastructure. | ||
|
|
||
| We expect to accomplish, among other goals, | ||
|
|
||
| - better code structuring | ||
| - improved cross-platform support, especially in other programming environments, | ||
| including but not limited to Unix-like operating systems; | ||
| - shorter build times; | ||
| - an overall improved user experience. | ||
|
|
||
| # Detailed design | ||
| [design]: #detailed-design | ||
|
|
||
| A carefully crafted set of files written in Meson should be included in the Nix | ||
| repository, in order to describe how to deploy the Nix repository, generating | ||
| all the expected artifacts (command line tools, libraries, configuration files | ||
| etc.) | ||
|
|
||
| This novel build infrastructure should be able to provide at least all the | ||
| features already present on the current quasi-autotools implementation, possibly | ||
| with a different user interface. | ||
|
|
||
| # Examples and Interactions | ||
| [examples-and-interactions]: #examples-and-interactions | ||
|
|
||
| Currently @p01arst0rm is writing an implementation from scratch. | ||
|
|
||
| # Drawbacks | ||
| [drawbacks]: #drawbacks | ||
|
|
||
| Some possible drawbacks: | ||
|
|
||
| - A new build system would require changes on the code | ||
| + On the other hand, such changes are likely to improve the code base. | ||
|
|
||
| - A new build system requires the developers become familiarized with it | ||
| - Specially when this build system uses its own description language | ||
| + However, the Meson language is easy to grasp, specially for those | ||
| familiarized with Python, besides being well documented. | ||
|
|
||
| - A new build system indirectly brings its own dependencies to the Nix project | ||
| - In particular, the reference implementation of Meson is written in Python. | ||
| - Further, this reference implementation generates script files meant to be | ||
| consumed by Ninja, a tool written in C++ that acts like a Make replacement. | ||
| - 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. | ||
|
|
||
| - A new build system would require new strategies from the end users | ||
| - In particular, package managers that deploy Nix for their respective | ||
| platforms | ||
| + However, Meson is nowadays a widespread tool, used in many open source | ||
| projects ranging from DOSBox Staging and mpv to GNOME and Xorg; therefore it | ||
| is already included in many package managers' databases | ||
|
|
||
| # Alternatives | ||
| [alternatives]: #alternatives | ||
|
|
||
| The alternatives are | ||
|
|
||
| - Doing nothing | ||
|
|
||
| It would keep the current code confusing and harder to work with. | ||
|
|
||
| - Other building systems (cmake, waf, scons etc.) | ||
| - Their strenghts and weaknesses should be evaluated. | ||
| - Tools like waf and scons are strongly discouraged, because they are tied | ||
| to other programming languages, bringing the bootstrap concerns already | ||
| discussed above. | ||
|
|
||
AndersonTorres marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # Unresolved questions | ||
| [unresolved]: #unresolved-questions | ||
|
|
||
| Questions that deserve furtehr inquiry: | ||
AndersonTorres marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - Unexpected interactions with Meson and Ninja | ||
| - Specially, vendoring and reproducibility. | ||
AndersonTorres marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Smooth the transition between the old and new build systems | ||
| - A wrapper script, maybe? | ||
AndersonTorres marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Future work | ||
| [future]: #future-work | ||
|
|
||
| - Deprecate the quasi-autotools script set | ||
| - Backport the new build system to Nix 2.3 | ||
| - It was the latest release without Flakes support; it is important to | ||
| bring such a deep modification to it. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.