-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msbuild: init at 15.8 #50842
msbuild: init at 15.8 #50842
Conversation
Wait, I accidentally reverted the update. |
Does it impossible to build it from source? |
It uses a custom build process which automatically downloads pre-compiled Mono binaries. |
I bit back I was looking at your original pr and applied some of @samueldr feedback. diff --git a/pkgs/development/tools/build-managers/msbuild/default.nix b/pkgs/development/tools/build-managers/msbuild/default.nix
index 781f5b1c524..93d19fb047c 100644
--- a/pkgs/development/tools/build-managers/msbuild/default.nix
+++ b/pkgs/development/tools/build-managers/msbuild/default.nix
@@ -14,15 +14,21 @@ stdenv.mkDerivation rec {
dontConfigure = true;
dontBuild = true;
- unpackPhase = "dpkg-deb -x $src .";
- installPhase = ''
- substituteInPlace usr/bin/msbuild --replace /usr/bin/mono ${mono}/bin/mono --replace /usr/lib/mono/msbuild/15.0/bin/MSBuild.dll '$(dirname $0)/../usr/lib/mono/msbuild/15.0/bin/MSBuild.dll'
+ unpackPhase = "dpkg-deb -x $src build";
+ installPhase = "
+ (
+ cd build
mv usr/bin .
- mkdir -p $out
- cp -r ./bin ./usr $out
- cp -rs ${mono}/lib/mono/msbuild/15.0/bin/Roslyn $out/usr/lib/mono/msbuild/15.0/bin/Roslyn
- cp -rs ${mono}/lib/mono/4.5 $out/usr/lib/mono/4.5
- '';
+ mv usr/lib .
+ rm -rf usr
+ )
+ cp -r build/ $out
+
+ substituteInPlace $out/bin/msbuild --replace /usr/bin/mono ${mono}/bin/mono --replace /usr/lib/mono/msbuild/15.0/bin/MSBuild.dll $out/lib/mono/msbuild/15.0/bin/MSBuild.dll
+
+ ln -s ${mono}/lib/mono/msbuild/15.0/bin/Roslyn $out/lib/mono/msbuild/15.0/bin/Roslyn
+ ln -s ${mono}/lib/mono/4.5 $out/lib/mono/4.5
+ ";
meta = with stdenv.lib; {
description = "The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio";
Main things addressed if I recall correctly were:
Also didn't include anything from |
@@ -76,6 +76,10 @@ stdenv.mkDerivation rec { | |||
# [1] https://github.com/mono/mono/blob/master/scripts/gmcs.in | |||
+ '' | |||
ln -s $out/bin/mcs $out/bin/gmcs | |||
'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the previous pr:
Update on this: I cannot recall, but I believe (knowing me probably not) the upstream Mono maintainers told me to apply this. I completely forgot about this until yesterday, though, you might have to check.
I think we'd need a definitive answer on whether this is needed to merge this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a good build machine. Could you see if it still runs without it?
Nice GitHub bug 😛 I'll create a new PR again, I guess. |
I was actually able to reproduce what @jdanekrh mentioned in the older pr without this change.
It went away when I applied it IIRC. |
@leo60228 Have you opened your new PR already? If not, can you link to |
😕 I am a bit confused, what is the state of msbuild? I can't find anything in master. |
I'm not sure, @leo60228 do you still have the expression? It would improve the situation for getting source builds for applications that need msbuild dramatically, because we'd actually have it. |
I still have it, but I don't have time for it. I'll try and push it later. |
@leo60228 any progress or any chance of sharing that expressions so someone else can pick it up. |
@leo60228 I would love to get msbuild in too. That way I can use NixOS for work projects. |
@billksun Just BTW, there is MSBuild 16 available in dotnet core. I have it at |
(recreation of #43680 because I broke my repo)
Motivation for this change
xbuild, which is part of Mono, is deprecated, in favor of the recently open-source MSBuild used on Windows. MSBuild has an incredibly complicated build system, which appears to fail silently on non-FHS systems. Thus, I used the official Ubuntu binaries. These require relatively little patching, as .NET is a bytecode language, so patchelf is not necessary. I don't have a Mac to test, but it may work on MacOS as well for this reason. This is definitely a stopgap; however, MSBuild's custom build system will require extensive work to be used, or even emulated, on NixOS. Since #43680, I've updated it to 15.8, cleaned up the build script, and shrunk the package by about 100MB.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)