-
-
Notifications
You must be signed in to change notification settings - Fork 18k
libtool: drop unused auto* dependencies #210118
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
Conversation
Autoreconf was initially added in e44dd84 ("libtool2: macOS 11 support") for configure patches. The patches were removed since 2.4.7 release. Let's drop these dependencies to make boostrap tree leaner. The diff of bootstrap tree before and after the change: $ nix-store --query --graph $(nix-instantiate -A stdenv) | fgrep ' -> ' | awk '{print $3}' | sort -u | sed 's/"[0-9a-z]\{32\}-/"/g' | sort > before $ nix-store --query --graph $(nix-instantiate -A stdenv) | fgrep ' -> ' | awk '{print $3}' | sort -u | sed 's/"[0-9a-z]\{32\}-/"/g' | sort > after $ diff -U0 before after --- before +++ after @@ -64,2 +63,0 @@ -"help2man-1.49.2.drv" -"help2man-1.49.2.drv" @@ -77 +74,0 @@ -"libxcrypt-4.4.33.drv" @@ -88,4 +84,0 @@ -"perl-5.36.0.drv" -"perl-5.36.0.drv" -"perl5.36.0-gettext-1.07.drv" -"perl5.36.0-gettext-1.07.drv" This removes 2 of 3 builds of `perl` and `help2man` dependencies. Co-authored-by: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>
596f56b to
6becbd3
Compare
|
This seem to break build on aarch64 for me. @amjoseph-nixpkgs is that something you are tackling as part of gcc11 for aarch64? |
which build is that from? libtool builds for me on e09153d on aarch64-linux |
|
The latest nixos-unstable-small (c85d086). I should add that it is not a native build but cross build. |
|
this PR isn't even in master yet https://nixpk.gs/pr-tracker.html?pr=210118 so your issue is from some other commit |
|
Oh.. sorry. You are right. The build process still includes help2man in my version. I jumped at this because I saw it being removed here. I have to investigate more than to know why it reports that it is not available in my case. |
|
Do you apply local patches to |
That would be my idea as well, but no. I am not applying any patches. I tried to bisect the commit that might have broke it, but I ended up with a working build after bisect even on nixos-unstable-small. There is something smelly in libtool build. |
#### Summary
By default, when you type `make`, GCC will compile itself three
times. This PR inhibits that behavior by configuring GCC with
`--disable-bootstrap`, and reimplements the triple-rebuild using
Nix rather than `make`/`sh`.
#### Immediate Benefits
- Allow `gcc11` and `gcc12` on `aarch64` (without needing new
`bootstrapFiles`)
- Faster stdenv rebuilds: the third compilation of gcc
(i.e. stageCompare) is no longer a `drvInput` of the final stdenv.
This allows Nix to build stageCompare in parallel with the rest of
nixpkgs instead of in series.
- No more copying `libgcc_s` out of the bootstrap-files or other
derivations
- No more Frankenstein compiler: the final gcc and the libraries it
links against (mpfr, mpc, isl, glibc) are all built by the same
compiler (xgcc) instead of a mixture of the bootstrapFiles'
compiler and xgcc.
- No more [static lib{mpfr,mpc,gmp,isl}.a hack]
- Many other small `stdenv` hacks eliminated
- `gcc` and `clang` share the same codepath for more of `cc-wrapper`.
#### Future Benefits
- This should allow using a [foreign] `bootstrap-files` so long as
`hostPlatform.canExecute bootstrapFiles`.
- This should allow each of the libraries that ship with `gcc`
(lib{backtrace, atomic, cc1, decnumber, ffi, gomp, iberty,
offloadatomic, quadmath, sanitizer, ssp, stdc++-v3, vtv}) to be
built in separate (one-liner) derivations which `inherit src;`
from `gcc`, much like NixOS/nixpkgs#132343
#### Incorporates
- NixOS/nixpkgs#210004
- NixOS/nixpkgs#36948 (unreverted)
- NixOS/nixpkgs#210325
- NixOS/nixpkgs#210118
- NixOS/nixpkgs#210132
- NixOS/nixpkgs#210109
- NixOS/nixpkgs#213909
- NixOS/nixpkgs#216136
- NixOS/nixpkgs#216237
- NixOS/nixpkgs#210019
- NixOS/nixpkgs#216232
- NixOS/nixpkgs#216016
- NixOS/nixpkgs#217977
- NixOS/nixpkgs#217995
#### Closes
- Closes #108305
- Closes #108111
- Closes #201254
- Closes #208412
#### Credits
This project was made possible by three important insights, none of
which were mine:
1. @Ericson2314 was the first to advocate for this change, and
probably the first to appreciate its advantages. Nix-driven
(external) bootstrap is "cross by default".
2. @trofi has figured out a lot about how to get gcc to not mix up
the copy of `libstdc++` that it depends on with the copy that it
builds, by moving the `bootstrapFiles`' `libstdc++` into a
[versioned directory]. This allows a Nix-driven bootstrap of gcc
without the final gcc would still having references to the
`bootstrapFiles`.
3. Using the undocumented variable [`user-defined-trusted-dirs`]
when building glibc. When glibc `dlopen()`s `libgcc_s.so`, it
uses a completely different and totally special set of rules for
finding `libgcc_s.so`. This trick is the only way we can put
`libgcc_s.so` in its own separate outpath without creating
circular dependencies or dependencies on the bootstrapFiles. I
would never have guessed to use this (or that it existed!) if it
were not for a [comment in guix] which @Mic92 [mentioned].
My own role in this PR was basically: being available to go on a
coding binge at an opportune moment, so we wouldn't waste a
[crisis].
[aarch64-compare-ofborg]: https://github.com/NixOS/nixpkgs/pull/209870/checks?check_run_id=10662822938
[amd64-compare-ofborg]: https://github.com/NixOS/nixpkgs/pull/209870/checks?check_run_id=10662825857
[nonexistent sysroot]: NixOS/nixpkgs#210004
[versioned directory]: NixOS/nixpkgs#209054
[`user-defined-trusted-dirs`]: https://sourceware.org/legacy-ml/libc-help/2013-11/msg00026.html
[comment in guix]: https://github.com/guix-mirror/guix/blob/5e4ec8218142eee8e6e148e787381a5ef891c5b1/gnu/packages/gcc.scm#L253
[mentioned]: NixOS/nixpkgs#210112 (comment)
[crisis]: NixOS/nixpkgs#108305
[foreign]: NixOS/nixpkgs#170857 (comment)
[static lib{mpfr,mpc,gmp,isl}.a hack]: https://github.com/NixOS/nixpkgs/blob/2f1948af9c984ebb82dfd618e67dc949755823e2/pkgs/stdenv/linux/default.nix#L380
Autoreconf was initially added in e44dd84 ("libtool2: macOS 11 support") for configure patches. The patches were removed since 2.4.7 release. Let's drop these dependencies to make boostrap tree leaner.
The diff of bootstrap tree before and after the change:
This removes 2 of 3 builds of
perlandhelp2mandependencies.Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes