Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Can't build with mono 5.18 / msbuild 15.3 (also fails without msbuild) #889

Closed
cnd opened this issue Jan 10, 2019 · 19 comments
Closed

Can't build with mono 5.18 / msbuild 15.3 (also fails without msbuild) #889

cnd opened this issue Jan 10, 2019 · 19 comments

Comments

@cnd
Copy link
Contributor

cnd commented Jan 10, 2019

tried version 10.2.1

Microsoft.FSharp.Targets(129,9): error MSB4127: The "CreateFSharpManifestResourceName" task could not be instantiated from the assembly "/var/tmp/portage/dev-lang/fsharp-10.2.1/work/fsharp-10.2.1/packages/FSharp.Compiler.Tools.4.1.27/tools/FSharp.Build.dll". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. Specified cast is not valid. [/var/tmp/portage/dev-lang/fsharp-10.2.1/work/fsharp-10.2.1/src/fsharp/FSharp.Core/FSharp.Core.fsproj]

blocking packaging on gentoo, and instructions (https://github.com/fsharp/fsfoundation/edit/gh-pages/use/linux/index.md) on building from sources on Linux are not working for me, mono package doesn't bring msbuild, there is xbuild.

cnd added a commit to cnd/fsfoundation that referenced this issue Jan 10, 2019
@cartermp
Copy link
Member

Hmm, Mono has deprecated xbuild as of Mono 5, so the package being pointed to in the docs seems incorrect

@cnd
Copy link
Contributor Author

cnd commented Jan 12, 2019

@cartermp I didn't know about that... if I install just mono there is no msbuild executable (but still xbuild?), I'm not sure, I will check that on next week...

@ninjarobot
Copy link
Member

@cnd I'm not sure about Gentoo, but the Debian and Ubuntu packaging installs the msbuild package these days, so if users install mono-complete or mono-devel, they will end up with msbuild installed. Which mono package did you use to install mono?

@cnd
Copy link
Contributor Author

cnd commented Jan 13, 2019

@cnd
Copy link
Contributor Author

cnd commented Jan 16, 2019

@cartermp @ninjarobot I've re-checked, my mono package has xbuild executable but no msbuild
There is whole files list for mono package: https://paste.pound-python.org/show/5fznysuy2GXOO9VVzqho
It's Mono JIT compiler version 5.18.0.225 (tarball Wed Jan 9 19:01:02 +04 2019)

@knocte
Copy link
Contributor

knocte commented Jan 16, 2019

@cnd what @ninjarobot told you is to install mono-complete or mono-devel not mono alone. mono cannot contain msbuild, but the other metapackages may include it.

@cnd
Copy link
Contributor Author

cnd commented Jan 16, 2019

@knocte but I have no idea what is mono-complete or mono-devel I do package mono project which I get from here: https://download.mono-project.com/sources/mono
Please rewrite your instructions in case if you plan only support Ubuntu or Debian
(currently I can't find any information about getting mono with msbuild from sources)

@ninjarobot
Copy link
Member

@cnd there isn't any intention to dissuade you from using your favorite distro, just that building the F# compiler on Linux depends on the mono distribution and the maintainers publish official packages for Debian and derivatives. I expect Gentoo will work as well, but building the compiler depends on msbuild these days.

I was able to find an overlay for msbuild, albeit for some older mono versions. It would probably be best to get to this msbuild:

Microsoft (R) Build Engine version 15.6.0.0 (xplat-master/ca830585 Sun Mar 25 19:24:09 EDT 2018)

I personally don't have Gentoo packaging experience, but are you able to make adjustments such that the additional package for msbuild can be added to the Gentoo overlays? Hopefully @knocte or others on the mono side can help work through any issues getting through any errors with the build of msbuild itself, feel free to post them here.

@cnd
Copy link
Contributor Author

cnd commented Jan 16, 2019

yes, ebuild (package) for msbuild contributed to overlay by user @ArsenShnurkov and it's not fully supported
it's currently using commit from https://github.com/mono/linux-packaging-msbuild and not some tag version (honestly it could be great if there will be distribution-neutral versions on that repository)
so far it looks like separated project and I'm not sure if we (gentoo) should package it with mono as some option (USE flag)
instructions on https://github.com/fsharp/fsfoundation/pull/757/files where telling

Get Mono, the cross-platform, open source .NET runtime implementation used by F#. Preferably use a package from your distribution or Xamarin. If this is not possible, [install from source by following these instructions](https://github.com/mono/mono).

and it will not work anymore (outside supported distributions) that's why I state on removing or reworking misleading steps for building.
I was trying to use that msbuild ebuild and faced the error in my first post here.

@knocte
Copy link
Contributor

knocte commented Jan 16, 2019

it's currently using commit from https://github.com/mono/linux-packaging-msbuild

That's the repo for packaging, it's not upstream.

it could be great if there will be distribution-neutral versions on that repository

Maybe it's this? https://github.com/mono/msbuild but note, might not be master branch

@cnd
Copy link
Contributor Author

cnd commented Jan 16, 2019

@knocte I see, I'm not sure why packaging repository was taken. Do you know what tag of which repository and with which flag we should build for f sharp? (I can't find 15.6.0.0 tag there)
It could be really useful if anyone is able to provide step by step instructions.
Microsoft picks very specific way of working with OSS dotnet/source-build#782
I'm okay if they will be able to manage everything by themselves but without any instructions it's absolute mess for me, I try building random commits, I get build errors I can't understand, I rant, I'm tired.

@ninjarobot
Copy link
Member

@directhex are you able to provide any guidance for packaging for msbuild on Gentoo? More and more projects are going to expect msbuild since it supports the new SDK format. @cnd bumped mono to 5.18 here and various community members have been maintaining the overlays. With some guidance, I expect the community would keep up msbuild overlays as well.

@directhex
Copy link
Contributor

@ninjarobot https://github.com/mono/linux-packaging-msbuild/blob/master/debian/rules#L11-L19 + http://download.mono-project.com/sources/msbuild/

MSBuild isn't in a state where those tarballs are "Debian grade" (they contain binary pieces, and touch the Internet, which are both forbidden), but I don't know how those rules play out for Gentoo.

@ArsenShnurkov
Copy link

ArsenShnurkov commented Jan 17, 2019

msbuild works for simple projects, but not for all, because many projects require Microsoft.NET.Sdk, which is not packaged. In this issue, the error message text is different. So, it's not the msbuild ebuild problem yet.

"Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly"

probably fsharp's version of FSharp.Build.dll is not built against the version of msbuild in gentoo.

how those rules play out for Gentoo.

gentoo should build everything from source, no binary bits are welcomed

One possible solution is to build FSharp.Build.dll according to gentoo guidelines.

@cnd
Copy link
Contributor Author

cnd commented Jan 17, 2019

some binary blobs are okay, alike nvidia-drivers for example but if source based version is available it's preferred.

@ArsenShnurkov
Copy link

@cnd

I'm not sure why packaging repository was taken.

What is the difference between microsoft/msbuild and mono/linux-packaging-msbuild ?
the second contains the same content as the first plus some additional content, in particular the content of Sdks:

meld ~/msbuild/linux-packaging-msbuild ~/msbuild/Microsoft

image

@knocte
Copy link
Contributor

knocte commented Feb 3, 2019

AFAIU, the former is a repository used to build .deb/.rpms. They need to contain the original sources.

@dsyme
Copy link
Contributor

dsyme commented Apr 10, 2019

I've checked and this repo builds clean with Mono 5.18.1.3 (in a Debian 9 docker container)

Note this repo is not by default "build from source" - it uses various binary packages as part of the build process. For a "build from source" option please use the .NET SDK build from source (including F#) and the "src/buildfromsource.sh" in the repository.

@dsyme dsyme closed this as completed Apr 10, 2019
@cnd
Copy link
Contributor Author

cnd commented Apr 10, 2019

@FSSF please update documentation on wiki

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants