cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
4.04k stars 303 forks source link

dotnet language does not include msbuild binary #609

Open mrfelton opened 1 year ago

mrfelton commented 1 year ago

Describe the bug

msbuild doesn't get installed with languages.dotnet.enable = true.

It also doesn't get installed if you install pkgs.dotnet-sdk from packages array.

And attempting to install it by adding pkgs.msbuild to packages array results in the following error:

       error: Package ‘roslyn-4.2.0’ in «github:NixOS/nixpkgs/9f7d9a55cc9960c029b006444e64e8dfa54a578e»/pkgs/development/compilers/roslyn/default.nix:62 is not available on the requested hostPlatform:
         hostPlatform.config = "aarch64-apple-darwin"
         package.meta.platforms = [
           "aarch64-linux"
           "x86_64-linux"
         ]
         package.meta.badPlatforms = [ ]
       , refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

        Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.

Version

devenv: 0.6.2

sandydoo commented 1 year ago

To clarify, are you suggesting for msbuild to be added to the dotnet environment by default or is this about msbuild failing to build on macos?

And attempting to install it by adding pkgs.msbuild to packages array results in the following error:

I tried the suggested export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1; devenv shell. roslyn was successfully built, so perhaps the platform requirement in nixpkgs is overly strict.

However, msbuild then fails to build with:

CSC : warning CS2008: No source files specified. [/private/tmp/nix-build-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00.drv-0/msbuild-16.10.1/mono/build/sdks_and_nugets/nuget-build-tasks/nuget-build-tasks.csproj]
  nuget-build-tasks -> /private/tmp/nix-build-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00.drv-0/msbuild-16.10.1/artifacts/bin/nuget-build-tasks/Debug/net472/nuget-build-tasks.dll
  Downloading 'https://dot.net/v1/dotnet-install.sh'
  /private/tmp/nix-build-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00.drv-0/msbuild-16.10.1/mono/build/sdks_and_nugets//../extract_and_copy_hostfxr.sh: line 32: wget: command not found
/private/tmp/nix-build-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00.drv-0/msbuild-16.10.1/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj(65,9): error MSB3073: The command "/private/tmp/nix-build-msbuild>

Build FAILED.

/private/tmp/nix-build-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00.drv-0/msbuild-16.10.1/mono/build/sdks_and_nugets/nuget-build-tasks/nuget-build-tasks.csproj : warning MSB4242: The SDK resolver "Microsoft.Dot>
/private/tmp/nix-build-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00.drv-0/msbuild-16.10.1/artifacts/mono-msbuild/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ILLink.targets(14,3): warning MSB4242: The SDK resol>
CSC : warning CS2008: No source files specified. [/private/tmp/nix-build-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00.drv-0/msbuild-16.10.1/mono/build/sdks_and_nugets/nuget-build-tasks/nuget-build-tasks.csproj]
/private/tmp/nix-build-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00.drv-0/msbuild-16.10.1/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj(65,9): error MSB3073: The command "/private/tmp/nix-build-msbuild>
    3 Warning(s)
    1 Error(s)

It looks like a lot of these dotnet packages aren't being built or tested on macos in nixpkgs. It might be worth opening an upstream issue.

mrfelton commented 1 year ago

Both - I do think msbuild should be bundled with the dotnet language package. But also flagging that it doesn’t look to be buildable on Mac OS

mrfelton commented 1 year ago

Raised this upstream https://github.com/NixOS/nixpkgs/issues/233570