this derivation will be built: /nix/store/h92ivlvj6zn7ajscr4ahjrqkyqkvfj98-treefmt-check.drv building '/nix/store/h92ivlvj6zn7ajscr4ahjrqkyqkvfj98-treefmt-check.drv' treefmt-check> tribuchet: building on eliza treefmt-check> treefmt v2.5.0traversed 56 files treefmt-check> emitted 40 files for processing treefmt-check> formatted 40 files (1 changed) in 104ms treefmt-check> M shells.nix treefmt-check> diff --git a/shells.nix b/shells.nix treefmt-check> index 927bea8..d976ca8 100644 treefmt-check> --- a/shells.nix treefmt-check> +++ b/shells.nix treefmt-check> @@ -57,89 +57,111 @@ treefmt-check> toolchains = treefmt-check> let treefmt-check> # C/C++ via a stdenv's $CC/$CXX. treefmt-check> - mkC = s: "${s.mkDerivation { treefmt-check> - name = "fixture"; treefmt-check> - dontUnpack = true; treefmt-check> - buildPhase = "$CC ${./tests/sample.c} -o hello"; treefmt-check> - installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> - }}/bin/hello"; treefmt-check> - mkCxx = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-cxx"; treefmt-check> - dontUnpack = true; treefmt-check> - buildPhase = "$CXX ${./tests/sample.cpp} -o hello"; treefmt-check> - installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> - }}/bin/hello"; treefmt-check> - mkRust = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-rust"; treefmt-check> - dontUnpack = true; treefmt-check> - nativeBuildInputs = [ rustc ]; treefmt-check> - buildPhase = "rustc -O ${./tests/sample.rs} -o hello"; treefmt-check> - installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> - }}/bin/hello"; treefmt-check> + mkC = treefmt-check> + s: treefmt-check> + "${ treefmt-check> + s.mkDerivation { treefmt-check> + name = "fixture"; treefmt-check> + dontUnpack = true; treefmt-check> + buildPhase = "$CC ${./tests/sample.c} -o hello"; treefmt-check> + installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> + } treefmt-check> + }/bin/hello"; treefmt-check> + mkCxx = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-cxx"; treefmt-check> + dontUnpack = true; treefmt-check> + buildPhase = "$CXX ${./tests/sample.cpp} -o hello"; treefmt-check> + installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> + } treefmt-check> + }/bin/hello"; treefmt-check> + mkRust = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-rust"; treefmt-check> + dontUnpack = true; treefmt-check> + nativeBuildInputs = [ rustc ]; treefmt-check> + buildPhase = "rustc -O ${./tests/sample.rs} -o hello"; treefmt-check> + installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> + } treefmt-check> + }/bin/hello"; treefmt-check> # cgo forces external linking, so the output is dynamic. treefmt-check> - mkGo = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-go"; treefmt-check> - dontUnpack = true; treefmt-check> - nativeBuildInputs = [ go ]; treefmt-check> - buildPhase = '' treefmt-check> - export HOME=$TMPDIR GOCACHE=$TMPDIR/gc GO111MODULE=off CGO_ENABLED=1 treefmt-check> - cp ${./tests/sample.go} main.go treefmt-check> - go build -o hello main.go treefmt-check> - ''; treefmt-check> - installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> - }}/bin/hello"; treefmt-check> + mkGo = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-go"; treefmt-check> + dontUnpack = true; treefmt-check> + nativeBuildInputs = [ go ]; treefmt-check> + buildPhase = '' treefmt-check> + export HOME=$TMPDIR GOCACHE=$TMPDIR/gc GO111MODULE=off CGO_ENABLED=1 treefmt-check> + cp ${./tests/sample.go} main.go treefmt-check> + go build -o hello main.go treefmt-check> + ''; treefmt-check> + installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> + } treefmt-check> + }/bin/hello"; treefmt-check> # Shared objects: no PT_INTERP, but DT_SONAME, exported dynsym and (C++ treefmt-check> # via the version script) GNU symbol versions. treefmt-check> - mkRustSo = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-rust-cdylib"; treefmt-check> - dontUnpack = true; treefmt-check> - nativeBuildInputs = [ rustc ]; treefmt-check> - buildPhase = "rustc -O --crate-type=cdylib ${./tests/sample_cdylib.rs} -o libfixture.so"; treefmt-check> - installPhase = "install -Dm755 libfixture.so $out/lib/libfixture.so"; treefmt-check> - }}/lib/libfixture.so"; treefmt-check> - mkCxxSo = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-cxx-so"; treefmt-check> - dontUnpack = true; treefmt-check> - buildPhase = "$CXX -shared -fPIC ${./tests/sample_lib.cpp} -Wl,--version-script=${./tests/sample.map} -Wl,-soname,libfixturecxx.so.1 -o libfixturecxx.so.1"; treefmt-check> - installPhase = "install -Dm755 libfixturecxx.so.1 $out/lib/libfixturecxx.so.1"; treefmt-check> - }}/lib/libfixturecxx.so.1"; treefmt-check> - mkGoSo = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-go-cshared"; treefmt-check> - dontUnpack = true; treefmt-check> - nativeBuildInputs = [ go ]; treefmt-check> - buildPhase = '' treefmt-check> - export HOME=$TMPDIR GOCACHE=$TMPDIR/gc GO111MODULE=off CGO_ENABLED=1 treefmt-check> - cp ${./tests/sample_cshared.go} main.go treefmt-check> - go build -buildmode=c-shared -o libfixture.so main.go treefmt-check> - ''; treefmt-check> - installPhase = "install -Dm755 libfixture.so $out/lib/libfixture.so"; treefmt-check> - }}/lib/libfixture.so"; treefmt-check> + mkRustSo = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-rust-cdylib"; treefmt-check> + dontUnpack = true; treefmt-check> + nativeBuildInputs = [ rustc ]; treefmt-check> + buildPhase = "rustc -O --crate-type=cdylib ${./tests/sample_cdylib.rs} -o libfixture.so"; treefmt-check> + installPhase = "install -Dm755 libfixture.so $out/lib/libfixture.so"; treefmt-check> + } treefmt-check> + }/lib/libfixture.so"; treefmt-check> + mkCxxSo = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-cxx-so"; treefmt-check> + dontUnpack = true; treefmt-check> + buildPhase = "$CXX -shared -fPIC ${./tests/sample_lib.cpp} -Wl,--version-script=${./tests/sample.map} -Wl,-soname,libfixturecxx.so.1 -o libfixturecxx.so.1"; treefmt-check> + installPhase = "install -Dm755 libfixturecxx.so.1 $out/lib/libfixturecxx.so.1"; treefmt-check> + } treefmt-check> + }/lib/libfixturecxx.so.1"; treefmt-check> + mkGoSo = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-go-cshared"; treefmt-check> + dontUnpack = true; treefmt-check> + nativeBuildInputs = [ go ]; treefmt-check> + buildPhase = '' treefmt-check> + export HOME=$TMPDIR GOCACHE=$TMPDIR/gc GO111MODULE=off CGO_ENABLED=1 treefmt-check> + cp ${./tests/sample_cshared.go} main.go treefmt-check> + go build -buildmode=c-shared -o libfixture.so main.go treefmt-check> + ''; treefmt-check> + installPhase = "install -Dm755 libfixture.so $out/lib/libfixture.so"; treefmt-check> + } treefmt-check> + }/lib/libfixture.so"; treefmt-check> # Transformation states no compiler flag alone produces: treefmt-check> # sstrip drops the section header table entirely, so patchelf must work treefmt-check> # from program headers alone; pack-relative-relocs emits DT_RELR; treefmt-check> # -fcf-protection adds .note.gnu.property and a PT_GNU_PROPERTY segment. treefmt-check> - mkStripped = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-stripped"; treefmt-check> - dontUnpack = true; treefmt-check> - nativeBuildInputs = [ elfkickers ]; treefmt-check> - buildPhase = '' treefmt-check> - $CC ${./tests/sample.c} -o hello treefmt-check> - sstrip hello treefmt-check> - ''; treefmt-check> - installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> - }}/bin/hello"; treefmt-check> - mkRelr = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-relr"; treefmt-check> - dontUnpack = true; treefmt-check> - buildPhase = "$CC -O2 -fPIE -pie -Wl,-z,pack-relative-relocs ${./tests/sample_relr.c} -o hello"; treefmt-check> - installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> - }}/bin/hello"; treefmt-check> - mkGnuProperty = "${stdenv.mkDerivation { treefmt-check> - name = "fixture-gnu-property"; treefmt-check> - dontUnpack = true; treefmt-check> - buildPhase = "$CC -fcf-protection=full ${./tests/sample.c} -o hello"; treefmt-check> - installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> - }}/bin/hello"; treefmt-check> + mkStripped = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-stripped"; treefmt-check> + dontUnpack = true; treefmt-check> + nativeBuildInputs = [ elfkickers ]; treefmt-check> + buildPhase = '' treefmt-check> + $CC ${./tests/sample.c} -o hello treefmt-check> + sstrip hello treefmt-check> + ''; treefmt-check> + installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> + } treefmt-check> + }/bin/hello"; treefmt-check> + mkRelr = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-relr"; treefmt-check> + dontUnpack = true; treefmt-check> + buildPhase = "$CC -O2 -fPIE -pie -Wl,-z,pack-relative-relocs ${./tests/sample_relr.c} -o hello"; treefmt-check> + installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> + } treefmt-check> + }/bin/hello"; treefmt-check> + mkGnuProperty = "${ treefmt-check> + stdenv.mkDerivation { treefmt-check> + name = "fixture-gnu-property"; treefmt-check> + dontUnpack = true; treefmt-check> + buildPhase = "$CC -fcf-protection=full ${./tests/sample.c} -o hello"; treefmt-check> + installPhase = "install -Dm755 hello $out/bin/hello"; treefmt-check> + } treefmt-check> + }/bin/hello"; treefmt-check> in treefmt-check> mkShell { treefmt-check> packages = [ error: Cannot build '/nix/store/h92ivlvj6zn7ajscr4ahjrqkyqkvfj98-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/6mkz05695p8pk89nfi00shr3c4858q31-treefmt-check Last 25 log lines: > + $CC ${./tests/sample.c} -o hello > + sstrip hello > + ''; > + installPhase = "install -Dm755 hello $out/bin/hello"; > + } > + }/bin/hello"; > + mkRelr = "${ > + stdenv.mkDerivation { > + name = "fixture-relr"; > + dontUnpack = true; > + buildPhase = "$CC -O2 -fPIE -pie -Wl,-z,pack-relative-relocs ${./tests/sample_relr.c} -o hello"; > + installPhase = "install -Dm755 hello $out/bin/hello"; > + } > + }/bin/hello"; > + mkGnuProperty = "${ > + stdenv.mkDerivation { > + name = "fixture-gnu-property"; > + dontUnpack = true; > + buildPhase = "$CC -fcf-protection=full ${./tests/sample.c} -o hello"; > + installPhase = "install -Dm755 hello $out/bin/hello"; > + } > + }/bin/hello"; > in > mkShell { > packages = [ For full logs, run: nix log /nix/store/h92ivlvj6zn7ajscr4ahjrqkyqkvfj98-treefmt-check.drv