Skip to content

Commit

Permalink
swift: Fix eval failure error: expected a string but found null: null
Browse files Browse the repository at this point in the history
Dunno if this is correct, there's other `hostPlatform.isDarwin`
conditionals which may be wrong.

Leaving the other conditionals to swift maintainers or people who are
interested in swift cross-compilation

```
$ nix repl --file . --system aarch64-darwin
nix-repl> pkgsCross.aarch64-multiplatform.swift
«derivation /nix/store/kqbaqwdfc9g0yvkq4ffrlqspranprlmy-swift-wrapper-aarch64-unknown-linux-gnu-5.8.drv»

nix-repl> pkgsCross.aarch64-multiplatform.buildPackages.swift
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'swift-wrapper-5.8'
         whose name attribute is located at /home/artturin/nixgits/my-nixpkgs/.worktree/2/pkgs/stdenv/generic/make-derivation.nix:336:7

       … while evaluating attribute 'buildCommand' of derivation 'swift-wrapper-5.8'
         at /home/artturin/nixgits/my-nixpkgs/.worktree/2/pkgs/development/compilers/swift/wrapper/default.nix:26:3:
           25|   passAsFile = [ "buildCommand" ];
           26|   buildCommand = ''
             |   ^
           27|     mkdir -p $out/bin $out/nix-support

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a string but found null: null
       at /home/artturin/nixgits/my-nixpkgs/.worktree/2/pkgs/development/compilers/swift/compiler/default.nix:586:11:
          585|         #WATCHOS_SIMULATOR
          586|       }.${targetPlatform.darwinPlatform}}
             |           ^
          587|
```
  • Loading branch information
Artturin committed Dec 10, 2024
1 parent d3f8cad commit 1c386fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/development/compilers/swift/compiler/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ in stdenv.mkDerivation {
";
buildProject lldb llvm-project/lldb
${lib.optionalString stdenv.hostPlatform.isDarwin ''
${lib.optionalString stdenv.targetPlatform.isDarwin ''
# Need to do a standalone build of concurrency for Darwin back deployment.
# Based on: utils/swift_build_support/swift_build_support/products/backdeployconcurrency.py
cmakeFlags="
Expand Down

0 comments on commit 1c386fd

Please sign in to comment.