gentoo / dotnet

[MIRROR] Newer mono, .NET languages, and libraries
https://gitweb.gentoo.org/repo/proj/dotnet.git
78 stars 56 forks source link

Fsharp has been removed from tree, please provide your own version or mask monodevelop which depends on it #382

Open nado opened 6 years ago

nado commented 6 years ago

See https://bugs.gentoo.org/639060

beetleb commented 5 years ago

I really hope someone can get F# going.

Some months ago I decided to pick up an ML-type language that's not Haskell. I wanted something with good cross platform support, and a good set of libraries. The choices boiled down to OCaml and F#. I picked F# because most people I know who've used both say that F# works better on Linux than OCaml does on Windows.

Unfortunately, being a Gentoo user, I can't get the darn thing installed! The instructions here are pretty out of date. There's no ebuild, and installing mono is not sufficient for building F# (or even necessary?)

I first tried what was suggested - I installed mono in my user directory. But F# build failed because I did not have msbuild. I tried installing msbuild from the Git repository, but couldn't. I then installed it from the dotnet overlay, but F# installation still fails (incompatible version or something). I gave up.

I think F# has a good future. Hopefully someone can bring this to Gentoo.

cnd commented 5 years ago

@nado @beetleb their build system which were working previously was broken/changed, even old F# versions are not buildable anymore because NuGet is horrible... (and that's why it was removed from main tree) I may try writing that ebuild again but I don't use it at the moment, not sure if I will find time for it.

beetleb commented 5 years ago

Would much appreciate it if you can do it.

Regarding NuGet, have their been any attempts to work with Microsoft on this? In the bigger picture, I'm guessing Nuget likely will remain annoying this way, so if we can find a solution that doesn't violate Gentoo's security, that would be great. Worst case, perhaps keep this as masked and let the user unmask at their own risk?

I think the ideal would be if I could install these things as a user instead of root - the F# docs indicate this is possible, but I have not been able to do it. Their docs are outdated, and so it's not clear which dependencies I need to be able to install it as a user.

cnd commented 5 years ago

well, Microsoft now put more attention on .NET SDK https://github.com/dotnet/netcorecli-fsc you don't need specific ebuild for F# there, it's language agnostic, there is sdk and msbuild contributed by users to that overlay, you can try them out. For monodevelop, really not sure, maybe someone will add at least monodevelop-bin package because building request many forks and it's changing very often.

beetleb commented 5 years ago

This sounds good, but I'm a little confused.

Can you describe what packages I need to install (from dotnet or any other overlay) to be able to develop in F#?

Thanks.

cnd commented 5 years ago

I can't be sure but possibly msbuild and sdk one (dotnetcore-sdk or dotnetcore-sdk-bin)

cartermp commented 5 years ago

Hey there, piping in based on: https://github.com/Microsoft/visualfsharp/issues/6067

I've never used Gentoo, but there are some specifics about F# that are probably worth mentioning:

Once .NET Core is on your machine, it's as easy as:

dotnet new console -lang F# -o SampleApp && cd SampleApp
dotnet run

However, I'm not sure how MonoDevelop will pick up the templates installed by the SDK, or if it will at all. I know that VS for Mac will do this, and VS for Mac is built atop the MonoDevelop core, but I'm not sure if the machinery to detect and surface templates is in MonoDevelop proper.

Alternatively, you can use Visual Studio Code with the Ionide plugin to get an IDE with F#.

cnd commented 5 years ago

@cartermp hello, may I ask few additional questions

cartermp commented 5 years ago

It should be possible to build the F# compiler and FSharp.Core from https://github.com/fsharp/fsharp

