Bug 17951 - broken softlinks in mono/xbuild/12.0/bin
Summary: broken softlinks in mono/xbuild/12.0/bin
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Ms.Build ()
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-02-22 10:41 UTC by Matthias Mailänder
Modified: 2014-02-25 19:40 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Matthias Mailänder 2014-02-22 10:41:27 UTC
RPM consistency check fails for 3.2.8

ERROR: link target doesn't exist (neither in build root nor in installed system):
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.dll
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Engine.dll
/usr/lib/mono/xbuild/12.0/bin/Mono.XBuild.Tasks.dll
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Framework.dll
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Tasks.v12.0.dll
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Utilities.v12.0.dll

I am trying a workaround by removing those files.
Comment 1 Mikayla Hutchinson [MSFT] 2014-02-22 17:20:11 UTC
Those files are needed. Are you certain this is not a packaging issue - maybe the files they link to are not being packaged?
Comment 2 Matthias Mailänder 2014-02-23 03:28:35 UTC
[ 2963s] calling /usr/lib/rpm/brp-suse.d/brp-25-symlink
[ 3009s] ERROR: link target doesn't exist (neither in build root nor in installed system):
[ 3009s]   /usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Tasks.v12.0.dll -> /usr/lib/mono/xbuild/12.0/gac/Microsoft.Build.Tasks.v12.0/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Tasks.v12.0.dll
[ 3009s] Add the package providing the target to neededforbuild and Requires
[ 3009s] ERROR: link target doesn't exist (neither in build root nor in installed system):
[ 3009s]   /usr/lib/mono/xbuild/12.0/bin/Mono.XBuild.Tasks.dll -> /usr/lib/mono/xbuild/12.0/gac/Mono.XBuild.Tasks/4.0.0.0__0738eb9f132ed756/Mono.XBuild.Tasks.dll
[ 3009s] Add the package providing the target to neededforbuild and Requires
[ 3010s] ERROR: link target doesn't exist (neither in build root nor in installed system):
[ 3010s]   /usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Utilities.v12.0.dll -> /usr/lib/mono/xbuild/12.0/gac/Microsoft.Build.Utilities.v12.0/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Utilities.v12.0.dll
[ 3010s] Add the package providing the target to neededforbuild and Requires
[ 3010s] ERROR: link target doesn't exist (neither in build root nor in installed system):
[ 3010s]   /usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.dll -> /usr/lib/mono/xbuild/12.0/gac/Microsoft.Build/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.dll
[ 3010s] Add the package providing the target to neededforbuild and Requires
[ 3010s] ERROR: link target doesn't exist (neither in build root nor in installed system):
[ 3010s]   /usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Engine.dll -> /usr/lib/mono/xbuild/12.0/gac/Microsoft.Build.Engine/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Engine.dll
[ 3010s] Add the package providing the target to neededforbuild and Requires
[ 3010s] ERROR: link target doesn't exist (neither in build root nor in installed system):
[ 3010s]   /usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Framework.dll -> /usr/lib/mono/xbuild/12.0/gac/Microsoft.Build.Framework/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Framework.dll
[ 3010s] Add the package providing the target to neededforbuild and Requires
[ 3029s] error: Bad exit status from /var/tmp/rpm-tmp.7Ek5M4 (%install)
Comment 3 Matthias Mailänder 2014-02-23 03:29:48 UTC
Adding this to the .spec file fixes it

#ERROR: link target doesn't exist (neither in build root nor in installed system):
rm -rf %{buildroot}%{_prefix}/lib/mono/xbuild/12.0/bin/Microsoft.Build.dll
rm -rf %{buildroot}%{_prefix}/lib/mono/xbuild/12.0/bin/Microsoft.Build.Engine.dll
rm -rf %{buildroot}%{_prefix}/lib/mono/xbuild/12.0/bin/Mono.XBuild.Tasks.dll
rm -rf %{buildroot}%{_prefix}/lib/mono/xbuild/12.0/bin/Microsoft.Build.Framework.dll
rm -rf %{buildroot}%{_prefix}/lib/mono/xbuild/12.0/bin/Microsoft.Build.Tasks.v12.0.dll
rm -rf %{buildroot}%{_prefix}/lib/mono/xbuild/12.0/bin/Microsoft.Build.Utilities.v12.0.dll

I can also still compile with MonoDevelop and xbuild so I guess they are not so super needed. Maybe bit-rot in your Makefile?
Comment 4 Matthias Mailänder 2014-02-23 03:40:19 UTC
https://build.opensuse.org/request/show/223529
Comment 5 Mikayla Hutchinson [MSFT] 2014-02-23 14:05:46 UTC
Nope, without those files xbuild will be unable to compile projects created by VS2013 (ToolsVersion=12).

Looks like gacutil is messed up. Those links should be pointing to %{_prefix}/lib/mono/gac, not /usr/lib/mono/xbuild/12.0/gac.

Here's the gacutil invocation:
https://github.com/mono/mono/blob/master/mcs/build/library.make#L183

And here's what the xbuild 12 assemblies do different:
https://github.com/mono/mono/blob/master/mcs/tools/xbuild/xbuild.make#L21

Works fine on my Mac and I don't have a Linux machine ATM :/
Comment 6 Mikayla Hutchinson [MSFT] 2014-02-23 14:13:44 UTC
Looks like gacutil is creating bad symlinks.

[ 1092s] MONO_PATH="./../../class/lib/build:$MONO_PATH" /home/abuild/rpmbuild/BUILD/mono-3.2.8/runtime/mono-wrapper  ./../../class/lib/build/gacutil.exe /i ./../../class/lib/xbuild_12/Microsoft.Build.Utilities.v12.0.dll /f  /root /home/abuild/rpmbuild/BUILDROOT/mono-core-3.2.8-136.1.i386/usr/lib /package xbuild/12.0/bin
[ 1092s] Package exported to: /home/abuild/rpmbuild/BUILDROOT/mono-core-3.2.8-136.1.i386/usr/lib/mono/xbuild/12.0/bin/Microsoft.Build.Utilities.v12.0.dll -> ../gac/Microsoft.Build.Utilities.v12.0/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Utilities.v12.0.dll
[ 1092s] Installed ./../../class/lib/xbuild_12/Microsoft.Build.Utilities.v12.0.dll into the gac (/home/abuild/rpmbuild/BUILDROOT/mono-core-3.2.8-136.1.i386/usr/lib/mono/gac)
Comment 7 Mikayla Hutchinson [MSFT] 2014-02-25 19:40:36 UTC
Should be fixed by https://github.com/mono/mono/commit/0246bd17297841a1f92ab1675d8212e3eafcc656