Skip to content

dotnet/build-dotnet-module: fix eval of fetch-deps#341497

Merged
Aleksanaa merged 1 commit intoNixOS:masterfrom
trofi:dotnet/build-dotnet-module-fix-eval
Sep 13, 2024
Merged

dotnet/build-dotnet-module: fix eval of fetch-deps#341497
Aleksanaa merged 1 commit intoNixOS:masterfrom
trofi:dotnet/build-dotnet-module-fix-eval

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Sep 13, 2024

Without the change the eval fails as:

$ nix build --no-link -f. csharp-ls.fetch-deps --show-trace
error:
   … while evaluating a path segment
     at pkgs/build-support/dotnet/build-dotnet-module/default.nix:258:36:
      257|                   else
      258|                     ''$(mktemp -t "${finalAttrs.pname ? finalAttrs.finalPackage.name}-deps-XXXXXX.nix")'';
         |                                    ^
      259|                 nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; });

   error: cannot coerce a Boolean to a string: false

Switch from ? operator (attribute presence predicate) to an or ("else" form).

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Without the change the eval fails as:

    $ nix build --no-link -f. csharp-ls.fetch-deps --show-trace
    error:
       … while evaluating a path segment
         at pkgs/build-support/dotnet/build-dotnet-module/default.nix:258:36:
          257|                   else
          258|                     ''$(mktemp -t "${finalAttrs.pname ? finalAttrs.finalPackage.name}-deps-XXXXXX.nix")'';
             |                                    ^
          259|                 nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; });

       error: cannot coerce a Boolean to a string: false

Switch from `?` operator (attribute presence predicate) to an `or`
("else" form).
@trofi trofi requested a review from corngood as a code owner September 13, 2024 06:14
@github-actions github-actions bot added the 6.topic: dotnet Language: .NET label Sep 13, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Sep 13, 2024
@Aleksanaa Aleksanaa merged commit dfa0b59 into NixOS:master Sep 13, 2024
@trofi trofi deleted the dotnet/build-dotnet-module-fix-eval branch September 13, 2024 09:17
@corngood
Copy link
Contributor

I wonder if this should be using lib.getName? I'm just not sure if it would be better to do lib.getName finalAttrs.name or lib.getName finalAttrs.finalPackage. 🤔

@MattSturgeon
Copy link
Contributor

I wonder if this should be using lib.getName? I'm just not sure if it would be better to do lib.getName finalAttrs.name or lib.getName finalAttrs.finalPackage. 🤔

I had the same thought initially, but it looked like it was doing something custom?

@corngood
Copy link
Contributor

I had the same thought initially, but it looked like it was doing something custom?

Nah, I just wanted it to have the package name in there. Come to think of it, it probably should just use the package name (including version). I can't think of a reason it would be useful to leave out the version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: dotnet Language: .NET 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants