···338339- A new hardening flag, `zerocallusedregs` was made available, corresponding to the gcc/clang option `-fzero-call-used-regs=used-gpr`.
34000341- New options were added to the dnsdist module to enable and configure a DNSCrypt endpoint (see `services.dnsdist.dnscrypt.enable`, etc.).
342 The module can generate the DNSCrypt provider key pair, certificates and also performs their rotation automatically with no downtime.
343
···338339- A new hardening flag, `zerocallusedregs` was made available, corresponding to the gcc/clang option `-fzero-call-used-regs=used-gpr`.
340341+- A new hardening flag, `trivialautovarinit` was made available, corresponding to the gcc/clang option `-ftrivial-auto-var-init=pattern`.
342+343- New options were added to the dnsdist module to enable and configure a DNSCrypt endpoint (see `services.dnsdist.dnscrypt.enable`, etc.).
344 The module can generate the DNSCrypt provider key pair, certificates and also performs their rotation automatically with no downtime.
345
···32fi
3334if (( "${NIX_DEBUG:-0}" >= 1 )); then
35- declare -a allHardeningFlags=(fortify fortify3 stackprotector pie pic strictoverflow format zerocallusedregs)
36 declare -A hardeningDisableMap=()
3738 # Determine which flags were effectively disabled so we can report below.
···105 else
106 hardeningCFlagsBefore+=('-fno-strict-overflow')
107 fi
0000108 ;;
109 format)
110 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling format >&2; fi
···32fi
3334if (( "${NIX_DEBUG:-0}" >= 1 )); then
35+ declare -a allHardeningFlags=(fortify fortify3 stackprotector pie pic strictoverflow format trivialautovarinit zerocallusedregs)
36 declare -A hardeningDisableMap=()
3738 # Determine which flags were effectively disabled so we can report below.
···105 else
106 hardeningCFlagsBefore+=('-fno-strict-overflow')
107 fi
108+ ;;
109+ trivialautovarinit)
110+ if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling trivialautovarinit >&2; fi
111+ hardeningCFlagsBefore+=('-ftrivial-auto-var-init=pattern')
112 ;;
113 format)
114 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling format >&2; fi
···8 env = {
9 prog = "${rustc-unwrapped}/bin/rustc";
10 sysroot = lib.optionalString (sysroot != null) "--sysroot ${sysroot}";
11+12+ # Upstream rustc still assumes that musl = static[1]. The fix for
13+ # this is to disable crt-static by default for non-static musl
14+ # targets.
15+ #
16+ # Even though Cargo will build build.rs files for the build platform,
17+ # cross-compiling _from_ musl appears to work fine, so we only need
18+ # to do this when rustc's target platform is dynamically linked musl.
19+ #
20+ # [1]: https://github.com/rust-lang/compiler-team/issues/422
21+ #
22+ # WARNING: using defaultArgs is dangerous, as it will apply to all
23+ # targets used by this compiler (host and target). This means
24+ # that it can't be used to set arguments that should only be
25+ # applied to the target. It's fine to do this for -crt-static,
26+ # because rustc does not support +crt-static host platforms
27+ # anyway.
28+ defaultArgs = lib.optionalString
29+ (with rustc-unwrapped.stdenv.targetPlatform; isMusl && !isStatic)
30+ "-C target-feature=-crt-static";
31 };
3233 passthru = {
···1+{ lib
2+, stdenv
3+, fetchurl
4+, ncurses
5+}:
6+7+stdenv.mkDerivation (finalAttrs: {
8+ pname = "libedit";
9+ version = "20230828-3.1";
10+11+ src = fetchurl {
12+ url = "https://thrysoee.dk/editline/libedit-${finalAttrs.version}.tar.gz";
13+ hash = "sha256-TugYK25WkpDn0fRPD3jayHFrNfZWt2Uo9pnGnJiBTa0=";
14+ };
15+16+ outputs = [ "out" "dev" "man" ];
17+18+ patches = [
19+ ./01-cygwin.patch
20+ ];
21+22+ propagatedBuildInputs = [
23+ ncurses
24+ ];
25+26+ # GCC automatically include `stdc-predefs.h` while Clang does not do this by
27+ # default. While Musl is ISO 10646 compliant, it does not define
28+ # __STDC_ISO_10646__.
29+ # This definition is in `stdc-predefs.h` -- that's why libedit builds just
30+ # fine with GCC and Musl.
31+ # There is a DR to fix this issue with Clang which is not merged yet.
32+ # https://reviews.llvm.org/D137043
33+ env.NIX_CFLAGS_COMPILE =
34+ lib.optionalString (stdenv.targetPlatform.isMusl && stdenv.cc.isClang)
35+ "-D__STDC_ISO_10646__=201103L";
36+37+ postFixup = ''
38+ find $out/lib -type f | \
39+ grep '\.\(la\|pc\)''$' | \
40+ xargs sed -i -e 's,-lncurses[a-z]*,-L${ncurses.out}/lib -lncursesw,g'
41+ '';
42+43+ meta = {
44+ homepage = "http://www.thrysoee.dk/editline/";
45+ description = "A port of the NetBSD Editline library (libedit)";
46+ longDescription = ''
47+ This is an autotool- and libtoolized port of the NetBSD Editline library
48+ (libedit). This Berkeley-style licensed command line editor library
49+ provides generic line editing, history, and tokenization functions,
50+ similar to those found in GNU Readline.
51+ '';
52+ license = with lib.licenses; [ bsd3 ];
53+ maintainers = with lib.maintainers; [ AndersonTorres ];
54+ platforms = lib.platforms.all;
55+ };
56+})
···1-From b10785c1be469319a09b10bc69db21159b0599ee Mon Sep 17 00:00:00 2001
2From: Sergei Trofimovich <siarheit@google.com>
3Date: Fri, 22 Sep 2023 22:41:49 +0100
4Subject: [PATCH] gcc/file-prefix-map.cc: always mangle __FILE__ into invalid
···1415For this reason we want to remove the occurrences of hashes in the
16expansion of `__FILE__`. `nuke-references` does it by replacing hashes
17-by `eeeeee...` but those paths are also used for debug symbols. It is
18-handy to be able to invert the transformation to go back to the original
19-store path for debuginfod servers. The chosen solution is to make the
20hash uppercase:
21- it does not trigger runtime references (except for all digit hashes,
22 which are unlikely enough)
···42 ...
4344Mangled successfully.
00045--- a/gcc/file-prefix-map.cc
46+++ b/gcc/file-prefix-map.cc
47-@@ -60,6 +60,9 @@ add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
48- maps = map;
49- }
50-51-+/* Forward declaration for a $NIX_STORE remap hack below. */
52-+static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map */
53-+
54- /* Perform user-specified mapping of filename prefixes. Return the
55- GC-allocated new name corresponding to FILENAME or FILENAME if no
56 remapping was performed. */
57-@@ -76,7 +79,31 @@ remap_filename (file_prefix_map *maps, const char *filename)
000000058 if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
59 break;
60 if (!map)
61- return filename;
62+ {
63-+ if (maps == macro_prefix_maps)
64+ {
65+ /* Remap the 32 characters after $NIX_STORE/ to uppercase
66+ *
···76+ {
77+ s = (char *) ggc_alloc_atomic (name_len + 1);
78+ memcpy(s, name, name_len + 1);
79-+ for (int i = nix_store_len + 1; i < nix_store_len + 1 + 32; i++) {
80+ s[i] = TOUPPER(s[i]);
81+ }
82+ return s;
···87 name = filename + map->old_len;
88 name_len = strlen (name) + 1;
8990-@@ -90,7 +117,6 @@ remap_filename (file_prefix_map *maps, const char *filename)
91- ignore it in DW_AT_producer (dwarf2out.cc). */
92-93- /* Linked lists of file_prefix_map structures. */
94--static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map */
95- static file_prefix_map *debug_prefix_maps; /* -fdebug-prefix-map */
96- static file_prefix_map *profile_prefix_maps; /* -fprofile-prefix-map */
970
···1+From 30908556fece379ffd7c0da96c774d8bd297e459 Mon Sep 17 00:00:00 2001
2From: Sergei Trofimovich <siarheit@google.com>
3Date: Fri, 22 Sep 2023 22:41:49 +0100
4Subject: [PATCH] gcc/file-prefix-map.cc: always mangle __FILE__ into invalid
···1415For this reason we want to remove the occurrences of hashes in the
16expansion of `__FILE__`. `nuke-references` does it by replacing hashes
17+by `eeeeee...`. It is handy to be able to invert the transformation to
18+go back to the original store path. The chosen solution is to make the
019hash uppercase:
20- it does not trigger runtime references (except for all digit hashes,
21 which are unlikely enough)
···41 ...
4243Mangled successfully.
44+45+To reverse the effect of the mangle use new `NIX_GCC_DONT_MANGLE_PREFIX_MAP`
46+environment variable. It should not normally be needed.
47--- a/gcc/file-prefix-map.cc
48+++ b/gcc/file-prefix-map.cc
49+@@ -65,7 +65,7 @@ add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
0000000050 remapping was performed. */
51+52+ static const char *
53+-remap_filename (file_prefix_map *maps, const char *filename)
54++remap_filename (file_prefix_map *maps, const char *filename, bool mangle_nix_store = false)
55+ {
56+ file_prefix_map *map;
57+ char *s;
58+@@ -76,7 +76,31 @@ remap_filename (file_prefix_map *maps, const char *filename)
59 if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
60 break;
61 if (!map)
62- return filename;
63+ {
64++ if (mangle_nix_store && getenv("NIX_GCC_DONT_MANGLE_PREFIX_MAP") == NULL)
65+ {
66+ /* Remap the 32 characters after $NIX_STORE/ to uppercase
67+ *
···77+ {
78+ s = (char *) ggc_alloc_atomic (name_len + 1);
79+ memcpy(s, name, name_len + 1);
80++ for (size_t i = nix_store_len + 1; i < nix_store_len + 1 + 32; i++) {
81+ s[i] = TOUPPER(s[i]);
82+ }
83+ return s;
···88 name = filename + map->old_len;
89 name_len = strlen (name) + 1;
9091+@@ -129,7 +153,7 @@ add_profile_prefix_map (const char *arg)
92+ const char *
93+ remap_macro_filename (const char *filename)
94+ {
95+- return remap_filename (macro_prefix_maps, filename);
96++ return remap_filename (macro_prefix_maps, filename, true);
97+ }
9899+ /* Remap using -fdebug-prefix-map. Return the GC-allocated new name
···1-From b10785c1be469319a09b10bc69db21159b0599ee Mon Sep 17 00:00:00 2001
2From: Sergei Trofimovich <siarheit@google.com>
3Date: Fri, 22 Sep 2023 22:41:49 +0100
4Subject: [PATCH] gcc/file-prefix-map.cc: always mangle __FILE__ into invalid
···1415For this reason we want to remove the occurrences of hashes in the
16expansion of `__FILE__`. `nuke-references` does it by replacing hashes
17-by `eeeeee...` but those paths are also used for debug symbols. It is
18-handy to be able to invert the transformation to go back to the original
19-store path for debuginfod servers. The chosen solution is to make the
20hash uppercase:
21- it does not trigger runtime references (except for all digit hashes,
22 which are unlikely enough)
···42 ...
4344Mangled successfully.
00045--- a/gcc/file-prefix-map.cc
46+++ b/gcc/file-prefix-map.cc
47-@@ -69,6 +69,9 @@ add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
48- maps = map;
49- }
50-51-+/* Forward declaration for a $NIX_STORE remap hack below. */
52-+static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map */
53-+
54- /* Perform user-specified mapping of filename prefixes. Return the
55- GC-allocated new name corresponding to FILENAME or FILENAME if no
56 remapping was performed. */
57-@@ -102,6 +105,30 @@ remap_filename (file_prefix_map *maps, const char *filename)
000000058 break;
59 if (!map)
60 {
61-+ if (maps == macro_prefix_maps)
62+ {
63+ /* Remap all fo $NIX_STORE/.{32} paths to uppercase
64+ *
···74+ {
75+ s = (char *) ggc_alloc_atomic (name_len + 1);
76+ memcpy(s, name, name_len + 1);
77-+ for (int i = nix_store_len + 1; i < nix_store_len + 1 + 32; i++) {
78+ s[i] = TOUPPER(s[i]);
79+ }
80+ if (realname != filename)
···85 if (realname != filename)
86 free (const_cast <char *> (realname));
87 return filename;
88-@@ -124,7 +151,6 @@ remap_filename (file_prefix_map *maps, const char *filename)
89- ignore it in DW_AT_producer (gen_command_line_string in opts.cc). */
90-91- /* Linked lists of file_prefix_map structures. */
92--static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map */
93- static file_prefix_map *debug_prefix_maps; /* -fdebug-prefix-map */
94- static file_prefix_map *profile_prefix_maps; /* -fprofile-prefix-map */
950
···1+From e160a8cd4a704f4b7724df02b62394f677cc4198 Mon Sep 17 00:00:00 2001
2From: Sergei Trofimovich <siarheit@google.com>
3Date: Fri, 22 Sep 2023 22:41:49 +0100
4Subject: [PATCH] gcc/file-prefix-map.cc: always mangle __FILE__ into invalid
···1415For this reason we want to remove the occurrences of hashes in the
16expansion of `__FILE__`. `nuke-references` does it by replacing hashes
17+by `eeeeee...`. It is handy to be able to invert the transformation to
18+go back to the original store path. The chosen solution is to make the
019hash uppercase:
20- it does not trigger runtime references (except for all digit hashes,
21 which are unlikely enough)
···41 ...
4243Mangled successfully.
44+45+To reverse the effect of the mangle use new `NIX_GCC_DONT_MANGLE_PREFIX_MAP`
46+environment variable. It should not normally be needed.
47--- a/gcc/file-prefix-map.cc
48+++ b/gcc/file-prefix-map.cc
49+@@ -74,7 +74,7 @@ add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
0000000050 remapping was performed. */
51+52+ static const char *
53+-remap_filename (file_prefix_map *maps, const char *filename)
54++remap_filename (file_prefix_map *maps, const char *filename, bool mangle_nix_store = false)
55+ {
56+ file_prefix_map *map;
57+ char *s;
58+@@ -102,6 +102,30 @@ remap_filename (file_prefix_map *maps, const char *filename)
59 break;
60 if (!map)
61 {
62++ if (mangle_nix_store && getenv("NIX_GCC_DONT_MANGLE_PREFIX_MAP") == NULL)
63+ {
64+ /* Remap all fo $NIX_STORE/.{32} paths to uppercase
65+ *
···75+ {
76+ s = (char *) ggc_alloc_atomic (name_len + 1);
77+ memcpy(s, name, name_len + 1);
78++ for (size_t i = nix_store_len + 1; i < nix_store_len + 1 + 32; i++) {
79+ s[i] = TOUPPER(s[i]);
80+ }
81+ if (realname != filename)
···86 if (realname != filename)
87 free (const_cast <char *> (realname));
88 return filename;
89+@@ -163,7 +187,7 @@ add_profile_prefix_map (const char *arg)
90+ const char *
91+ remap_macro_filename (const char *filename)
92+ {
93+- return remap_filename (macro_prefix_maps, filename);
94++ return remap_filename (macro_prefix_maps, filename, true);
95+ }
9697+ /* Remap using -fdebug-prefix-map. Return the GC-allocated new name
···212 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
213 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
21400215 cmakeBuildType = if debugVersion then "Debug" else "Release";
216217 cmakeFlags = with stdenv; let
···212 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
213 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
214215+ hardeningDisable = [ "trivialautovarinit" ];
216+217 cmakeBuildType = if debugVersion then "Debug" else "Release";
218219 cmakeFlags = with stdenv; let
···202 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
203 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
20400205 cmakeBuildType = if debugVersion then "Debug" else "Release";
206207 cmakeFlags = with stdenv; let
···202 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
203 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
204205+ hardeningDisable = [ "trivialautovarinit" ];
206+207 cmakeBuildType = if debugVersion then "Debug" else "Release";
208209 cmakeFlags = with stdenv; let
···164 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
165 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
16600167 cmakeBuildType = if debugVersion then "Debug" else "Release";
168169 cmakeFlags = with stdenv; let
···164 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
165 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
166167+ hardeningDisable = [ "trivialautovarinit" ];
168+169 cmakeBuildType = if debugVersion then "Debug" else "Release";
170171 cmakeFlags = with stdenv; let
···168 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
169 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
17000171 cmakeBuildType = if debugVersion then "Debug" else "Release";
172173 cmakeFlags = with stdenv; let
···168 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
169 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
170171+ hardeningDisable = [ "trivialautovarinit" ];
172+173 cmakeBuildType = if debugVersion then "Debug" else "Release";
174175 cmakeFlags = with stdenv; let
···300 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
301 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
30200303 cmakeBuildType = if debugVersion then "Debug" else "Release";
304305 cmakeFlags = with stdenv; let
···300 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
301 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
302303+ hardeningDisable = [ "trivialautovarinit" ];
304+305 cmakeBuildType = if debugVersion then "Debug" else "Release";
306307 cmakeFlags = with stdenv; let
···287 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
288 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
28900290 cmakeBuildType = if debugVersion then "Debug" else "Release";
291292 cmakeFlags = with stdenv; let
···287 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
288 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
289290+ hardeningDisable = [ "trivialautovarinit" ];
291+292 cmakeBuildType = if debugVersion then "Debug" else "Release";
293294 cmakeFlags = with stdenv; let
···290 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
291 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
29200293 cmakeBuildType = if debugVersion then "Debug" else "Release";
294295 cmakeFlags = with stdenv; let
···290 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
291 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
292293+ hardeningDisable = [ "trivialautovarinit" ];
294+295 cmakeBuildType = if debugVersion then "Debug" else "Release";
296297 cmakeFlags = with stdenv; let
-59
pkgs/development/compilers/rust/1_75.nix
···1-# New rust versions should first go to staging.
2-# Things to check after updating:
3-# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
4-# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
5-# This testing can be also done by other volunteers as part of the pull
6-# request review, in case platforms cannot be covered.
7-# 2. The LLVM version used for building should match with rust upstream.
8-# Check the version number in the src/llvm-project git submodule in:
9-# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
10-# 3. Firefox and Thunderbird should still build on x86_64-linux.
11-12-{ stdenv, lib
13-, newScope, callPackage
14-, CoreFoundation, Security, SystemConfiguration
15-, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost, pkgsTargetTarget
16-, makeRustPlatform
17-, wrapRustcWith
18-, llvmPackages_17, llvm_17
19-} @ args:
20-21-import ./default.nix {
22- rustcVersion = "1.75.0";
23- rustcSha256 = "sha256-W3OfRbydNB4tHFcNZdI3VZHiLC0j71uKN3EaA4arwIg=";
24-25- llvmSharedForBuild = pkgsBuildBuild.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
26- llvmSharedForHost = pkgsBuildHost.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
27- llvmSharedForTarget = pkgsBuildTarget.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
28-29- # For use at runtime
30- llvmShared = llvm_17.override { enableSharedLibraries = true; };
31-32- # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
33- llvmPackages = llvmPackages_17;
34-35- # Note: the version MUST be one version prior to the version we're
36- # building
37- bootstrapVersion = "1.74.1";
38-39- # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
40- bootstrapHashes = {
41- i686-unknown-linux-gnu = "b883b98372c91bc6aa9dc6ebb2b4e02e7dacbbc2ac1ebe55923dc37134df70a4";
42- x86_64-unknown-linux-gnu = "d206888a2a9d55113940151ba16117ce2456d7de021bab18cfcb06dc48d3157c";
43- x86_64-unknown-linux-musl = "5af3115a1f16431630f288821bd7f3be8cf7e08a7611b3c3bce3976774aa6cd2";
44- arm-unknown-linux-gnueabihf = "1dd7d835af4afe9adb7f785046c907090ace66f1c975cfe9e8886847310d8ec9";
45- armv7-unknown-linux-gnueabihf = "a5038ae004bf86eed64ef67329f7ba047bb4d188663bfd260320d53a2fed33c4";
46- aarch64-unknown-linux-gnu = "0dbdfce647f3c7d9ff00a7aa5d6dbbd7010486f803a9749cff46189f5ecb438c";
47- aarch64-unknown-linux-musl = "02674b8e4311780464313c5773d43606fbf6880d5c4512930d59b6d5d369f0de";
48- x86_64-apple-darwin = "54e1ef01d73f6031fbee36bbecd9af4209eb682dea478696e8282ca64d5792e5";
49- aarch64-apple-darwin = "af6a982cbed85807fb8e5c4ba85b8a76162b58945f4787e0a7dec32e901e8b3b";
50- powerpc64le-unknown-linux-gnu = "bb1c9f0ab1016a2817afe8f72c03f8f1787fe44d0f9999669e0c1957a08e6213";
51- riscv64gc-unknown-linux-gnu = "86561a8d630f634fdd7cb5899d40027103c907d9763a32770b7e2fd57dbd8473";
52- };
53-54- selectRustPackage = pkgs: pkgs.rust_1_75;
55-56- rustcPatches = [ ];
57-}
58-59-(builtins.removeAttrs args [ "llvmPackages_17" "llvm_17"])
···1+# New rust versions should first go to staging.
2+# Things to check after updating:
3+# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
4+# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
5+# This testing can be also done by other volunteers as part of the pull
6+# request review, in case platforms cannot be covered.
7+# 2. The LLVM version used for building should match with rust upstream.
8+# Check the version number in the src/llvm-project git submodule in:
9+# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
10+# 3. Firefox and Thunderbird should still build on x86_64-linux.
11+12+{ stdenv, lib
13+, newScope, callPackage
14+, CoreFoundation, Security, SystemConfiguration
15+, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost, pkgsTargetTarget
16+, makeRustPlatform
17+, wrapRustcWith
18+, llvmPackages_17, llvm_17
19+} @ args:
20+21+import ./default.nix {
22+ rustcVersion = "1.76.0";
23+ rustcSha256 = "sha256-nlz/Azp/DSJmgYmCrZDk0+Tvj47hcVd2xuJQc6E2wCE=";
24+25+ llvmSharedForBuild = pkgsBuildBuild.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
26+ llvmSharedForHost = pkgsBuildHost.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
27+ llvmSharedForTarget = pkgsBuildTarget.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
28+29+ # For use at runtime
30+ llvmShared = llvm_17.override { enableSharedLibraries = true; };
31+32+ # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
33+ llvmPackages = llvmPackages_17;
34+35+ # Note: the version MUST be one version prior to the version we're
36+ # building
37+ bootstrapVersion = "1.75.0";
38+39+ # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
40+ bootstrapHashes = {
41+ i686-unknown-linux-gnu = "107b8d8825deab338f338b15f047829da6225bb34644790847e96f0957c6678f";
42+ x86_64-unknown-linux-gnu = "473978b6f8ff216389f9e89315211c6b683cf95a966196e7914b46e8cf0d74f6";
43+ x86_64-unknown-linux-musl = "cc6ef41aa811ab34f946fe2b4338d1107daf08642125fd566386bf45563597de";
44+ arm-unknown-linux-gnueabihf = "985454b6c385cb461cc8a39d2d7d55dcf6c50495033fe5d28edcc717729d8ae9";
45+ armv7-unknown-linux-gnueabihf = "bd876a75f72040d96be2fb882770b16b482ac0ab15d7e3ad24e6d25b7c74bcf7";
46+ aarch64-unknown-linux-gnu = "30828cd904fcfb47f1ac43627c7033c903889ea4aca538f53dcafbb3744a9a73";
47+ aarch64-unknown-linux-musl = "26b5989525b7cf623f3868a37549736e0efe1142a08f191a97e29758cc640ac4";
48+ x86_64-apple-darwin = "ad066e4dec7ae5948c4e7afe68e250c336a5ab3d655570bb119b3eba9cf22851";
49+ aarch64-apple-darwin = "878ecf81e059507dd2ab256f59629a4fb00171035d2a2f5638cb582d999373b1";
50+ powerpc64le-unknown-linux-gnu = "2599cdfea5860b4efbceb7bca69845a96ac1c96aa50cf8261151e82280b397a0";
51+ riscv64gc-unknown-linux-gnu = "7f7b73d8924d7dd24dcb2ef0da257eb48d9aed658b00fe68e8f1ade0b1ce4511";
52+ };
53+54+ selectRustPackage = pkgs: pkgs.rust_1_76;
55+56+ rustcPatches = [ ];
57+}
58+59+(builtins.removeAttrs args [ "llvmPackages_17" "llvm_17"])
-36
pkgs/development/compilers/rust/cargo.nix
···24 inherit (rustc.unwrapped) tests;
25 };
2627- # Upstream rustc still assumes that musl = static[1]. The fix for
28- # this is to disable crt-static by default for non-static musl
29- # targets.
30- #
31- # For every package apart from Cargo, we can fix this by just
32- # patching rustc to not have crt-static by default. But Cargo is
33- # built with the upstream bootstrap binary for rustc, which we can't
34- # easily patch. This means we need to find another way to make sure
35- # crt-static is not used during the build of pkgsMusl.cargo.
36- #
37- # By default, Cargo doesn't apply RUSTFLAGS when building build.rs
38- # if --target is passed, so the only good way to set -crt-static for
39- # build.rs files used in the Cargo build is to use the unstable
40- # -Zhost-config Cargo feature. This allows us to specify flags that
41- # should be passed to rustc when building for the build platform.
42- # We also need to use -Ztarget-applies-to-host, because using
43- # -Zhost-config requires it.
44- #
45- # When doing this, we also have to specify the linker, or cargo
46- # won't pass a -C linker= argument to rustc. This will make rustc
47- # try to use its default value of "cc", which won't be available
48- # when cross-compiling.
49- #
50- # [1]: https://github.com/rust-lang/compiler-team/issues/422
51- postPatch = lib.optionalString (with stdenv.buildPlatform; isMusl && !isStatic) ''
52- mkdir -p .cargo
53- cat <<EOF >> .cargo/config
54- [host]
55- rustflags = "-C target-feature=-crt-static"
56- linker = "${pkgsBuildHost.stdenv.cc}/bin/${pkgsBuildHost.stdenv.cc.targetPrefix}cc"
57- [unstable]
58- host-config = true
59- target-applies-to-host = true
60- EOF
61- '';
62-63 # changes hash of vendor directory otherwise
64 dontUpdateAutotoolsGnuConfigScripts = true;
65
···197198 # Useful debugging parameter
199 # export VERBOSE=1
200- '' + lib.optionalString (stdenv.targetPlatform.isMusl && !stdenv.targetPlatform.isStatic) ''
201- # Upstream rustc still assumes that musl = static[1]. The fix for
202- # this is to disable crt-static by default for non-static musl
203- # targets.
204- #
205- # Even though Cargo will build build.rs files for the build platform,
206- # cross-compiling _from_ musl appears to work fine, so we only need
207- # to do this when rustc's target platform is dynamically linked musl.
208- #
209- # [1]: https://github.com/rust-lang/compiler-team/issues/422
210- substituteInPlace compiler/rustc_target/src/spec/base/linux_musl.rs \
211- --replace "base.crt_static_default = true" "base.crt_static_default = false"
212 '' + lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) ''
213 # See https://github.com/jemalloc/jemalloc/issues/1997
214 # Using a value of 48 should work on both emulated and native x86_64-darwin.
···197198 # Useful debugging parameter
199 # export VERBOSE=1
000000000000200 '' + lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) ''
201 # See https://github.com/jemalloc/jemalloc/issues/1997
202 # Using a value of 48 should work on both emulated and native x86_64-darwin.
···22 # export only if we haven't already got this dir in the search path
23 if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi
240000025 export "${varName}=${!varName:+${!varName};}${absPattern}"
26}
27
···22 # export only if we haven't already got this dir in the search path
23 if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi
2425+ # if the path variable has not yet been set, initialize it to ";;"
26+ # this is a magic value that will be replaced by the default,
27+ # allowing relative modules to be used even when there are system modules.
28+ if [[ -v "${varName}" ]]; then export "${varName}=;;"; fi
29+30 export "${varName}=${!varName:+${!varName};}${absPattern}"
31}
32
···1addGstreamer1LibPath () {
2 if test -d "$1/lib/gstreamer-1.0"
3 then
4- export GST_PLUGIN_SYSTEM_PATH_1_0="${GST_PLUGIN_SYSTEM_PATH_1_0-}${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$1/lib/gstreamer-1.0"
5 fi
6}
78addEnvHooks "$hostOffset" addGstreamer1LibPath
9-
···1addGstreamer1LibPath () {
2 if test -d "$1/lib/gstreamer-1.0"
3 then
4+ addToSearchPath GST_PLUGIN_SYSTEM_PATH_1_0 "$1/lib/gstreamer-1.0"
5 fi
6}
78addEnvHooks "$hostOffset" addGstreamer1LibPath
0
···1-{ lib, stdenv, fetchurl, ncurses }:
2-3-stdenv.mkDerivation rec {
4- pname = "libedit";
5- version = "20230828-3.1";
6-7- src = fetchurl {
8- url = "https://thrysoee.dk/editline/${pname}-${version}.tar.gz";
9- sha256 = "sha256-TugYK25WkpDn0fRPD3jayHFrNfZWt2Uo9pnGnJiBTa0=";
10- };
11-12- outputs = [ "out" "dev" ];
13-14- # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
15- # NROFF = "${groff}/bin/nroff";
16-17- # GCC automatically include `stdc-predefs.h` while Clang does not do
18- # this by default. While Musl is ISO 10646 compliant, doesn't define
19- # __STDC_ISO_10646__. This definition is in `stdc-predefs.h` that's
20- # why libedit builds just fine with GCC and Musl.
21- # There is a DR to fix this issue with Clang which is not merged
22- # yet.
23- # https://reviews.llvm.org/D137043
24- env.NIX_CFLAGS_COMPILE =
25- lib.optionalString (stdenv.targetPlatform.isMusl && stdenv.cc.isClang)
26- "-D__STDC_ISO_10646__=201103L";
27-28- patches = [ ./01-cygwin.patch ];
29-30- propagatedBuildInputs = [ ncurses ];
31-32- postInstall = ''
33- find $out/lib -type f | grep '\.\(la\|pc\)''$' | xargs sed -i \
34- -e 's,-lncurses[a-z]*,-L${ncurses.out}/lib -lncursesw,g'
35- '';
36-37- meta = with lib; {
38- homepage = "http://www.thrysoee.dk/editline/";
39- description = "A port of the NetBSD Editline library (libedit)";
40- license = licenses.bsd3;
41- platforms = platforms.all;
42- };
43-}
···0000000000000000000000000000000000000000000
+2-5
pkgs/development/libraries/libffi/default.nix
···1112stdenv.mkDerivation (finalAttrs: {
13 pname = "libffi";
14- version = "3.4.4";
1516 src = fetchurl {
17 url = with finalAttrs; "https://github.com/libffi/libffi/releases/download/v${version}/${pname}-${version}.tar.gz";
18- sha256 = "sha256-1mxWrSWags8qnfxAizK/XaUjcVALhHRff7i2RXEt9nY=";
19 };
2021 # Note: this package is used for bootstrapping fetchurl, and thus
···23 # cgit) that are needed here should be included directly in Nixpkgs as
24 # files.
25 patches = [
26- # Fix implicit function declarations (clang-16 build failure):
27- # https://github.com/libffi/libffi/pull/764
28- ./fix-implicit-fun-decl.patch
29 ];
3031 strictDeps = true;
···1112stdenv.mkDerivation (finalAttrs: {
13 pname = "libffi";
14+ version = "3.4.6";
1516 src = fetchurl {
17 url = with finalAttrs; "https://github.com/libffi/libffi/releases/download/v${version}/${pname}-${version}.tar.gz";
18+ hash = "sha256-sN6p3yPIY6elDoJUQPPr/6vWXfFJcQjl1Dd0eEOJWk4=";
19 };
2021 # Note: this package is used for bootstrapping fetchurl, and thus
···23 # cgit) that are needed here should be included directly in Nixpkgs as
24 # files.
25 patches = [
00026 ];
2728 strictDeps = true;
···35 rm $out/lib/*.a
36 '';
3700000038 meta = with lib; {
39 description = "MPEG-4 video codec for PC";
40- homepage = "https://www.xvid.com/";
41- license = licenses.gpl2;
42 maintainers = with maintainers; [ codyopel lovek323 ];
43- platforms = platforms.all;
44 };
45}
46-
···35 rm $out/lib/*.a
36 '';
3738+ # Dependants of xvidcore don't know to look in bin for dependecies. Link them
39+ # in lib so other depedants of xvidcore can find the dlls.
40+ postFixup = lib.optionalString stdenv.hostPlatform.isMinGW ''
41+ ln -s $out/bin/*.dll $out/lib
42+ '';
43+44 meta = with lib; {
45 description = "MPEG-4 video codec for PC";
46+ homepage = "https://www.xvid.com/";
47+ license = licenses.gpl2;
48 maintainers = with maintainers; [ codyopel lovek323 ];
49+ platforms = platforms.all;
50 };
51}
0
···4, fetchFromGitHub
5, pytest-asyncio
6, pytestCheckHook
7+, pythonAtLeast
8, pythonOlder
9}:
10···3334 pythonImportsCheck = [
35 "pysqueezebox"
36+ ];
37+38+ disabledTests = lib.optionals (pythonAtLeast "3.12") [
39+ # AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.
40+ "test_verified_pause"
41 ];
4243 disabledTestPaths = [
···2, buildPythonPackage
3, fetchPypi
4, setuptools
5-, nose
6, mock
7}:
8···20 setuptools
21 ];
2223- nativeCheckInputs = [ nose mock ];
2425- patchPhase = ''
26- # Failing test: ERROR: statsd.tests.test_ipv6_resolution_udp
27- sed -i 's/test_ipv6_resolution_udp/noop/' statsd/tests.py
28- # well this is a noop, but so it was before
29- sed -i 's/assert_called_once()/called/' statsd/tests.py
30 '';
3132 meta = with lib; {
···1+commit 166afaf144d6473464975438353257359dd51708
2+Author: Andreas Wiese <andreas.wiese@kernkonzept.com>
3+Date: Thu Feb 1 11:35:02 2024 +0100
4+5+ aa-remove-unknown: fix readability check
6+7+ This check is intended for ensuring that the profiles file can actually
8+ be opened. The *actual* check is performed by the shell, not the read
9+ utility, which won't even be executed if the input redirection (and
10+ hence the test) fails.
11+12+ If the test succeeds, though, using `read` here might actually
13+ jeopardize the test result if there are no profiles loaded and the file
14+ is empty.
15+16+ This commit fixes that case by simply using `true` instead of `read`.
17+18+diff --git a/utils/aa-remove-unknown b/utils/aa-remove-unknown
19+index 0e00d6a0..3351feef 100755
20+--- a/utils/aa-remove-unknown
21++++ b/utils/aa-remove-unknown
22+@@ -63,7 +63,7 @@ fi
23+ # We have to do this check because error checking awk's getline() below is
24+ # tricky and, as is, results in an infinite loop when apparmorfs returns an
25+ # error from open().
26+-if ! IFS= read -r _ < "$PROFILES" ; then
27++if ! true < "$PROFILES" ; then
28+ echo "ERROR: Unable to read apparmorfs profiles file" 1>&2
29+ exit 1
30+ elif [ ! -w "$REMOVE" ] ; then