Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#63636 - Unable to build projects with mono 6.0

Attached to Project: Arch Linux
Opened by Rokas Kupstys (rokups) - Tuesday, 03 September 2019, 08:26 GMT
Last edited by Levente Polyak (anthraxx) - Tuesday, 10 September 2019, 22:57 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Levente Polyak (anthraxx)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 2
Private No

Details

Attempt to build any C# project with msbuild results in an error about missing /usr/lib/mono/msbuild/15.0/bin/Roslyn/Microsoft.CSharp.Core.targets file.

Package version: mono 6.0.0.319-1

1. Create file foo.csproj with content:
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
</Project>
2. "msbuild foo.csproj" fails with:
Project "/tmp/foo.csproj" on node 1 (default targets).
/usr/lib/mono/msbuild/15.0/bin/Microsoft.CSharp.CurrentVersion.targets(331,5): error MSB4019: The imported project "/usr/lib/mono/msbuild/15.0/bin/Roslyn/Microsoft.CSharp.Core.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [/tmp/foo.csproj]
Done Building Project "/tmp/foo.csproj" (default targets) -- FAILED.

Workaround: sudo ln -s /usr/lib/mono/msbuild/Current/bin/Roslyn /usr/lib/mono/msbuild/15.0/bin/Roslyn
After applying workaround test project will fail with different error, but that is ok, because project is incomplete. Complete projects build fine.
This task depends upon

Comment by NotFood (notfood) - Friday, 06 September 2019, 03:39 GMT
Can confirm.

More details here: https://github.com/mono/mono/issues/14875
Comment by Levente Polyak (anthraxx) - Tuesday, 10 September 2019, 22:56 GMT
why not use ToolsVersion="Current" ?
If its expected to have a symlink from Current to tools version 15, please report this upstream. I think its a related but different issue as mono would be supposed to create that symlink during 'make install' which it currently doesn't do.
The upstream deb runtime seems to have such a symlink, but i can't see where its magically coming from, so an upstream report would be useful as a 'make install' is supposed to create that link if its required.
Comment by Alexandre Oliveira (Xinayder) - Sunday, 29 September 2019, 21:57 GMT
This is still happening and after I tried to reinstall a bunch of different msbuild versions, I couldn't build any .NET project because there's no /usr/lib/mono/msbuild/Current/bin/Roslyn folder.

EDIT: I tried manually compiling Mono 6.4.0, but it had the same problem. Tried both msbuild-16 and msbuild-15. Right now I'm downgrading Mono to try to compile .NET projects.
EDIT2: I got it to work by installing `msbuild` then reinstalling the `mono` package.
Comment by Florian Maunier (fmauNeko) - Thursday, 03 October 2019, 15:45 GMT
Said symlink is included in the msbuild AUR package.
The upstream debs also include those symlinks as part of the msbuild packaging (see https://github.com/mono/linux-packaging-msbuild/blob/master/debian/msbuild.links), that's why I'm including them in the msbuild AUR PKGBUILD.
Comment by Giancarlo Razzolini (grazzolini) - Thursday, 03 October 2019, 17:21 GMT
@anthraxx, debian builds from the tarball. As I've mentioned, it seems there are things on the tarball that are not installed by our git build. Like msbuild itself. The debian package has it.
Comment by Levente Polyak (anthraxx) - Thursday, 03 October 2019, 17:32 GMT
The right thing to do would be to investigate how we build msbuild from source, pulling in the binary isn't a good solution.
Comment by Florian Maunier (fmauNeko) - Thursday, 03 October 2019, 17:34 GMT
@grazzolini, actually msbuild is a separate debian package than mono itself. See https://download.mono-project.com/repo/debian/dists/stable-buster/main/binary-amd64/Packages
And as far as I know, Debian itself doesn't even have a MSBuild package.
Comment by Giancarlo Razzolini (grazzolini) - Thursday, 03 October 2019, 17:34 GMT
I agree. I have been poking at a msbuild build from source on and off for the past 3 weeks. But it seems that microsoft makes it deliberately hard to build from source.
Comment by Florian Maunier (fmauNeko) - Thursday, 03 October 2019, 17:36 GMT Comment by Giancarlo Razzolini (grazzolini) - Thursday, 03 October 2019, 17:37 GMT
@Florian

From what I saw, mono bunbles the binary msbuild on it's tarball and debian picks it up. I might be wrong though, I find reading debian package specs and making sense of them unnecessarily hard.
Comment by Florian Maunier (fmauNeko) - Thursday, 03 October 2019, 17:41 GMT
Actually when you build msbuild from source it gets another msbuild binary to bootstrap the process and build itself.
It probably does the same for mono itself but I don't know if it's bundled in the end.
Comment by Giancarlo Razzolini (grazzolini) - Thursday, 03 October 2019, 19:34 GMT
@Florian,

We are going to look into your msbuild AUR packages to try to bring it to the repos. It would also take care of  FS#61769 .
Comment by Myk (politas) - Sunday, 24 November 2019, 03:58 GMT
Using msbuild-16-bin seems to be the only way to get C# files compiling without manually creating the symlink.

Loading...