Guard the substituteInPlace that strips -mtls-dialect=gnu2 with
lib.optionalString so it only runs when the flag could actually
be present:
targetPlatform.isLinux && targetPlatform.isx86
&& lib.versionAtLeast (lib.getVersion clang) "19.1"
This matches the condition the cc-wrapper uses when adding the
flag, preventing breakage on Darwin and aarch64-linux where the
option does not exist in the wrapper scripts.
Assisted-by: OpenClaw (friendli/zai-org/GLM-5.2)
This is not necessary (stdenv uses either buildCommand or buildCommandPath,
depending on what's available), but it is confusing since it's not explicitly
used and would not work if structuredAttrs is enabled.
libc++ only supports a limited range of Clang versions, so this was
relying on the LLVM version corresponding to the one used in Swift’s
fork. Since Swift builds its own LLVM 15 anyway, we can simply install
the required libc++ headers along with it.
Swift needs Clang to link with. The linker patch breaks linking
when using Swift with a GCC‐based standard environment.
Similarly, the internal Clang headers in the resource directory are
coupled to the corresponding version of Clang. The resource root patch
caused Swift’s Clang to use the resource directory from the version
of Clang used in the build environment, which is only compatible if
the versions match.
Instead, hard‐code the Clang path in the patches and wrappers.
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev b32a094368
result/bin/apply-formatting $NIXPKGS_PATH