nixpkgs/pkgs/development/compilers
Adam Joseph 53b6e1a3c5 rustc: fix >=1.68 host!=build
Our `rustc.nix` adds a `--target` flag for the host when doing a
host!=target build, but neglects to add a `--target` flag for the
buildPlatform when doing a build!=(host==target) build.  This commit
corrects that.

Before rustc 1.68 omitting the --target flag for the buildPlatform
did not cause any problems.  As of rustc 1.68, build!=host without a
--target for the build will fail like below (with hundreds more
"cannot find std::" errors.

```
$ nix build -f . -L pkgsCross.aarch64-multiplatform.rustc
...
Copying stage1 library from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / aarch64-unknown-linux-gnu)
Uplifting stage1 library (x86_64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
Copying stage2 library from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / aarch64-unknown-linux-gnu)
Building stage2 tool rust-analyzer-proc-macro-srv (aarch64-unknown-linux-gnu)
   Compiling autocfg v1.1.0
   Compiling libc v0.2.135
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.47
   Compiling quote v1.0.21
   Compiling unicode-ident v1.0.5
   Compiling syn v1.0.102
   Compiling once_cell v1.15.0
   Compiling parking_lot_core v0.9.4
   Compiling serde_derive v1.0.145
   Compiling hashbrown v0.12.3
   Compiling scopeguard v1.1.0
   Compiling smallvec v1.10.0
   Compiling log v0.4.17
   Compiling serde v1.0.145
   Compiling rustc-hash v1.1.0
error[E0463]: can't find crate for `std`
error: cannot find macro `println` in this scope
 --> /nix/tmp/nix-build-rustc-aarch64-unknown-linux-gnu-1.68.2.drv-0/rustc-1.68.2-src/vendor/libc-0.2.135/build.rs:7:5
  |
7 |     println!("cargo:rerun-if-changed=build.rs");
  |     ^^^^^^^
error: cannot find macro `println` in this scope
  --> /nix/tmp/nix-build-rustc-aarch64-unknown-linux-gnu-1.68.2.drv-0/rustc-1.68.2-src/vendor/libc-0.2.135/build.rs:16:9
   |
16 |         println!(
   |         ^^^^^^^
error: cannot find macro `println` in this scope
  --> /nix/tmp/nix-build-rustc-aarch64-unknown-linux-gnu-1.68.2.drv-0/rustc-1.68.2-src/vendor/libc-0.2.135/build.rs:29:13
   |
29 |             println!("cargo:rustc-cfg=freebsd10")
   |             ^^^^^^^
```
2023-04-18 14:10:40 +10:00
..
4th
abcl abcl: follow up fixes for #223317 2023-04-07 21:03:21 -03:00
acme
adoptopenjdk-bin
adoptopenjdk-icedtea-web
alan
algol68g
ante
apache-flex-sdk
arachne-pnr
armips
as31
asl
asn1c
aspectj
atasm
ats
ats2
avra
ballerina
bigloo
binaryen
blueprint
bluespec
bs-platform
bupc
c3c
cakelisp
carp
cc65
ccl lisp-modules: set maintainers to the lisp team 2023-04-05 20:52:27 +02:00
chez
chez-racket
chicken chickenPackages: reduce brokenOnDarwin 2023-04-12 15:35:37 +03:00
ciao
circt circt: 1.34.0 -> 1.37.0 2023-04-17 09:36:39 +08:00
clasp lisp-modules: set maintainers to the lisp team 2023-04-05 20:52:27 +02:00
clean
closure
cmdstan
cmucl lisp-modules: set maintainers to the lisp team 2023-04-05 20:52:27 +02:00
codon codon: init at 0.15.5 2023-04-13 11:02:00 +03:00
colm
computecpp
cone
copper
crystal crystal: 1.7.2 -> 1.7.3 2023-04-10 12:19:08 +08:00
crystal2nix
cudatoolkit cudaPackages.backendStdenv: cc and libstdc++ as arguments; expose libstdc++ 2023-04-13 01:45:49 +03:00
dale
dart
dasm
dev86
dictu
dmd
dotnet Merge pull request #225833 from JamieMagee/dotnet-8.0 2023-04-12 10:54:49 +02:00
dtc
ecl lisp-modules: set maintainers to the lisp team 2023-04-05 20:52:27 +02:00
edk2
eli
elm elmPackages.elm-format: 0.8.6 -> 0.8.7 2023-04-11 16:29:27 -07:00
emscripten
eql
factor-lang
fasm
fasmg
fbc
firrtl
flasm
flutter tree-wide: buildFHSUserEnv -> buildFHSEnv 2023-04-16 10:15:13 +02:00
flux
fpc
fsharp
fstar
gambit
gavrasm
gbforth
gcc gnatboot: rename to gnat-bootstrap 2023-04-15 18:52:14 -04:00
gcc-arm-embedded gcc-arm-embedded: add myself to maintainers 2023-04-05 14:27:26 +02:00
gcl lisp-modules: set maintainers to the lisp team 2023-04-05 20:52:27 +02:00
gerbil
gforth
ghc haskell.compiler.ghcHEAD: 9.7.20230217 -> 9.7.20230406 2023-04-06 19:00:21 +02:00
ghcjs
ghdl
gleam gleam: 0.27.0 -> 0.28.2 2023-04-16 12:36:02 -04:00
glslang
gmqcc
gnat-bootstrap gnatboot: rename to gnat-bootstrap 2023-04-15 18:52:14 -04:00
gnostic
gnu-cim
gnu-cobol
gnu-smalltalk
go Merge staging-next into staging 2023-04-05 06:01:50 +00:00
go-jsonnet go-jsonnet: 0.19.1 -> 0.20.0 2023-04-18 02:05:19 +00:00
gprolog
graalvm/community-edition
gwt
halide
hare harePackages.hare: remove patch 2023-04-07 21:56:53 -03:00
haxe
heptagon
hip
hip-common
hipcc
hipify
hop
hvm
idris2
inform6
inform7
inklecate
intel-graphics-compiler
intercal
ios-cross-compile
ispc
jasmin
jasmin-compiler jasmin-compiler: 2022.09.0 → 2022.09.2 2023-04-17 07:11:46 +02:00
javacard-devkit
jetbrains-jdk
jrsonnet
jsonnet
julia
juniper
jwasm jwasm: 2.16 -> 2.17 2023-04-11 15:07:42 -03:00
kaitai-struct-compiler
kind2
koka
kotlin kotlin{-native}: 1.8.10 → 1.8.20 2023-04-09 17:13:50 +05:30
ldc
lesscpy
ligo
lingua-franca
llvm llvmPackages_git: unstable-2022-26-07 → 15.0.7 2023-04-17 20:10:41 +00:00
lobster
manticore
marst
matter-compiler
mcpp
mercury
meta-environment/meta-build-env
mezzo
microscheme
minimacy
mint
miranda
mit-scheme
mkcl lisp-modules: set maintainers to the lisp team 2023-04-05 20:52:27 +02:00
mlkit
mlton
mono
mosml
mozart
mruby
mrustc
muonlang
myrddin
nasm
neko
nextpnr
nim nim: propagate Security framework to all nim packages on darwin 2023-04-14 16:04:31 +00:00
nqc
nvidia-cg-toolkit
obliv-c
ocaml
odin
open-watcom
opendylan
openjdk openjdk: explicitly specify build platform to avoid WSL autodetection shenanigans 2023-04-15 16:24:07 +03:00
openspin
ophis
oraclejdk
orc
osl
owl-lisp
p4c
paco
pakcs
passerine
pforth
picat
polyml
ponyc
purescript
qbe
rasm
reason
rgbds
rml
roslyn
rust rustc: fix >=1.68 host!=build 2023-04-18 14:10:40 +10:00
sagittarius-scheme
sbcl sbcl: remove old versions, leave 2.1.9 for CLPM 2023-04-10 15:09:34 -04:00
scala
scala-runners
scryer-prolog
sdcc
seexpr
semeru-bin
serpent
shaderc
silice
sjasmplus
smlnj
solc
souffle
spasm-ng
spirv-llvm-translator
squeak
stalin
stanc
swi-prolog
swift
temurin-bin javaPackages: cleanup unused code 2023-04-14 22:23:39 -03:00
terra
teyjus
tinycc
tinygo
tvm
uasm
unison
urn
urweb
vala vala_0_56: 0.56.4 → 0.56.6 2023-04-06 01:44:41 +02:00
vlang
vyper
wcc
wla-dx
x11basic
xa
yap
yasm
yosys yosys/plugins/ghdl.nix: fix build 2023-04-16 17:47:18 -07:00
z88dk
zasm
zig
zulu
zz