Commit Graph

496 Commits

Author SHA1 Message Date
Philip Taron
9396352fba
lib/systems: elaborate properly with non-matching system / config / parsed args (#351608) 2024-11-29 15:48:15 -08:00
John Ericson
07f8638828
freebsd: Add support for aarch64 (#358053) 2024-11-26 20:39:38 -05:00
Philip Taron
01fdad87c4
stdenv: add Silvermont support, remove incorrect AES support (#355127) 2024-11-25 10:50:35 -08:00
Artemis Tosini
2b02a18ef7
freebsd: Add support for aarch64
Add a new `aarch64-freebsd` double and example system,
then fix include and libc to work.
This is enough to build packages like `hello`,
either static or dynamic.

This is useful for testing nix FreeBSD on a Raspberry Pi.
2024-11-24 03:03:28 +00:00
seth
4d874d59e2
lib.systems.examples: set rust.rustcTarget for ucrtAarch64
Closes https://github.com/NixOS/nixpkgs/issues/357751
2024-11-21 04:56:45 -05:00
chn
d954930a4f stdenv: add Silvermont support, remove incorrect AES support 2024-11-11 12:29:55 +08:00
seth
b5bf8e3fc7
lib.systems.examples: add aarch64-w64-mingw32 2024-11-06 17:22:52 -05:00
seth
205faabfeb
lib.systems.doubles: add aarch64-windows double 2024-11-06 17:22:52 -05:00
Wolfgang Walther
3c21a5c9d6
lib/systems: elaborate properly with non-matching system / config / parsed args
When elaborating a system with both "config" and "system" arguments
given, they might not match the parsed results.  Example:

elaborate {
  config = "i686-unknown-linux-gnu";
  system = "x86_64-linux";
}

This would result in a parsed system for i686, because the config
argument is preferred.  But since "// args //" comes after system has
been inferred from parsed, it is overwritten again.  This results in
config and parsed all pointing to i686, while system still tells the
story of x86_64.

Inconsistent arguments can also be given when passing "parsed" directly.
This happened in stage.nix for the various package sets.

The solution is simple: One of the three arguments needs to be treated
as the ultimate source of truth.  "system" can already be losslessly
extracted from "parsed".  However, "config" currently can not, for
example for various -mingw32 cases.  Thus everything must be derived
from "config".

To do so, "system" and "parsed" arguments are made non-overrideable for
systems.elaborate.  This means, that "system" will be used to parse when
"config" is not given - and "parsed" will be ignored entirely.

The systemToAttrs helper is exposed on lib.systems, because it's useful
to deal with top-level localSystem / crossSystem arguments elsewhere.
2024-11-03 17:38:19 +01:00
Jörg Thalheim
8885a1e21a lib/systems/architectures: add sapphirerapids/emeraldrapids
For reference: https://en.wikichip.org/wiki/intel/microarchitectures/sapphire_rapids

https://www.phoronix.com/news/GCC-13-Initial-Emerald-Rapids
https://www.phoronix.com/news/LLVM-Adds-Intel-Emerald-Rapids
2024-10-08 14:19:23 +02:00
Zhaofeng Li
b8c1ef98e4 nixos/binfmt: Add option to use static emulators when available
The fixBinary flag will be enabled if a static emulator is in use.
2024-10-01 15:05:32 +09:00
Julius Michaelis
4658a06076 lib/systems: use qemu-user package instead of custom definition 2024-10-01 15:05:32 +09:00
oxalica
a9fe4d6d8c lib.systems: fix rustTarget for WASI
The corresponding Rust target name is "wasm32-wasip?", not
"wasm32-unknown-wasi".
2024-09-30 23:34:40 +02:00
Artturin
aed1142d79 lib.systems.examples: Fix deprecated attr
`For android 'sdkVer' has been renamed to 'androidSdkVersion'`

While doing the above rename I forgot to consider if there were still
darwin platforms in `lib.systems.examples` using `sdkVer`

These still fail eval, but that happened before the renaming too.

`error: Unsupported sdk: 14.3`
2024-09-30 18:14:21 +03:00
github-actions[bot]
ce19166255
Merge master into staging-next 2024-09-02 18:04:19 +00:00
Alyssa Ross
4b6c89a670 lib.systems: add rustTarget for riscv32
Fixes buildPackages.rustc when cross compiling to riscv32.
2024-09-02 15:15:37 +02:00
github-actions[bot]
f20de6f5f1
Merge staging-next into staging 2024-08-31 18:04:19 +00:00
Alyssa Ross
ccf84022b6 lib.platforms.aarch: init 2024-08-31 14:41:25 +02:00
github-actions[bot]
c33b70bb75
Merge staging-next into staging 2024-08-31 12:05:08 +00:00
Alyssa Ross
d4a72a3935 lib.platforms.mesaPlatforms: remove
Mesa is a package like any other.  There's no reason for it to be a
special case with its platforms listed in lib, because if other
packages want to refer to mesa's platforms, they can access the
platforms from the package meta like they would for any other package.
2024-08-31 10:28:31 +02:00
github-actions[bot]
3b85a864c3
Merge staging-next into staging 2024-08-26 18:04:37 +00:00
Ivan Trubach
9ae6726db9 lib/systems: set gcc.arch = "armv6kz", gcc.fpu = "vfpv2" for raspberryPi
>The CPU in the Raspberry Pi 1 and Zero implements the ARMv6 ISA (with VFP2)
https://wiki.debian.org/RaspberryPi#:~:text=The%20CPU%20in%20the%20Raspberry%20Pi,VFP2%29

See also
- https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications
- https://github.com/NixOS/nixpkgs/issues/319036#issuecomment-2232108373
2024-08-26 18:41:06 +02:00
Robert Hensing
b2d208b70d
Merge pull request #324071 from tie/emulator-exec
lib/systems: use execline’s exec instead of runtimeShell
2024-08-25 19:06:15 +02:00
Artturin
c9270f6274
Merge pull request #329964 from Artturin/androidrenamesdk
treewide: Rename android `sdkVer` and `ndkVer`
2024-08-17 19:22:42 +03:00
Tristan Ross
527de075a3 lib.systems: mark windows as having shared libs 2024-08-10 08:34:57 +02:00
Ivan Trubach
4c6e132c7e lib/systems: use execline’s exec instead of runtimeShell 2024-07-30 12:23:31 +03:00
Artturin
35e5943d69 lib.systems: throw if sdkVer or ndkVer are used for android.
Those attrs have been renamed and throwing is the best way to show it,
if we only warned then the user would only get an error like this `error: Unsupported sdk: 33`
from `pkgs/top-level/darwin-packages.nix`.

If someone wants to support multiple NixOS versions then they can simply
set both attrs. (`!args ? androidSdkVersion` is for that)
2024-07-25 23:49:18 +03:00
Artturin
1144d46f95 treewide: Rename android sdkVer and ndkVer
`sdkVer` conflicts with the old `sdkVer`(now `darwinSdkVersion` but that still uses `sdkVer` if set) used by darwin

This shouldn't be an issue but due to `pkgs/development/interpreters/python/cpython/default.nix`
running `lib.filterAttrs (n: v: ! lib.isDerivation v && n != "passthruFun")` on it's inputs (2 of them are darwin only)
the `throw "Unsupported sdk...` in `pkgs/top-level/darwin-packages.nix` will be triggered.

After this change `pkgsCross.armv7a-android-prebuilt.python3.pythonOnBuildForHost` won't fail with
`error: Unsupported sdk: 33`

Issue was bisected to 3cb23cec23
2024-07-25 22:08:49 +03:00
Audrey Dutcher
1e2071847d stdenv/freebsd: reinit
The old stdenv didn't work, and was also impure. The new one works, and
is pure. Presently, the bootstrap tools are cross compiled into one small
nar and one large tar, which is then unpacked, patched, and split into
smaller derivations. Efforts were made to make the boot process as short
as possible - there are only two clangs built, and as many packages are
propagated between stages as possible while leaving the bootstrap tools
out of the final stdenv's closure.
2024-07-19 21:32:05 -07:00
Ilan Joselevich
bf61b8c8fb
lib.systems: Fix setting rust.platform.os for wasm32-unknown-unknown
Previously we would fallback to using `kernel` as the `os` which would
result in using the wrong `os` value (`none`) when actually we want
`unknown`. This seems to be a special case for wasm32-unknown-unknown
and wasm64-unknown-unknown so I extended the if statement to support it.
2024-07-05 19:43:10 +03:00
Florian Klink
641b2f29b6
Merge pull request #319153 from Kranzes/buildRustCrate-wasm
buildRustCrate: add support for compiling to wasm32-unknown-unknown
2024-06-30 14:05:33 +03:00
Ilan Joselevich
957116419d
lib.systems.examples: add wasm32-unknown-none
This system was added to use the nixpkgs cross compilation logic when
compiling to wasm32-unknown-unknown in rust.
2024-06-24 19:27:13 +03:00
Artturin
2cfac74be5
Merge pull request #319139 from NyCodeGHG/android-ndks
android-ndks: add 25, 26 ndks, update default ndk and sdk
2024-06-23 20:39:28 +03:00
Nick Cao
febff2fc72
Merge pull request #316724 from NickCao/riscv-builtin
lib.systems.riscv-multiplatform: linux-kernel config improvements
2024-06-18 17:05:13 -04:00
John Ericson
bab20def47 lib.systems: Default useLLVM to true with OpenBSD too
Not just FreeBSD.
2024-06-18 13:23:58 -04:00
Tristan Ross
ecf6827049
lib.systems.flakeExposed: exclude systems which are not bootstrapped 2024-06-17 16:34:55 -07:00
Marie Ramlow
56d1e7a41b lib.systems.examples: update default android sdk to 33, ndk to 26 2024-06-17 09:53:31 +02:00
Florian Klink
50261c0602 config.rust: update references from rustc
`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-13 21:08:48 +03:00
Nick Cao
50a6be5f8b
lib.systems.riscv-multiplatform: drop linux-kernel.extraConfig
SERIAL_OF_PLATFORM has been y in riscv defconfig since 2018

Reference: 33c57c0d3c
2024-06-02 15:33:13 -04:00
Nick Cao
a9116cef2b
lib.systems.riscv-multiplatform: set linux-kernel.preferBuiltin
Like aarch64, riscv platforms require many drivers to be builtin to boot.
2024-06-02 15:31:18 -04:00
Ali Abrar
888dee445d openbsd: init at 7.5 2024-05-26 10:55:56 -04:00
Artemis Tosini
06b05d2289 freebsd: Cleanup, get ready to support version 14
* 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-05-11 21:52:07 -04:00
John Ericson
266cdd7d37 treewide: freebsd13 -> freebsd
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2024-04-30 18:20:23 -04:00
Jared Baur
6421226aa5 lib/systems: add microblaze-embedded
Adds a new target for `pkgsCross` that can be used for building
freestanding code for microblaze targets (e.g. Xilinx PMU firmware).
2024-04-24 19:45:58 -07:00
Johannes Kirschbauer
c0f5f271d1
doc: migrate trivial files to doc-comment format (#299986)
* 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-04-04 16:36:07 +02:00
Silvan Mosberger
b803ba5a48
Merge pull request #295374 from philiptaron/issue-208242/lib.systems
lib: use explicit name imports in `lib/systems`
2024-03-25 18:41:46 +01:00
Philip Taron
79ce46fe49
Avoid top-level with ...; in lib/systems/parse.nix 2024-03-19 16:16:44 -07:00
Philip Taron
c02fcc946a
Avoid top-level with ...; in lib/systems/inspect.nix 2024-03-19 16:16:44 -07:00
Philip Taron
07d3270dbc
lib/systems: inherit from lib.systems.inspect.predicates in lib/systems/parse.nix 2024-03-19 16:09:37 -07:00
Philip Taron
af634f14ba
lib/systems: inherit from lib.systems.parse in lib/systems/inspect.nix 2024-03-19 16:09:37 -07:00