lib.systems: introduce hasSharedLibraries#240575
Merged
2 commits merged intomasterfrom Jul 12, 2023
unknown repository
Merged
Conversation
19 tasks
Author
|
This PR causes a rebuild of These 48 packages are rebuilt:aarch64-linux ubootPine64LTS aarch64-linux spike x86_64-linux nixos-install-tools aarch64-linux qmk x86_64-linux simavr aarch64-linux armTrustedFirmwareRK3328 aarch64-linux ubootOrangePiZeroPlus2H5 aarch64-linux ubootOdroidC2 aarch64-linux ubootOlimexA64Olinuxino aarch64-darwin qmk aarch64-linux gnuk aarch64-linux ubootNanoPCT4 aarch64-linux armTrustedFirmwareAllwinner x86_64-linux klipper-firmware x86_64-linux armTrustedFirmwareTools aarch64-darwin simavr aarch64-linux ubootRockPro64 x86_64-linux tinygo aarch64-linux ubootROCPCRK3399 aarch64-linux klipper-firmware aarch64-linux armTrustedFirmwareAllwinnerH616 aarch64-linux ubootPinebook x86_64-darwin tinygo x86_64-linux tests.nixos-functions.nixos-test aarch64-linux ubootSopine aarch64-linux ubootOrangePiZero2 aarch64-linux ubootPine64 aarch64-linux armTrustedFirmwareS905 x86_64-linux gnuk x86_64-darwin qmk aarch64-linux ubootOrangePi3 x86_64-linux klipper-genconf aarch64-linux ubootPinebookPro aarch64-linux nixos-install-tools aarch64-linux tinygo aarch64-linux ubootBananaPim64 aarch64-linux armTrustedFirmwareAllwinnerH6 aarch64-linux ubootRock64 x86_64-linux spike aarch64-linux armTrustedFirmwareRK3399 x86_64-darwin simavr aarch64-linux armTrustedFirmwareQemu x86_64-linux fusee-launcher aarch64-linux ubootRockPi4 aarch64-linux simavr x86_64-linux qmk x86_64-linux klipper-flash aarch64-darwin tinygo |
added 2 commits
July 1, 2023 13:12
This commit adds `hasSharedLibraries` to `lib.systems`. We need `plat.hasSharedLibraries` in order to know whether or not to expect `gcc` (and many other tools) to emit shared libraries (like `libgcc_s.so`). Many of the GNU build scripts are smart enough that if you configure them with `--enable-shared` on a platform (such as `arm-none-eabi`) that doesn't support dynamic linking, they will simply skip the shared libraries instead of aborting the `configurePhase`. Unfortunately the missing shared libraries in the final build product cause very hard-to-troubleshoot problems later on. The alternative to introducing `hasSharedLibraries` would be to set `isStatic` in these situations. However doing so causes `make-derivation.nix` to insert `-static` between the `pname` and `hostPlatform` suffix, which is undesirable. If at some point in the future we eliminate the `-static` suffix, then `hasSharedLibraries` can be made equal to `!isStatic`.
12 tasks
This pull request was closed.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of changes
This PR adds
hasSharedLibrariestolib.systems, and causesgccto usehasSharedLibrariesinstead of!isStaticas the default forenableShared.Motivation
See #238154 for a concrete example.
We need
plat.hasSharedLibrariesin order to know whether or not to expectgcc(and many other tools) to emit shared libraries (likelibgcc_s.so). Many of the GNU build scripts are smart enough that if you configure them with--enable-sharedon a platform (such asarm-none-eabi) that doesn't support dynamic linking, they will simply skip the shared libraries instead of aborting theconfigurePhase. Unfortunately the missing shared libraries in the final build product cause very hard-to-troubleshoot problems later on. So we need something inlib.systemsthat knows whether or not to expect these shared libraries to appear (and, if they won't appear, to not get upset about that).The alternative to introducing
hasSharedLibrarieswould be to setisStaticin these situations. However doing so causesmake-derivation.nixto insert-staticbetween thepnameandhostPlatformsuffix, which is undesirable.If at some point in the future we eliminate the
-staticsuffix, thenhasSharedLibrariescan be made equal to!isStatic.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/)