Commit Graph

83 Commits

Author SHA1 Message Date
Aleksana
af50c28579
splice.nix: remove toplevel {build,host,target}Platform in __splicedPackages (#350299) 2024-10-24 15:19:21 +08:00
Artturin
95c1043ff5 treewide: remove usages of aliases {build,host,target}Platform 2024-10-23 22:40:32 +03:00
Motiejus Jakštys
5cdff541c3 zig: fix cache folder handling
- `env.ZIG_GLOBAL_CACHE_DIR` does not resolve variables, so
all actions had their cache dir in the current directory, named
'$TMPDIR/zig-cache'.
- zig cache does not conflict, so it's totally fine to reuse it in both
  build and tests (thus removing `--cache-dir`).

While we're at this, fix a `substituteInPlace` deprecation warning.
2024-10-20 20:14:19 +03:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Wolfgang Walther
e3191276d9
zig: improve shellcheck disable comments 2024-08-24 12:23:36 +02:00
Wolfgang Walther
5564042031
zig: support structuredAttrs in setup hook
Tested waylock with and without __structuredAttrs.
2024-08-24 12:23:36 +02:00
Tristan Ross
945426bccc
zig: add stdenv 2024-07-27 19:43:40 -07:00
Tristan Ross
65c81d4eae
zig: add cc wrapper 2024-07-27 19:43:36 -07:00
Sigmanificient
6dd44107ac treewide: remove unused lib (and other) arguments 2024-07-26 11:18:09 +02:00
Jared Baur
d118df3f8d
zig_0_13.hook: disable progress output
The progress output is not printed in a readable manner in a nix build.
Passing `--color off` disables it during builds.
2024-07-23 20:07:40 -07:00
Alex James
cae03b78b4
zig: fix build on Darwin with sandbox enabled
During stage 3 of compilation, Zig calls `std.zig.system.darwin.macos.detect`,
which parses /System/Library/CoreServices/.SystemVersionPlatform.plist and
/System/Library/CoreServices/SystemVersion.plist[^1] to determine the OS
version. These paths are inaccessible when the sandbox is enabled, which causes
the build to fail with `OSVersionDetectionFail`[^2]. Fix the build with the
relaxed sandbox option by adding these paths to `__impureHostDeps`.

[^1]: cd62005f19/lib/std/zig/system/darwin/macos.zig
[^2]: https://github.com/NixOS/nixpkgs/issues/287861#issuecomment-2148703491
2024-06-16 17:51:10 -05:00
Jared Baur
623e23e25f
zig_0_12: unbreak clang builds 2024-06-14 23:13:57 -07:00
Jared Baur
d203c3f1e2
zig: 0.12.0 -> 0.12.1 2024-06-14 23:12:41 -07:00
tomberek
933ae429e0
Merge pull request #317861 from ExpidusOS/feat/zig-0.13
zig_0_13: init
2024-06-14 22:13:51 -04:00
Alexis Hildebrandt
755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00
Tristan Ross
55fcb63b2c
zig_0_13: init 2024-06-07 23:44:16 -07:00
Anderson Torres
0b575c9759 zig_0_12: huge refactor
- migrate it to a dedicated directory, zig/0.12
  - can't migrate to by-name
    - because of undecipherable darwin.apple_sdk_11_0.callPackage
- nixfmt
- add a simple version test
2024-05-27 20:35:27 -03:00
Anderson Torres
e1f9afc289 zig_0_11: huge refactor
- migrate it to a dedicated directory, zig/0.11
  - can't migrate to by-name
    - because of undecipherable darwin.apple_sdk_11_0.callPackage
- nixfmt
- add a simple version test
2024-05-27 20:35:27 -03:00
Anderson Torres
5427d85cc7 zig_0_10: huge refactor
- migrate it to a dedicated directory, zig/0.10
  - can't migrate to by-name
    - because of undecipherable darwin.apple_sdk_11_0.callPackage
- nixfmt
- add a simple version test
2024-05-27 20:35:27 -03:00
Anderson Torres
cad194ac57 zig_0_9: huge refactor
- migrate it to a dedicated directory, zig/0.9
  - can't migrate to by-name
    - because of undecipherable darwin.apple_sdk_11_0.callPackage
- nixfmt
- add a simple version test
2024-05-27 20:35:27 -03:00
Anderson Torres
048a15057a zig-shell-completions: migrate to by-name 2024-05-27 20:35:27 -03:00
OPNA2608
0122b82531 zig-shell-completions: unstable-2023-11-18 -> 0-unstable-2023-11-18 2024-05-05 16:22:58 +02:00
Zhong Jianxin
e1b03a0e51 zig.hook: support zig 0.12 2024-04-25 19:41:15 +08:00
Tristan Ross
3b5257d01b
zig_0_12: init 2024-04-19 14:24:09 -07:00
zimbatm
2a751800fd zig: add meta.mainProgram 2024-01-02 22:20:30 +01:00
R. Ryantm
7073d808dd zig-shell-completions: unstable-2023-08-17 -> unstable-2023-11-18 2023-12-10 13:13:32 +00:00
Anderson Torres
a49eb940a2 zig: reword setup hook
- Move the huge comment from setup-hook.sh to hook.nix
- Prefix zig in the echoCmd calls
2023-09-09 15:27:11 +00:00
figsoda
3b6bef448e zig.hook: clean up
- remove noop `lib.concatStringsSep`
- reformat `releaseType`
- inline `cpu`
2023-08-22 10:09:56 +00:00
figsoda
fcdf10cd12 zig: restore with lib.maintainers;
This reverts 8315e00d46
2023-08-22 10:09:56 +00:00
Anderson Torres
ebb4d8a13f zig-shell-completions: refactor
- Use rec-less, overlay-style overridable recursive attributes (in effect since
https://github.com/NixOS/nixpkgs/pull/119942);
- Remove nested with (according to
https://nix.dev/anti-patterns/language#with-attrset-expression);
- Add updateScript.
2023-08-22 02:08:01 +00:00
Anderson Torres
fd774bd82b zig.hook: reword 2023-08-22 02:08:01 +00:00
Anderson Torres
b058a2fc29 zig: remove with lib 2023-08-22 02:08:01 +00:00
Aaron Jheng
9182fed84c zig-shell-completions: init at unstable-2023-08-17 2023-08-21 11:36:49 +00:00
figsoda
81b970640e
Merge pull request #248252 from figsoda/zig-team 2023-08-13 21:28:26 -04:00
figsoda
d488487336 zig: remove aiotter from maintainers
https://github.com/NixOS/nixpkgs/pull/248252#issuecomment-1674462834
2023-08-11 09:31:40 -04:00
Anderson Torres
643635b58c zig_0_10: rename patches 2023-08-10 10:49:35 +00:00
Anderson Torres
2cb6b63c31 zig_0_9: rename patches 2023-08-10 10:49:35 +00:00
Anderson Torres
dd4925487b zig_0_9: rename file
Because it will not be updated after all.
2023-08-10 10:49:35 +00:00
figsoda
17d404ee80 zig.hook: rename from zigHook
This makes using specific versions of zig easier (without overrides)
2023-08-10 02:37:53 +00:00
figsoda
55a8deab40 zig: maintained by the zig team 2023-08-09 22:22:42 -04:00
figsoda
6acf0bf645 zigHook: support zig 0.11 2023-08-07 10:25:02 +00:00
figsoda
3b74f1205c zig_0_11: init
https://ziglang.org/download/0.11.0/release-notes.html
2023-08-06 02:14:04 +00:00
figsoda
36ca4639d7 zig: introduce generic.nix to remove duplicate code
- zig_0_9: move tests to installCheck
- zig_0_9: set ZIG_GLOBAL_CACHE_DIR instead of HOME
2023-08-06 02:14:04 +00:00
Anderson Torres
9d9af3d49f zigHook: remove badPlatforms
Because zig itself doesn't set it by default.
2023-08-01 10:08:55 +00:00
Anderson Torres
a85a699e40 zigHook: init
A setup hook for using the Zig compiler in Nixpkgs.

*Warning*: the setup-hook shell script was linted with shellcheck!
2023-08-01 10:08:55 +00:00
Anderson Torres
d485da9d00 zig_0_10: refactor
- Use rec-less, overlay-style overridable recursive attributes (in effect since
NixOS#119942);
- Add decoration hooks over installCheckPhase
- Use doInstallCheck instead of doCheck.
- Directly sets env.ZIG_GLOBAL_CACHE_DIR instead of using preBuild
- Add meta.changelog
2023-07-08 20:40:38 -03:00
Anderson Torres
cc08d73612 zig_0_9: refactor
- Move zig_0_10_0 to prePatch
- Use rec-less, overlay-style overridable recursive attributes (in effect since
NixOS#119942);
- Add meta.changelog
2023-07-08 20:40:38 -03:00
Jakub Konka
18c80c166f zig: 0.10 fix macOS build
Relevant upstream issue: ziglang/zig#14559

The patch is a backport of fixes that landed in zig-master and can
be removed with zig-0.11 release.

Additionally, make sure we link statically against LLVM to avoid
unpleasant runtime surprises originating from mixing static and
dynamic LLVM libraries.

Finally, unbreak Zig 0.10.1 on macOS.
2023-03-14 14:02:39 +01:00
Dmitry Bogatov
1360d4cc51 zig: build offline documentation 2023-03-05 13:56:53 -05:00
Winter
ac44b254b4 zig_0_9: build with baseline CPU target
26b9a2f4a1 changes Zig 0.10 to build the
compiler (notably *not* its outputs, at least not by default) with
its baseline CPU target, but we should ideally do it for both versions
to increase reproducibility, as well as increase the number of users who
are able to use Hydra-provided Zig binaries.

This also adds a comment above the flag in 0.10, to explain why we're adding
the flag, as we do with the RPATH one.

See https://github.com/NixOS/nixpkgs/issues/214356 and https://github.com/NixOS/nixpkgs/issues/185665
for further context.
2023-02-16 21:59:16 -05:00