-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rewrite build system in Meson #2503
Comments
Sadly |
@taktoa But meson doesn't use depfile out of an ideological stance against dynamic dependencies / crawling the filesystem. Problem avoided! |
So the only Recursive Nix / IFD would be converting the ninja file. Everything inside should be "static Nix". |
|
Haha yeah. thanks |
I think «Windows support with MinGW» is something Autotools have. Or you could say that one of the goals of MSYS is to support Autotools on Windows with MinGW toolchain (and I would say it generally achieves that). |
Indeed it does. But there's also MSVC and Clang/LLVM. The latter now supports the MSVC++ ABI, after Chrome and Firefox have all pushed hard on it. MinGW has a different C++ ABI (last I checked), and so is only a first class solution for C. |
I am not sure |
The only build system rewrite I'm down with is to a Nix-based build ("nix-make"). Anything else seems pretty much a waste of time to me. |
IMO nix as a build tool to build nix itself should not be a consideration of any work in the near future. At most it should be a happy accidental benefit |
Would Nix-based Nix build process make compiling Nix for the first time on an exotic (Linux-based) platform more annoying? |
Yes, I expect so, unless we set up some kind of automatic bootstrapping (but that probably won't be easy). |
@vcunat: on the other hand, nix has somewhat better reflection capabilities than many alternatives. Therefore, even where cross-compiling is hard, perhaps it would still be feasible to use nix to calculate a build script suitable for the target platform. @edolstra: regarding nix-make: have you done any additional thinking on this topic since a few years ago? (e.g., perhaps in light of https://www.microsoft.com/en-us/research/uploads/prod/2018/03/build-systems-final.pdf being published earlier this year?) |
So in the imagined Meson (or CMake) + Nix setup, there's really quite little overlap. Most of what Meson does is random domain specific logic for building C/C++ apps. Nix is a perfectly normal C++ program; there's no reason to reinvent the wheel just for Nix-based caching. |
@7c6f434c The conventional way to build Windows apps with |
|
But GCC doesn't support MSVC C++ ABIs. Many windows APIs are C++, and so I rather unteather us to having to stick to C ones. Who knows how deep we'd have to dig to find the right primitives for sandboxing, for example. Updated the OP to emphasize this important point.
I'm confused. This common path sounds like stdenv stuff, but Nix already has non-stdenv library dependencies. Python would just be a build-time dependency, as it is for systemd and other core things that use Meson. Furthermore, if one is really in the pickle, they can stub the build platform in Meson to generate the Ninja files on a different platform than the one where it will be run. (TBH not yet implemented but I think I convinced them to let me do it.) |
I can't really think of any reason as to why we would want to support Windows. Windows has a less efficient kernel to do anything interesting on the platform, so it's not fit to do serious computing. So, all you are doing is porting an interesting program (Nix) to a technically inferior platform (HPC community can tell you more), which is going to increase maintenance cost. Open-source economics imply that the owner of the project needs to see and trust that someone is going to compensate that maintenance cost or it should be made in such a way that it is easy to rip it out when you get hit by a bus or something (assuming nobody else cares about the feature). Why did you not just fork Nix and make a Windows port dazzling us with numbers on your build system is faster and more portable, etc.? If the code is that good, I am sure it would get merged in. |
@coretemp good code with nontrivial trade-offs is quite often not merged, so it is indeed a good idea to have a discussion about limits of likely-to-be-acceptable changes. |
@coretemp so no one in this thread loves Autoconf. The consensus opinion out there is that even on Unix alone, CMake or Meson or whatever else is more maintainable (except if you need to support ancient propriety Unix, which we don't.) Now, I wouldn't push for a rewrite for that benefit alone, but certainly it should nullify any argument that a rewrite is going to hurt regular Unix users. |
@7c6f434c The code can be perfect at implementing something people don't even want. I just don't let that fall under "good code". "Good code" solves a problem. Here there is, as you say a trade-off, because it is not going to solve the problem. It trades one set of problems (no Windows support) for less portability. That's the main reason this would be controversial. If it was really " good code", portability, readability, code-size, build-time, would not be impacted along with a whole list of other metrics. I am pretty sure one could build a simple machine learning model that predicts whether a given implementation design of a feature is going to be controversial or not. With the cross-compilation topic there was a use case for it, so it got in. If @Ericson2314 wouldn't have done it, someone else would have, because porting nixpkgs is a simple way to popularize a particular cloud vendor on a particular instruction set. Convincing people that have literally built build-systems to do something controversial is never going to work. That's why my issues come with proper rationalization. It is not necessarily a disadvantage that Windows is not supported, but @Ericson2314 implies that this is the case. Forming a correct argument is key to getting changes you want to see in an open-source project. With the proper motivation, you can even convince others to implement the feature for you, because you have informed them that they can improve their business/life by implementing that feature. @Ericson2314 I like the autotools including autoconf and @matthewbauer seemed to be supportive of autoconf, but I don't particularly care about what other people think when I know better and I consider democratic decisions a failure. You are just alienating the audience by saying things that just aren't true: There is no consensus that CMake is better than autoconf, not in this thread, and certainly not on the Internet. There is zero chance of convincing me, but luckily for you, you don't have to. If this would have been my project, you would have received a lot less words. All you need to do is either convince the owner of the project, or to fork. It seems you are having little success with the former. |
readability, … would not be impacted along with a whole list of other metrics.
You say «not impacted» as if there are no trade-offs inside readability. I think there is no clear consensus whether various pieces of Perl code in Nixpkgs are readble, or whether they are more readable than natural rewrites into Shell or C… Which basically means that there is no non-controversial metric called «readability».
|
Where can't Python run that anyone cares about? The original author may not love Python either, but choose it specifically for build-time portability http://mesonbuild.com/FAQ.html#why-is-meson-implemented-in-python-rather-than-programming-language-x I agree with @7c6f434c. Any opinionated metric will just flood this thread. The facts are:
|
|
I believe you mean Nix itself, haha. But great list! |
Maybe the thing to so is just do the conversion in a PR, and let people try out those sweet fast rebuilds for themselves. |
I would not recommend to do that without any blessing from the Nix core team as empirically this could be wasted effort. |
@7c6f434c Yes, you picked out one metric that has no consensus. The rest of the argument still applies. @Mic92 Creates his own independent argument (with some relevant information, so that's good), but it does not and cannot address the portability side of the equation. @Ericson2314 Just ignores the portability side of the argument, which is generally not a good way to convince people. And then he alludes to the designers of Meson as if they are an authority 🤣. |
Ok, just for completeness. Build time. This is not a single metric but a trade-off, because some ways to get better CPU utilisation for the actual compile can make storage unhappy. Portability. This is a trade-off, because you need to assign weights to Windows support, OpenBSD support and Linux-on-exotic-CPU support. I wonder if «probability of surviving Apple SDK update» is also a possible part of the portabilty trade-off. Code-size — is it token count (depending on the parser some things might count or not, so it is not a single objective metric) that ignores cyclomatic complexity? Also, if there is a feature (or platform support) improvement, you won't get a consensus that code size is not allowed to increase. PS. Speaking of portability — significantly editing GitHub comment after initial creation is not too portable, because it breaks email notifications with high probability. And rendering a GitHub page requires a larger client-side codebase than just handling an email. |
@Mic92 to be clear I was going to make the PR not out of stubbornness, but because I also want to do the windows experiments I deem blocked on this. |
Ah thanks @YorikSar! Would you mind opening a PR for this? |
Workaround at src/libstore/meson.build#L429-L434 by @Ericson2314 from NixOS#11302 erroneously used `macos` instead of `darwin` to distinguish macOS, while meson docs list only `darwin`: https://mesonbuild.com/Reference-tables.html#operating-system-names. Original thread: NixOS#2503 (comment)
@Ericson2314 here it is: #11522 - checked locally (aarch64-darwin), |
Tests now also work with meson on macOS since #11527 |
Everything that is a separate subproject should live in the subprojects directory. Progress on NixOS#2503 This reverts commit 451f8a8.
Everything that is a separate subproject should live in the subprojects directory. Progress on NixOS#2503
Everything that is a separate subproject should live in the subprojects directory. Progress on NixOS#2503 This reverts commit 451f8a8.
Everything that is a separate subproject should live in the subprojects directory. Progress on NixOS#2503 This reverts commit 451f8a8.
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-10-23-nix-team-meeting-minutes-189/54841/1 |
This should make `_NIX_TEST_ACCEPT=1` work again, fixing NixOS#11369. Progress on NixOS#2503
This should make `_NIX_TEST_ACCEPT=1` work again, fixing NixOS#11369. Progress on NixOS#2503
This should make `_NIX_TEST_ACCEPT=1` work again, fixing NixOS#11369. Progress on NixOS#2503
This should make `_NIX_TEST_ACCEPT=1` work again, fixing NixOS#11369. Progress on NixOS#2503
Getting ready for the complete switch-over Progress on NixOS#2503
Getting ready for the complete switch-over Progress on NixOS#2503
This should make `_NIX_TEST_ACCEPT=1` work again, fixing NixOS#11369. Progress on NixOS#2503
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Checklist in this comment: #2503 (comment)
The specific features I am thinking that Autoconf lacks are
Both of these are non essential, but good for various experiments:
This lowers the list down to Meson and CMake, AFIAK. I prefer Meson because:
CC @taktoa
The text was updated successfully, but these errors were encountered: