about summary refs log tree commit diff
path: root/lib/systems
AgeCommit message (Collapse)AuthorFilesLines
2024-06-18Merge pull request #316724 from NickCao/riscv-builtinNick Cao1-3/+1
lib.systems.riscv-multiplatform: linux-kernel config improvements
2024-06-18lib.systems: Default `useLLVM` to true with OpenBSD tooJohn Ericson1-1/+1
Not just FreeBSD.
2024-06-17lib.systems.flakeExposed: exclude systems which are not bootstrappedTristan Ross1-2/+2
2024-06-13config.rust: update references from rustcFlorian Klink1-3/+3
`rustc.config` is called `rust.rustcTarget` now, and `{rustc -> rust}.platform`. This is the new way (tm), and is preferred since https://github.com/NixOS/nixpkgs/pull/271707 - though the documentation still is outdated, and some expressions in nixpkgs were using the old interface. This updates both.
2024-06-02lib.systems.riscv-multiplatform: drop linux-kernel.extraConfigNick Cao1-3/+0
SERIAL_OF_PLATFORM has been y in riscv defconfig since 2018 Reference: https://github.com/torvalds/linux/commit/33c57c0d3c67f51f491a9d27108f7e97adc03d96
2024-06-02lib.systems.riscv-multiplatform: set linux-kernel.preferBuiltinNick Cao1-0/+1
Like aarch64, riscv platforms require many drivers to be builtin to boot.
2024-05-26openbsd: init at 7.5Ali Abrar3-0/+7
2024-05-11freebsd: Cleanup, get ready to support version 14Artemis Tosini1-0/+2
* Extend libc Include non-libc core libraries in the libc package. Many of these mirror libraries present in glibc on linux, such as libgcc, libraries used for iconv, and libraries used for reading kernel info (libkvm, libprocstat, libmemstat). Without this many packages outside the freebsd tree would need to be modified to include standard dependencies which would already be on the system for other packages. * Mark FreeBSD as using LLVM * Update default LLVM version FreeBSD * Use patch monolith The patchesRoot system combined with the fact that each derivation will Request specific names of patches makes it very annoying to use other FreeBSD source trees with nixpkgs. This new system allows providing one Or more entire trees of patches whose contents will be dynamically Parsed and only the relevant patches will be applied for any one Derivation. With this commit, the following knobs are available for specifying the FreeBSD source: - overriding `freebsd.versionInfo`, for picking another official supported FreeBSD release. - overriding `freebsd.source` for specifying a specific unpatched FreeBSD source tree. - overriding `freebsd.patches`, for specifying the patches to apply. Co-Authored-by: Audrey Dutcher <audrey@rhelmot.io> Co-Authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2024-04-30treewide: freebsd13 -> freebsdJohn Ericson3-7/+3
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2024-04-24lib/systems: add microblaze-embeddedJared Baur1-0/+5
Adds a new target for `pkgsCross` that can be used for building freestanding code for microblaze targets (e.g. Xilinx PMU firmware).
2024-04-04doc: migrate trivial files to doc-comment format (#299986)Johannes Kirschbauer1-4/+7
* doc: migrate trivial files to doc-comment format * fix: revert some comments * Apply suggestions from code review Thanks @danielSidhion Co-authored-by: Daniel Sidhion <DanielSidhion@users.noreply.github.com> * Update lib/types.nix --------- Co-authored-by: Daniel Sidhion <DanielSidhion@users.noreply.github.com> Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-03-25Merge pull request #295374 from philiptaron/issue-208242/lib.systemsSilvan Mosberger3-51/+140
lib: use explicit name imports in `lib/systems`
2024-03-19Avoid top-level `with ...;` in lib/systems/parse.nixPhilip Taron1-16/+43
2024-03-19Avoid top-level `with ...;` in lib/systems/inspect.nixPhilip Taron1-13/+25
2024-03-19lib/systems: inherit from lib.systems.inspect.predicates in ↵Philip Taron1-1/+8
lib/systems/parse.nix
2024-03-19lib/systems: inherit from lib.systems.parse in lib/systems/inspect.nixPhilip Taron1-3/+12
2024-03-19lib/systems: use lib.systems.parse and lib.systems.inspect.predicates ↵Philip Taron2-2/+2
instead of re-importing
2024-03-19lib.systems: use explicit attrset instead of `rec`Philip Taron1-20/+54
This allows refactoring in the file without accidentally modifying the public interface of the file. Also, pull in symbols consistently from `lib` instead of `builtins`.
2024-03-11lib/systems: remove more features from qemu-userThomas Watson1-0/+4
alsaSupport/jackSupport: unnecessary multimedia systems tpmSupport/capstoneSupport: unlikely to come up as an exe emulator
2024-02-08lib/systems/inspect: add `isSparc64`Raito Bezarius1-0/+1
This is useful to distinguish between SPARC64 and SPARC whatever, because SPARC64 do support compressed kernels.
2024-01-18lib.system.inspect: add wasm32 to isILP32Adam Joseph1-1/+2
According to the WebAssembly design doc, wasm32 is an ILP32 ABI like x32, mips64n32, and aarch64_ilp32 (Apple Watch). This commits adds it to the predicate. https://github.com/WebAssembly/design/blob/1319968ca53fb5c7e7ea6cc210c7b0ed46566a45/CAndC%2B%2B.md?plain=1#L16
2024-01-02lib/systems: add exec format inspection attrsRyan Burns1-0/+3
Most of the time when we do a patchelf conditional on hostPlatform.isLinux, what we really mean is hostPlatform.isElf. Now that we are starting to support BSDs, this is becoming more important.
2023-12-03lib.systems.elaborate: add libDir attributeJeff Huffman1-0/+7
2023-12-03lib.systems.elaborate: fix passing `rust` (more) (#271707)Alyssa Ross1-1/+2
An important idea around the rust stuff in lib.systems is that it's elaborated — this means that it should idempotently add to the values passed in, if any. But we missed that the names used for the parameter and the elaborated value for "rustcTarget"/"config" didn't line up. The intention was to use "rustcTarget" everywhere in the new interface, as a more descriptive name than "config". This fixes setting the system in NixOS configuration, which results in an already elaborated system being elaborated again. Before, this wouldn't produce the correct result: % nix-instantiate --eval -A stdenv.hostPlatform.rust.rustcTarget --system armv7l-linux "armv7-unknown-linux-gnueabihf" % NIX_PATH= nix-instantiate --eval -E '(import nixos/lib/eval-config.nix { system = "armv7l-linux"; modules = []; }).pkgs.stdenv.hostPlatform.rust.rustcTarget' "arm-unknown-linux-gnueabihf" Fixes: e3e57b8f1885 ("lib.systems: elaborate Rust metadata") Fixes: https://github.com/NixOS/nixpkgs/issues/271000
2023-11-24lib.systems.elaborate: fix passing `rust`Alyssa Ross1-92/+92
Usually, attributes passed explicitly to elaborate take precedence over the elaborated ones, but since we also elaborate the nested "rust" attrset, we need to push that one level down, so the rest of "rust" is still filled in if you just pass { rust = { config = ... } }. I've had to drop the assertion that checked that at most one of "rust" and "rustc" was part of the un-elaborated system, because doing this broke passing an elaborated system in, which should be idempotent. For the same reason, I've also had to make it possible for rust.rustcTargetSpec to be passed in. Otherwise, on the second call, since platform was filled in by the first, the custom target file would be constructed. The only other way to avoid this would be to compare the platform attrs to all built in Rust targets to check it wasn't one of those, and that isn't feasible. Fixes: e3e57b8f1885 ("lib.systems: elaborate Rust metadata")
2023-11-09lib.systems: elaborate Rust metadataAlyssa Ross1-2/+98
We need this stuff to be available in lib so make-derivation.nix can access it to construct the Meson cross file. This has a couple of other advantages: - It makes Rust less special. Now figuring out what Rust calls a platform is the same as figuring out what Linux or QEMU call it. - We can unify the schema used to define Rust targets, and the schema used to access those values later. Just like you can set "config" or "system" in a platform definition, and then access those same keys on the elaborated platform, you can now set "rustcTarget" in your crossSystem, and then access "stdenv.hostPlatform.rustcTarget" in your code. "rustcTarget", "rustcTargetSpec", "cargoShortTarget", and "cargoEnvVarTarget" have the "rustc" and "cargo" prefixes because these are not exposed to code by the compiler, and are not standardized. The arch/os/etc. variables are all named to match the forms in the Rust target spec JSON. The new rust.target-family only takes a list, since we don't need to worry about backwards compatibility when that name is used. The old APIs are all still functional with no warning for now, so that it's possible for external code to use a single API on both 23.05 and 23.11. We can introduce the warnings once 23.05 is EOL, and make them hard errors when 23.11 is EOL.
2023-11-05lib.systems.inspect: add patternLogicalAndAdam Joseph1-0/+26
2023-11-04lib.systems, test.cross.sanity: add test case for #264989Adam Joseph1-0/+1
We have several cross-compilation bugs that show up if hostPlatform!=buildPlatform yet hostPlatform.config==buildPlatform.config. These bugs have appeared and disappeared as we've fiddled with the definition of equality for platform objects. This commit adds a clear-cut case where they are *not* equal and never will be, so we can test it.
2023-10-22lib/systems/parse.nix: add, use removeAbiSuffixAdam Joseph1-1/+10
gnu-config will ignore the portion of a triple matching the regex `e?abi.*$` when determining the validity of a triple. In other words, `i386-linuxabichickenlips` is a valid triple. This commit updates our parsing routines to match gnu-config. I was recently surprised to discover that it is in fact possible to shoehorn ABI flavors into nix doubles in a way which preserves their property of being a (non-canonical) subset of the valid gnu-config triples. This commit is required in order to exploit that discovery to add automatic detection of ILP32 platforms (64-bit void*, 32-bit int, like the Apple Watch and MIPS n32) to Nix.
2023-09-30Merge pull request #249069 from amjoseph-nixpkgs/pr/lib/systems/ubootArchArtturi1-0/+6
lib.systems: add ubootArch
2023-09-23Merge pull request #247077 from jmbaur/aarch64-embedded-rustcArtturi1-0/+1
2023-09-21Merge pull request #247288 from amjoseph-nixpkgs/pr/lib/systems/qemu-mips64n32Artturi1-0/+1
2023-09-08nixpkgs/systems: Add ucrt64 as MinGW libcMoritz Angermann1-0/+5
The Minimalist Gnu for Windows distribution comes with support for the traditional msvcrt libc, as well as ucrt64 libc. The latter being the newer universal compiler runtime. We follow the msys2 environment naming convention[1]: | name | toolchain | arch | libc | libc++ | |------------|-----------|---------|--------|-----------| | mingw32 | gcc | i686 | msvcrt | libstdc++ | | mingw64 | gcc | x86_64 | msvcrt | libstdc++ | | ucrt64 | gcc | x86_64 | ucrt | libstdc++ | | clang32 | llvm | i686 | ucrt | libc++ | | clang64 | llvm | x86_64 | ucrt | libc++ | | clangarm64 | llvm | aarch64 | ucrt | libc++ | For now nixpkgs only supports the first three with this commit. -- [1]: https://www.msys2.org/docs/environments/
2023-09-08lib/systems: disable pipewireSupport in qemu-userArtturin1-0/+1
Option added in 5b0ed68c106c1cbe3b573f3d1ca8c73eb203e346 it causes infinite recursion in cross builds There's a another inf rec that needs 6946977de0de845e69a805f179b96a87d17640fa which is in staging
2023-08-16Merge pull request #238509 from amjoseph-nixpkgs/pr/knuth/respectJohn Ericson1-0/+2
lib/systems/parse.nix: show respect where deserved
2023-08-14lib.systems: add ubootArchAdam Joseph1-0/+6
u-boot has its own rosetta stone, almost but not exactly the same as the Linux kernel's. This commit adds it and the two cases where it diverges.
2023-08-05lib.systems: add qemu's funky custom name for mips n32Adam Joseph1-0/+1
Qemu's name for mips64[el] using the n32 ABI is "mipsn32[el]". That's the first time I've seen that name for it. Oh well.
2023-08-03lib/systems: Add rustc config for aarch64-embeddedJared Baur1-0/+1
The target aarch64-none-elf is not a valid rustc target, use aarch64-unknown-none instead.
2023-07-24Merge pull request #244330 from thillux/bluefield2-remove-cpuAdam Joseph1-1/+0
lib.systems.bluefield2: remove cpu profile
2023-07-19lib.systems.bluefield2: remove cpu profileMarkus Theil1-1/+0
Some software, e.g. systemd, failed to build with set cpu profile. Signed-off-by: Markus Theil <theil.markus@gmail.com>
2023-07-14lib.systems.bluefield2: initMarkus Theil2-0/+12
Add support for Nvidia's Bluefield 2 plattform as a compilation target. There exists a version with and without crypto support, while the crypto supported version is the most common one. Support for the non-crypto version can be easily added in the future, if needed. For a datasheet of the hardware, see: https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/documents/datasheet-nvidia-bluefield-2-dpu.pdf Signed-off-by: Markus Theil <theil.markus@gmail.com>
2023-07-12Merge pull request #238154 from amjoseph-nixpkgs/pr/gcc/crossStageStaticAdam Joseph1-1/+20
gccCrossStageStatic: enable dynamic libraries, rename it
2023-07-05Merge pull request #240825 from r-burns/mips-embeddedRyan Burns2-1/+11
lib.platforms.mips{,64}-embedded: init
2023-07-05Merge pull request #239120 from LibreCybernetics/arch-stuffArtturi1-11/+28
2023-07-04lib.systems.extensions.sharedLibrary: do not `throw`Adam Joseph1-5/+6
Because downstream code expects to use `==` on platform attrsets, we are unfortunately not able to throw a useful error message when the `sharedLibrary` attribute is accessed. When users do a comparison like: stdenv.hostPlatform == pkgsStatic.stdenv.hostPlatform ... in a situation where `stdenv.hostPlatform.hasSharedLibraries`, they expect this to return `false`. Unfortunately Nix does a deep equality comparison here, and ends up forcing the `pkgsStatic.stdenv.hostPlatform.extensions.sharedLibrary` attribute, which throws the error. Rather than returning `null`, this commit instead simply omits the `extensions.sharedLibrary` attribute. This provides the user with a more-useful error message: instead of waiting until the `null` is used (and hoping that produces an error), the user will get an error about the `extensions.sharedLibrary` attribute being missing, at the position where it was referenced. Big thanks to @trofi for his PR to add `NIX_VALIDATE_EVAL_NONDETERMINISM` to Nix, which I am now using. It made tracking this down really easy! Fixes #244045
2023-07-01lib.systems: introduce hasSharedLibrariesAdam Joseph1-1/+20
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`.
2023-06-30lib.platforms.mips{,64}-embedded: initRyan Burns2-1/+11
2023-06-29lib.systems: add gnuabin32 to isGnuAdam Joseph1-1/+1
The `isGnu` predicate was missing `gnuabin32`. This commit corrects that by adding it.
2023-06-24lib.systems.architectures: add microarchitecture levelsFabián Heredia Montiel1-11/+28
Variation on: - https://github.com/NixOS/nixpkgs/pull/208398 - https://github.com/NixOS/nixpkgs/pull/224978 Co-authored-by: Sandro Jäckel <sandro.jaeckel@gmail.com> Co-authored-by: Shawn8901 <shawn8901@googlemail.com> Co-authored-by: AveryanAlex <alex@averyan.ru>
2023-06-22lib/system: move toLosslessStringMaybe into lib/testsAdam Joseph1-15/+0
toLosslessStringMaybe is not used by anything other than lib/tests, so it can be private to that file. I don't think this function was terribly well thought-through. If people start using it, we will become permanently dependent on the ability to test platforms for equality. It also makes the elaboration process more fragile, because it encourages code outside of nixpkgs to become sensitive to the minute details of how elaboration happens.