However, we (the F# team at Microsoft) don't own that repository nor are we responsible for packaging on Mono, so I cannot say for sure. But I do know that simply being able to use make is a goal of that system, and if that doesn't work then I'd certainly file an issue.

I can't speak for the rest of the .NET team regarding packaging on Gentoo. I'm not sure what it takes to have a particular distro move towards being officially supported, but my guess is it's a business decision of some sort.

The FSSF and F# team at Microsoft are completely independent. I'm on the FSSF board as an individual, and we do have friendships IRL among us, but we keep things strictly separate for numerous reasons :)

cnd commented 5 years ago

Sure, I'll try that again but as I remember something were not that simple . Actually not really sure if fsharp package on some distribution should be from that repository or from visualfsharp one.

Microsoft is building packages for many distributions already. there is https://github.com/dotnet/source-build. We've got small team on dotnet and another aspect well written in this comment https://github.com/dotnet/source-build/issues/782#issuecomment-422557786 E.g. it's possible to package things on Gentoo, maybe but I don't see interest in that from MS and have no time or personal need at the moment working on that task by myself.

beetleb commented 5 years ago

If I want to install VSCode with the Ionide plugin, which packages do I need? Mono? dotnetcore? Either one?

My understanding is that presently .NET core does not support the F# interpreter (there's an open issue on that) - I can live without it for now. I haven't yet tried out all the steps above for the compiler - will do so when I get a chance.

beetleb commented 5 years ago

So I did test it out and was able to get a simple F# program to compile using dotnetcore-sdk-bin and msbuild.

cnd commented 5 years ago

That's error I'm getting trying to build F# 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]

YangKeao commented 5 years ago

I got the same error as @cnd

/var/tmp/portage/dev-lang/fsharp-10.2.1/work/fsharp-10.2.1/packages/FSharp.Compiler.Tools.4.1.27/tools/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]
/var/tmp/portage/dev-lang/fsharp-10.2.1/work/fsharp-10.2.1/packages/FSharp.Compiler.Tools.4.1.27/tools/Microsoft.FSharp.Targets(129,9): error MSB4060: The "CreateFSharpManifestResourceName" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. [/var/tmp/portage/dev-lang/fsharp-10.2.1/work/fsharp-10.2.1/src/fsharp/FSharp.Core/FSharp.Core.fsproj]
cnd commented 5 years ago

@YangKeao well... take a look on Eta lang

cartermp commented 5 years ago

That error message looks like an issue in packaging in the fsharp/fsharp repo 😕

fsharp-10.2.1 refers to the Compiler SDK version 10.2.1, but the FSharp.Compiler.Tools repo version 4.1.27 packages up an older one. MSBuild is confused about the targets involved, likely due to some change from 4.1.27 to 10.2.1.

Looks like @cnd already filed the issue there, so I think that's where discussion about this can go. Assuming that gets fixed, are there other concerns about F# being in the Gentoo tree?

Krzysztof-Cieslak commented 5 years ago

If I want to install VSCode with the Ionide plugin, which packages do I need? Mono? dotnetcore? Either one?

Ionide supports both runtimes, there is a setting that let you control which one it is using. Usually, users tend to have installed both (due to some other tooling like Paket depends on mono) but it should be possible to run Ionide with just .Net Core installed ( tho, I've never tried this) with some limitations ( lack of REPL and support only for new SDK-based project files)

cnd commented 5 years ago

@cartermp is there fixing patch or can we use some older version?

matthid commented 5 years ago

I can't speak for the rest of the .NET team regarding packaging on Gentoo. I'm not sure what it takes to have a particular distro move towards being officially supported, but my guess is it's a business decision of some sort.

Gentoo is afaik driven by a group of volunteer developers. So basically it boils down to someone showing interest and driving the ebuild (basically their packaging format). Basically Gentoo is a rolling, source-code based linux distribution, which kind of makes packaging and releases a "unique" challenge and not something Microsoft (or the DotNet ecosystem overall for that matter) has experience or good answers to.

Assuming that gets fixed, are there other concerns about F# being in the Gentoo tree?

Afaics they set them-self a high bar for new packages on the official tree. From a quick look they at least need a maintainer actively taking care of the package. From a users perspective it doesn't need to be in the official tree, a overlay (basically community-extensions to the official tree) like this very repository is usually something Gentoo users can work with and is a much lower barrier to contribute. Again it boils down to someone sending a PR with a working ebuild.

If someone wants to step in but doesn't know where to start let me know and I might be able to help. I have written ebuilds in the past but don't use Gentoo currently. (Working builds for F# are the requirement to writing an ebuild obviously)