swift: update for cc-wrapper changes
The Swift compiler derivation modifies the clang wrapper to use
`exec -a "$0"` to allow it to use the same binary for both `clang` and
`clang++`. The sed script it uses to do this fails after the cc-wrapper
changes in 6f2b3ba027
were merged.
This is fixed by updating `makeClangWrapper` to work with the cc-wrapper
changes by having Bash invoke a simple script that uses `exec -a "$0"`
to set the required name for clang.
This fixes the staging-next build failures with Swift on Darwin and Linux.
https://github.com/NixOS/nixpkgs/pull/248496#issuecomment-1676831102
This commit is contained in:
parent
f6a4c6f912
commit
e7cf9a7c45
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
, stdenv
|
||||
, callPackage
|
||||
, cmake
|
||||
, bash
|
||||
, coreutils
|
||||
, gnugrep
|
||||
, perl
|
||||
|
@ -133,7 +134,8 @@ let
|
|||
sed < '${clang}/bin/clang' > "$targetFile" \
|
||||
-e 's|^\s*exec|exec -a "$0"|g' \
|
||||
-e 's|^\[\[ "${clang.cc}/bin/clang" = \*++ ]]|[[ "$0" = *++ ]]|' \
|
||||
-e "s|${clang.cc}/bin/clang|$unwrappedClang|g"
|
||||
-e "s|${clang.cc}/bin/clang|$unwrappedClang|g" \
|
||||
-e "s|^\(\s*\)\($unwrappedClang\) \"@\\\$responseFile\"|\1argv0=\$0\n\1${bash}/bin/bash -c \"exec -a '\$argv0' \2 '@\$responseFile'\"|"
|
||||
chmod a+x "$targetFile"
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in a new issue