···338338339339- A new hardening flag, `zerocallusedregs` was made available, corresponding to the gcc/clang option `-fzero-call-used-regs=used-gpr`.
340340341341+- A new hardening flag, `trivialautovarinit` was made available, corresponding to the gcc/clang option `-ftrivial-auto-var-init=pattern`.
342342+341343- New options were added to the dnsdist module to enable and configure a DNSCrypt endpoint (see `services.dnsdist.dnscrypt.enable`, etc.).
342344 The module can generate the DNSCrypt provider key pair, certificates and also performs their rotation automatically with no downtime.
343345
···3232fi
33333434if (( "${NIX_DEBUG:-0}" >= 1 )); then
3535- declare -a allHardeningFlags=(fortify fortify3 stackprotector pie pic strictoverflow format zerocallusedregs)
3535+ declare -a allHardeningFlags=(fortify fortify3 stackprotector pie pic strictoverflow format trivialautovarinit zerocallusedregs)
3636 declare -A hardeningDisableMap=()
37373838 # Determine which flags were effectively disabled so we can report below.
···105105 else
106106 hardeningCFlagsBefore+=('-fno-strict-overflow')
107107 fi
108108+ ;;
109109+ trivialautovarinit)
110110+ if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling trivialautovarinit >&2; fi
111111+ hardeningCFlagsBefore+=('-ftrivial-auto-var-init=pattern')
108112 ;;
109113 format)
110114 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling format >&2; fi
+20
pkgs/build-support/rust/rustc-wrapper/default.nix
···88 env = {
99 prog = "${rustc-unwrapped}/bin/rustc";
1010 sysroot = lib.optionalString (sysroot != null) "--sysroot ${sysroot}";
1111+1212+ # Upstream rustc still assumes that musl = static[1]. The fix for
1313+ # this is to disable crt-static by default for non-static musl
1414+ # targets.
1515+ #
1616+ # Even though Cargo will build build.rs files for the build platform,
1717+ # cross-compiling _from_ musl appears to work fine, so we only need
1818+ # to do this when rustc's target platform is dynamically linked musl.
1919+ #
2020+ # [1]: https://github.com/rust-lang/compiler-team/issues/422
2121+ #
2222+ # WARNING: using defaultArgs is dangerous, as it will apply to all
2323+ # targets used by this compiler (host and target). This means
2424+ # that it can't be used to set arguments that should only be
2525+ # applied to the target. It's fine to do this for -crt-static,
2626+ # because rustc does not support +crt-static host platforms
2727+ # anyway.
2828+ defaultArgs = lib.optionalString
2929+ (with rustc-unwrapped.stdenv.targetPlatform; isMusl && !isStatic)
3030+ "-C target-feature=-crt-static";
1131 };
12321333 passthru = {
···11+{ lib
22+, stdenv
33+, fetchurl
44+, ncurses
55+}:
66+77+stdenv.mkDerivation (finalAttrs: {
88+ pname = "libedit";
99+ version = "20230828-3.1";
1010+1111+ src = fetchurl {
1212+ url = "https://thrysoee.dk/editline/libedit-${finalAttrs.version}.tar.gz";
1313+ hash = "sha256-TugYK25WkpDn0fRPD3jayHFrNfZWt2Uo9pnGnJiBTa0=";
1414+ };
1515+1616+ outputs = [ "out" "dev" "man" ];
1717+1818+ patches = [
1919+ ./01-cygwin.patch
2020+ ];
2121+2222+ propagatedBuildInputs = [
2323+ ncurses
2424+ ];
2525+2626+ # GCC automatically include `stdc-predefs.h` while Clang does not do this by
2727+ # default. While Musl is ISO 10646 compliant, it does not define
2828+ # __STDC_ISO_10646__.
2929+ # This definition is in `stdc-predefs.h` -- that's why libedit builds just
3030+ # fine with GCC and Musl.
3131+ # There is a DR to fix this issue with Clang which is not merged yet.
3232+ # https://reviews.llvm.org/D137043
3333+ env.NIX_CFLAGS_COMPILE =
3434+ lib.optionalString (stdenv.targetPlatform.isMusl && stdenv.cc.isClang)
3535+ "-D__STDC_ISO_10646__=201103L";
3636+3737+ postFixup = ''
3838+ find $out/lib -type f | \
3939+ grep '\.\(la\|pc\)''$' | \
4040+ xargs sed -i -e 's,-lncurses[a-z]*,-L${ncurses.out}/lib -lncursesw,g'
4141+ '';
4242+4343+ meta = {
4444+ homepage = "http://www.thrysoee.dk/editline/";
4545+ description = "A port of the NetBSD Editline library (libedit)";
4646+ longDescription = ''
4747+ This is an autotool- and libtoolized port of the NetBSD Editline library
4848+ (libedit). This Berkeley-style licensed command line editor library
4949+ provides generic line editing, history, and tokenization functions,
5050+ similar to those found in GNU Readline.
5151+ '';
5252+ license = with lib.licenses; [ bsd3 ];
5353+ maintainers = with lib.maintainers; [ AndersonTorres ];
5454+ platforms = lib.platforms.all;
5555+ };
5656+})
···11-From b10785c1be469319a09b10bc69db21159b0599ee Mon Sep 17 00:00:00 2001
11+From 30908556fece379ffd7c0da96c774d8bd297e459 Mon Sep 17 00:00:00 2001
22From: Sergei Trofimovich <siarheit@google.com>
33Date: Fri, 22 Sep 2023 22:41:49 +0100
44Subject: [PATCH] gcc/file-prefix-map.cc: always mangle __FILE__ into invalid
···14141515For this reason we want to remove the occurrences of hashes in the
1616expansion of `__FILE__`. `nuke-references` does it by replacing hashes
1717-by `eeeeee...` but those paths are also used for debug symbols. It is
1818-handy to be able to invert the transformation to go back to the original
1919-store path for debuginfod servers. The chosen solution is to make the
1717+by `eeeeee...`. It is handy to be able to invert the transformation to
1818+go back to the original store path. The chosen solution is to make the
2019hash uppercase:
2120- it does not trigger runtime references (except for all digit hashes,
2221 which are unlikely enough)
···4241 ...
43424443Mangled successfully.
4444+4545+To reverse the effect of the mangle use new `NIX_GCC_DONT_MANGLE_PREFIX_MAP`
4646+environment variable. It should not normally be needed.
4547--- a/gcc/file-prefix-map.cc
4648+++ b/gcc/file-prefix-map.cc
4747-@@ -60,6 +60,9 @@ add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
4848- maps = map;
4949- }
5050-5151-+/* Forward declaration for a $NIX_STORE remap hack below. */
5252-+static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map */
5353-+
5454- /* Perform user-specified mapping of filename prefixes. Return the
5555- GC-allocated new name corresponding to FILENAME or FILENAME if no
4949+@@ -65,7 +65,7 @@ add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
5650 remapping was performed. */
5757-@@ -76,7 +79,31 @@ remap_filename (file_prefix_map *maps, const char *filename)
5151+5252+ static const char *
5353+-remap_filename (file_prefix_map *maps, const char *filename)
5454++remap_filename (file_prefix_map *maps, const char *filename, bool mangle_nix_store = false)
5555+ {
5656+ file_prefix_map *map;
5757+ char *s;
5858+@@ -76,7 +76,31 @@ remap_filename (file_prefix_map *maps, const char *filename)
5859 if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
5960 break;
6061 if (!map)
6162- return filename;
6263+ {
6363-+ if (maps == macro_prefix_maps)
6464++ if (mangle_nix_store && getenv("NIX_GCC_DONT_MANGLE_PREFIX_MAP") == NULL)
6465+ {
6566+ /* Remap the 32 characters after $NIX_STORE/ to uppercase
6667+ *
···7677+ {
7778+ s = (char *) ggc_alloc_atomic (name_len + 1);
7879+ memcpy(s, name, name_len + 1);
7979-+ for (int i = nix_store_len + 1; i < nix_store_len + 1 + 32; i++) {
8080++ for (size_t i = nix_store_len + 1; i < nix_store_len + 1 + 32; i++) {
8081+ s[i] = TOUPPER(s[i]);
8182+ }
8283+ return s;
···8788 name = filename + map->old_len;
8889 name_len = strlen (name) + 1;
89909090-@@ -90,7 +117,6 @@ remap_filename (file_prefix_map *maps, const char *filename)
9191- ignore it in DW_AT_producer (dwarf2out.cc). */
9292-9393- /* Linked lists of file_prefix_map structures. */
9494--static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map */
9595- static file_prefix_map *debug_prefix_maps; /* -fdebug-prefix-map */
9696- static file_prefix_map *profile_prefix_maps; /* -fprofile-prefix-map */
9191+@@ -129,7 +153,7 @@ add_profile_prefix_map (const char *arg)
9292+ const char *
9393+ remap_macro_filename (const char *filename)
9494+ {
9595+- return remap_filename (macro_prefix_maps, filename);
9696++ return remap_filename (macro_prefix_maps, filename, true);
9797+ }
97989999+ /* Remap using -fdebug-prefix-map. Return the GC-allocated new name
···11-From b10785c1be469319a09b10bc69db21159b0599ee Mon Sep 17 00:00:00 2001
11+From e160a8cd4a704f4b7724df02b62394f677cc4198 Mon Sep 17 00:00:00 2001
22From: Sergei Trofimovich <siarheit@google.com>
33Date: Fri, 22 Sep 2023 22:41:49 +0100
44Subject: [PATCH] gcc/file-prefix-map.cc: always mangle __FILE__ into invalid
···14141515For this reason we want to remove the occurrences of hashes in the
1616expansion of `__FILE__`. `nuke-references` does it by replacing hashes
1717-by `eeeeee...` but those paths are also used for debug symbols. It is
1818-handy to be able to invert the transformation to go back to the original
1919-store path for debuginfod servers. The chosen solution is to make the
1717+by `eeeeee...`. It is handy to be able to invert the transformation to
1818+go back to the original store path. The chosen solution is to make the
2019hash uppercase:
2120- it does not trigger runtime references (except for all digit hashes,
2221 which are unlikely enough)
···4241 ...
43424443Mangled successfully.
4444+4545+To reverse the effect of the mangle use new `NIX_GCC_DONT_MANGLE_PREFIX_MAP`
4646+environment variable. It should not normally be needed.
4547--- a/gcc/file-prefix-map.cc
4648+++ b/gcc/file-prefix-map.cc
4747-@@ -69,6 +69,9 @@ add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
4848- maps = map;
4949- }
5050-5151-+/* Forward declaration for a $NIX_STORE remap hack below. */
5252-+static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map */
5353-+
5454- /* Perform user-specified mapping of filename prefixes. Return the
5555- GC-allocated new name corresponding to FILENAME or FILENAME if no
4949+@@ -74,7 +74,7 @@ add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
5650 remapping was performed. */
5757-@@ -102,6 +105,30 @@ remap_filename (file_prefix_map *maps, const char *filename)
5151+5252+ static const char *
5353+-remap_filename (file_prefix_map *maps, const char *filename)
5454++remap_filename (file_prefix_map *maps, const char *filename, bool mangle_nix_store = false)
5555+ {
5656+ file_prefix_map *map;
5757+ char *s;
5858+@@ -102,6 +102,30 @@ remap_filename (file_prefix_map *maps, const char *filename)
5859 break;
5960 if (!map)
6061 {
6161-+ if (maps == macro_prefix_maps)
6262++ if (mangle_nix_store && getenv("NIX_GCC_DONT_MANGLE_PREFIX_MAP") == NULL)
6263+ {
6364+ /* Remap all fo $NIX_STORE/.{32} paths to uppercase
6465+ *
···7475+ {
7576+ s = (char *) ggc_alloc_atomic (name_len + 1);
7677+ memcpy(s, name, name_len + 1);
7777-+ for (int i = nix_store_len + 1; i < nix_store_len + 1 + 32; i++) {
7878++ for (size_t i = nix_store_len + 1; i < nix_store_len + 1 + 32; i++) {
7879+ s[i] = TOUPPER(s[i]);
7980+ }
8081+ if (realname != filename)
···8586 if (realname != filename)
8687 free (const_cast <char *> (realname));
8788 return filename;
8888-@@ -124,7 +151,6 @@ remap_filename (file_prefix_map *maps, const char *filename)
8989- ignore it in DW_AT_producer (gen_command_line_string in opts.cc). */
9090-9191- /* Linked lists of file_prefix_map structures. */
9292--static file_prefix_map *macro_prefix_maps; /* -fmacro-prefix-map */
9393- static file_prefix_map *debug_prefix_maps; /* -fdebug-prefix-map */
9494- static file_prefix_map *profile_prefix_maps; /* -fprofile-prefix-map */
8989+@@ -163,7 +187,7 @@ add_profile_prefix_map (const char *arg)
9090+ const char *
9191+ remap_macro_filename (const char *filename)
9292+ {
9393+- return remap_filename (macro_prefix_maps, filename);
9494++ return remap_filename (macro_prefix_maps, filename, true);
9595+ }
95969797+ /* Remap using -fdebug-prefix-map. Return the GC-allocated new name
···212212 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
213213 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
214214215215+ hardeningDisable = [ "trivialautovarinit" ];
216216+215217 cmakeBuildType = if debugVersion then "Debug" else "Release";
216218217219 cmakeFlags = with stdenv; let
···202202 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
203203 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
204204205205+ hardeningDisable = [ "trivialautovarinit" ];
206206+205207 cmakeBuildType = if debugVersion then "Debug" else "Release";
206208207209 cmakeFlags = with stdenv; let
···164164 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
165165 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
166166167167+ hardeningDisable = [ "trivialautovarinit" ];
168168+167169 cmakeBuildType = if debugVersion then "Debug" else "Release";
168170169171 cmakeFlags = with stdenv; let
···168168 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
169169 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
170170171171+ hardeningDisable = [ "trivialautovarinit" ];
172172+171173 cmakeBuildType = if debugVersion then "Debug" else "Release";
172174173175 cmakeFlags = with stdenv; let
···300300 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
301301 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
302302303303+ hardeningDisable = [ "trivialautovarinit" ];
304304+303305 cmakeBuildType = if debugVersion then "Debug" else "Release";
304306305307 cmakeFlags = with stdenv; let
···287287 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
288288 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
289289290290+ hardeningDisable = [ "trivialautovarinit" ];
291291+290292 cmakeBuildType = if debugVersion then "Debug" else "Release";
291293292294 cmakeFlags = with stdenv; let
···290290 # E.g. mesa.drivers use the build-id as a cache key (see #93946):
291291 LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
292292293293+ hardeningDisable = [ "trivialautovarinit" ];
294294+293295 cmakeBuildType = if debugVersion then "Debug" else "Release";
294296295297 cmakeFlags = with stdenv; let
-59
pkgs/development/compilers/rust/1_75.nix
···11-# New rust versions should first go to staging.
22-# Things to check after updating:
33-# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
44-# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
55-# This testing can be also done by other volunteers as part of the pull
66-# request review, in case platforms cannot be covered.
77-# 2. The LLVM version used for building should match with rust upstream.
88-# Check the version number in the src/llvm-project git submodule in:
99-# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
1010-# 3. Firefox and Thunderbird should still build on x86_64-linux.
1111-1212-{ stdenv, lib
1313-, newScope, callPackage
1414-, CoreFoundation, Security, SystemConfiguration
1515-, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost, pkgsTargetTarget
1616-, makeRustPlatform
1717-, wrapRustcWith
1818-, llvmPackages_17, llvm_17
1919-} @ args:
2020-2121-import ./default.nix {
2222- rustcVersion = "1.75.0";
2323- rustcSha256 = "sha256-W3OfRbydNB4tHFcNZdI3VZHiLC0j71uKN3EaA4arwIg=";
2424-2525- llvmSharedForBuild = pkgsBuildBuild.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
2626- llvmSharedForHost = pkgsBuildHost.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
2727- llvmSharedForTarget = pkgsBuildTarget.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
2828-2929- # For use at runtime
3030- llvmShared = llvm_17.override { enableSharedLibraries = true; };
3131-3232- # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
3333- llvmPackages = llvmPackages_17;
3434-3535- # Note: the version MUST be one version prior to the version we're
3636- # building
3737- bootstrapVersion = "1.74.1";
3838-3939- # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
4040- bootstrapHashes = {
4141- i686-unknown-linux-gnu = "b883b98372c91bc6aa9dc6ebb2b4e02e7dacbbc2ac1ebe55923dc37134df70a4";
4242- x86_64-unknown-linux-gnu = "d206888a2a9d55113940151ba16117ce2456d7de021bab18cfcb06dc48d3157c";
4343- x86_64-unknown-linux-musl = "5af3115a1f16431630f288821bd7f3be8cf7e08a7611b3c3bce3976774aa6cd2";
4444- arm-unknown-linux-gnueabihf = "1dd7d835af4afe9adb7f785046c907090ace66f1c975cfe9e8886847310d8ec9";
4545- armv7-unknown-linux-gnueabihf = "a5038ae004bf86eed64ef67329f7ba047bb4d188663bfd260320d53a2fed33c4";
4646- aarch64-unknown-linux-gnu = "0dbdfce647f3c7d9ff00a7aa5d6dbbd7010486f803a9749cff46189f5ecb438c";
4747- aarch64-unknown-linux-musl = "02674b8e4311780464313c5773d43606fbf6880d5c4512930d59b6d5d369f0de";
4848- x86_64-apple-darwin = "54e1ef01d73f6031fbee36bbecd9af4209eb682dea478696e8282ca64d5792e5";
4949- aarch64-apple-darwin = "af6a982cbed85807fb8e5c4ba85b8a76162b58945f4787e0a7dec32e901e8b3b";
5050- powerpc64le-unknown-linux-gnu = "bb1c9f0ab1016a2817afe8f72c03f8f1787fe44d0f9999669e0c1957a08e6213";
5151- riscv64gc-unknown-linux-gnu = "86561a8d630f634fdd7cb5899d40027103c907d9763a32770b7e2fd57dbd8473";
5252- };
5353-5454- selectRustPackage = pkgs: pkgs.rust_1_75;
5555-5656- rustcPatches = [ ];
5757-}
5858-5959-(builtins.removeAttrs args [ "llvmPackages_17" "llvm_17"])
+59
pkgs/development/compilers/rust/1_76.nix
···11+# New rust versions should first go to staging.
22+# Things to check after updating:
33+# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
44+# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
55+# This testing can be also done by other volunteers as part of the pull
66+# request review, in case platforms cannot be covered.
77+# 2. The LLVM version used for building should match with rust upstream.
88+# Check the version number in the src/llvm-project git submodule in:
99+# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
1010+# 3. Firefox and Thunderbird should still build on x86_64-linux.
1111+1212+{ stdenv, lib
1313+, newScope, callPackage
1414+, CoreFoundation, Security, SystemConfiguration
1515+, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost, pkgsTargetTarget
1616+, makeRustPlatform
1717+, wrapRustcWith
1818+, llvmPackages_17, llvm_17
1919+} @ args:
2020+2121+import ./default.nix {
2222+ rustcVersion = "1.76.0";
2323+ rustcSha256 = "sha256-nlz/Azp/DSJmgYmCrZDk0+Tvj47hcVd2xuJQc6E2wCE=";
2424+2525+ llvmSharedForBuild = pkgsBuildBuild.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
2626+ llvmSharedForHost = pkgsBuildHost.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
2727+ llvmSharedForTarget = pkgsBuildTarget.llvmPackages_17.libllvm.override { enableSharedLibraries = true; };
2828+2929+ # For use at runtime
3030+ llvmShared = llvm_17.override { enableSharedLibraries = true; };
3131+3232+ # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox
3333+ llvmPackages = llvmPackages_17;
3434+3535+ # Note: the version MUST be one version prior to the version we're
3636+ # building
3737+ bootstrapVersion = "1.75.0";
3838+3939+ # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
4040+ bootstrapHashes = {
4141+ i686-unknown-linux-gnu = "107b8d8825deab338f338b15f047829da6225bb34644790847e96f0957c6678f";
4242+ x86_64-unknown-linux-gnu = "473978b6f8ff216389f9e89315211c6b683cf95a966196e7914b46e8cf0d74f6";
4343+ x86_64-unknown-linux-musl = "cc6ef41aa811ab34f946fe2b4338d1107daf08642125fd566386bf45563597de";
4444+ arm-unknown-linux-gnueabihf = "985454b6c385cb461cc8a39d2d7d55dcf6c50495033fe5d28edcc717729d8ae9";
4545+ armv7-unknown-linux-gnueabihf = "bd876a75f72040d96be2fb882770b16b482ac0ab15d7e3ad24e6d25b7c74bcf7";
4646+ aarch64-unknown-linux-gnu = "30828cd904fcfb47f1ac43627c7033c903889ea4aca538f53dcafbb3744a9a73";
4747+ aarch64-unknown-linux-musl = "26b5989525b7cf623f3868a37549736e0efe1142a08f191a97e29758cc640ac4";
4848+ x86_64-apple-darwin = "ad066e4dec7ae5948c4e7afe68e250c336a5ab3d655570bb119b3eba9cf22851";
4949+ aarch64-apple-darwin = "878ecf81e059507dd2ab256f59629a4fb00171035d2a2f5638cb582d999373b1";
5050+ powerpc64le-unknown-linux-gnu = "2599cdfea5860b4efbceb7bca69845a96ac1c96aa50cf8261151e82280b397a0";
5151+ riscv64gc-unknown-linux-gnu = "7f7b73d8924d7dd24dcb2ef0da257eb48d9aed658b00fe68e8f1ade0b1ce4511";
5252+ };
5353+5454+ selectRustPackage = pkgs: pkgs.rust_1_76;
5555+5656+ rustcPatches = [ ];
5757+}
5858+5959+(builtins.removeAttrs args [ "llvmPackages_17" "llvm_17"])
-36
pkgs/development/compilers/rust/cargo.nix
···2424 inherit (rustc.unwrapped) tests;
2525 };
26262727- # Upstream rustc still assumes that musl = static[1]. The fix for
2828- # this is to disable crt-static by default for non-static musl
2929- # targets.
3030- #
3131- # For every package apart from Cargo, we can fix this by just
3232- # patching rustc to not have crt-static by default. But Cargo is
3333- # built with the upstream bootstrap binary for rustc, which we can't
3434- # easily patch. This means we need to find another way to make sure
3535- # crt-static is not used during the build of pkgsMusl.cargo.
3636- #
3737- # By default, Cargo doesn't apply RUSTFLAGS when building build.rs
3838- # if --target is passed, so the only good way to set -crt-static for
3939- # build.rs files used in the Cargo build is to use the unstable
4040- # -Zhost-config Cargo feature. This allows us to specify flags that
4141- # should be passed to rustc when building for the build platform.
4242- # We also need to use -Ztarget-applies-to-host, because using
4343- # -Zhost-config requires it.
4444- #
4545- # When doing this, we also have to specify the linker, or cargo
4646- # won't pass a -C linker= argument to rustc. This will make rustc
4747- # try to use its default value of "cc", which won't be available
4848- # when cross-compiling.
4949- #
5050- # [1]: https://github.com/rust-lang/compiler-team/issues/422
5151- postPatch = lib.optionalString (with stdenv.buildPlatform; isMusl && !isStatic) ''
5252- mkdir -p .cargo
5353- cat <<EOF >> .cargo/config
5454- [host]
5555- rustflags = "-C target-feature=-crt-static"
5656- linker = "${pkgsBuildHost.stdenv.cc}/bin/${pkgsBuildHost.stdenv.cc.targetPrefix}cc"
5757- [unstable]
5858- host-config = true
5959- target-applies-to-host = true
6060- EOF
6161- '';
6262-6327 # changes hash of vendor directory otherwise
6428 dontUpdateAutotoolsGnuConfigScripts = true;
6529
-12
pkgs/development/compilers/rust/rustc.nix
···197197198198 # Useful debugging parameter
199199 # export VERBOSE=1
200200- '' + lib.optionalString (stdenv.targetPlatform.isMusl && !stdenv.targetPlatform.isStatic) ''
201201- # Upstream rustc still assumes that musl = static[1]. The fix for
202202- # this is to disable crt-static by default for non-static musl
203203- # targets.
204204- #
205205- # Even though Cargo will build build.rs files for the build platform,
206206- # cross-compiling _from_ musl appears to work fine, so we only need
207207- # to do this when rustc's target platform is dynamically linked musl.
208208- #
209209- # [1]: https://github.com/rust-lang/compiler-team/issues/422
210210- substituteInPlace compiler/rustc_target/src/spec/base/linux_musl.rs \
211211- --replace "base.crt_static_default = true" "base.crt_static_default = false"
212200 '' + lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) ''
213201 # See https://github.com/jemalloc/jemalloc/issues/1997
214202 # Using a value of 48 should work on both emulated and native x86_64-darwin.
···2222 # export only if we haven't already got this dir in the search path
2323 if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi
24242525+ # if the path variable has not yet been set, initialize it to ";;"
2626+ # this is a magic value that will be replaced by the default,
2727+ # allowing relative modules to be used even when there are system modules.
2828+ if [[ -v "${varName}" ]]; then export "${varName}=;;"; fi
2929+2530 export "${varName}=${!varName:+${!varName};}${absPattern}"
2631}
2732
···44, fetchFromGitHub
55, pytest-asyncio
66, pytestCheckHook
77+, pythonAtLeast
78, pythonOlder
89}:
910···32333334 pythonImportsCheck = [
3435 "pysqueezebox"
3636+ ];
3737+3838+ disabledTests = lib.optionals (pythonAtLeast "3.12") [
3939+ # AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.
4040+ "test_verified_pause"
3541 ];
36423743 disabledTestPaths = [
···11+commit 166afaf144d6473464975438353257359dd51708
22+Author: Andreas Wiese <andreas.wiese@kernkonzept.com>
33+Date: Thu Feb 1 11:35:02 2024 +0100
44+55+ aa-remove-unknown: fix readability check
66+77+ This check is intended for ensuring that the profiles file can actually
88+ be opened. The *actual* check is performed by the shell, not the read
99+ utility, which won't even be executed if the input redirection (and
1010+ hence the test) fails.
1111+1212+ If the test succeeds, though, using `read` here might actually
1313+ jeopardize the test result if there are no profiles loaded and the file
1414+ is empty.
1515+1616+ This commit fixes that case by simply using `true` instead of `read`.
1717+1818+diff --git a/utils/aa-remove-unknown b/utils/aa-remove-unknown
1919+index 0e00d6a0..3351feef 100755
2020+--- a/utils/aa-remove-unknown
2121++++ b/utils/aa-remove-unknown
2222+@@ -63,7 +63,7 @@ fi
2323+ # We have to do this check because error checking awk's getline() below is
2424+ # tricky and, as is, results in an infinite loop when apparmorfs returns an
2525+ # error from open().
2626+-if ! IFS= read -r _ < "$PROFILES" ; then
2727++if ! true < "$PROFILES" ; then
2828+ echo "ERROR: Unable to read apparmorfs profiles file" 1>&2
2929+ exit 1
3030+ elif [ ! -w "$REMOVE" ] ; then