Skip to content
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

How to get the build working on Windows? #200

Open
mrakgr opened this issue May 19, 2020 · 2 comments
Open

How to get the build working on Windows? #200

mrakgr opened this issue May 19, 2020 · 2 comments

Comments

@mrakgr
Copy link
Contributor

mrakgr commented May 19, 2020

I am trying to compile it using the VS 2019 Preview on Windows 10, and am running into difficulties. For example, when I try to rebuild Hopac.Core I get...

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB3075	The command ""E:\Reactive\Hopac\.paket\paket.exe" restore" exited with code 5. Please verify that you have sufficient rights to run this command.	Hopac.Core	E:\Reactive\Hopac\.paket\Paket.Restore.targets	81	

Running fake.bat fails with some large error. Here it is.

e:\Reactive\Hopac>fake

e:\Reactive\Hopac>SET TOOL_PATH=.fake

e:\Reactive\Hopac>IF NOT EXIST ".fake\fake.exe" (dotnet tool install fake-cli --tool-path ./.fake )
You can invoke the tool using the following command: fake
Tool 'fake-cli' (version '5.20.0') was successfully installed.

e:\Reactive\Hopac>".fake/fake.exe"
Error while parsing command line, usage is:

General:

  The Fake command line is divided into runtime and script arguments.
  Runtime arguments control compilation and processing of the script,
  while script arguments are specific for the script or provided by
  a NuGet package.
  In most use cases you use the "Fake.Core.Target"-Package and therefore
  inherit the corresponding command line interface. While these arguments
  are not strictly part of the runtime we still show both below to
  make it easier for newcomers.

 -- RUNTIME ARGUMENTS SECTION --


Usage:
  fake.exe [fake_opts] run [run_opts] [<script.fsx>] [--] [<scriptargs>...]
  fake.exe [fake_opts] build [build_opts] [--] [<scriptargs>...]
  fake.exe --version
  fake.exe --help | -h

Fake Options [fake_opts]:
  -v, --verbose [*]     Verbose (can be used multiple times)
                        Is ignored if -s is used.
                        * -v: Log verbose but only for FAKE
                        * -vv: Log verbose for Paket as well
  -s, --silent          Be silent, use this option if you need to pipe your output into another tool or need some additional processing.

Fake Run Options [run_opts]:
  -d, --debug           Debug the script.
  -n, --nocache         Disable fake cache for this run.
  -p, --partial-restore
                        Only restore the required group instead of a full restore,
                        can be set globally by setting the environment variable FAKE_PARTIAL_RESTORE to true.
  --fsiargs <fsiargs> [*]  Arguments passed to the f# interactive.

Fake Build Options [build_opts]:
  -d, --debug           Debug the script.
  -n, --nocache         Disable fake cache for this run.
  -p, --partial-restore
                        Only restore the required group instead of a full restore,
                        can be set globally by setting the environment variable FAKE_PARTIAL_RESTORE to true.
  --fsiargs <fsiargs> [*]  Arguments passed to the f# interactive.
  -f, --script <script.fsx>
                        The script to execute (defaults to `build.fsx`).


 -- SCRIPT ARGUMENTS SECTION --

THIS SECTION ONLY APPLIES IF YOU USE THE 'Fake.Core.Target' PACKAGE!
You can use the following arguments in place of `<scriptargs>`:

Usage:
  fake-run --list
  fake-run --write-info <file>
  fake-run --version
  fake-run --help | -h
  fake-run [target_opts] [target <target>] [--] [<targetargs>...]

Target Module Options [target_opts]:
    -t, --target <target>
                          Run the given target (ignored if positional
argument 'target' is given)
    -e, --environment-variable <keyval> [*]
                          Set an environment variable. Use 'key=val'.
Consider using regular arguments, see https://fake.build/core-targets.html
    -s, --single-target    Run only the specified target.
    -p, --parallel <num>  Run parallel with the given number of tasks.

Example:

To use verbose mode (from [fake_opts]) and print all
targets use "fake -v build -- --list". Because "--list"
doesn't conflict with any of the [build_opts], you can use
"fake -v build --list"
-> DocoptException: errors Error: Error in Argument 1 ('<>')
   Expecting: Command 'build', Command 'run', Flag '--help', Flag '--version' or
   ShortFlag '-h'

And I am not sure how to even run the build.fsx. When I tried that, the following error is what I get.

e:\Reactive\Hopac>dotnet fsi
No executable found matching command "dotnet-fsi"

e:\Reactive\Hopac>dotnet fsi build.fsx
No executable found matching command "dotnet-fsi"

Perhaps it is looking for some nonexistent version of FSI because when I try to do the following it works.

e:\Reactive>dotnet fsi

Microsoft (R) F# Interactive version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

I did install the .NET Core 2.1.402 that the solution has specified in global.json. I had to just to get the project to open in VS. For reference, here is a list of them.

e:\Reactive>dotnet --list-sdks
2.1.402 [C:\Program Files\dotnet\sdk]
2.1.600 [C:\Program Files\dotnet\sdk]
2.1.601 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.2.207 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
3.1.202 [C:\Program Files\dotnet\sdk]
3.1.300-preview-015135 [C:\Program Files\dotnet\sdk]
5.0.100-preview.3.20216.6 [C:\Program Files\dotnet\sdk]

e:\Reactive>dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-preview.3.20215.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-preview.3.20214.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0-preview.3.20214.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

One more thing, the git clone when it is done recursively for submodules has some errors. I deleted the Hopac folder before trying the following.

e:\Reactive>git clone --recursive https://github.com/Hopac/Hopac.git
Cloning into 'Hopac'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 11579 (delta 0), reused 0 (delta 0), pack-reused 11574
Receiving objects: 100% (11579/11579), 7.84 MiB | 2.23 MiB/s, done.
Resolving deltas: 100% (8248/8248), done.
': not a valid identifier6_64/bin/gettext.sh: line 88: export: `dashless
': not a valid identifier6_64/bin/gettext.sh: line 88: export: `USAGE
Submodule 'FsiRefGen' (https://github.com/polytypic/FsiRefGen.git) registered for path 'FsiRefGen'
Cloning into '/cygdrive/e/Reactive/Hopac/FsiRefGen'...
remote: Enumerating objects: 447, done.
Receiving objects:  77remote: Total 447 (delta 0), reused 0 (delta 0), pack-reused 447
Receiving objects: 100% (447/447), 132.37 KiB | 664.00 KiB/s, done.
Resolving deltas: 100% (281/281), done.
': not a valid identifier6_64/bin/gettext.sh: line 88: export: `sha1
': not a valid identifier6_64/bin/gettext.sh: line 88: export: `displaypath
': not a valid identifier6_64/bin/gettext.sh: line 88: export: `displaypath
': not a valid identifier6_64/bin/gettext.sh: line 88: export: `sha1
Submodule path '': checked out ''
@mrakgr
Copy link
Contributor Author

mrakgr commented May 19, 2020

Most likely, the issue is that it seems to be setup for compilation on Linux, but I am not familiar with F#'s various build tools so I have no idea how to proceed from here. Since the project does not seem active, I'll start by creating a new C# project and adding the files by hand.

@haf
Copy link
Member

haf commented May 19, 2020

The project is active, for sure, there are people here, it's used. There's a CI pipeline; the current Windows build instructions are at https://github.com/Hopac/Hopac/blob/master/appveyor.yml#L16

That said, I'm not a big fan of how it's set up, since it requires cygwin and is all custom shell scripts. I wouldn't mind merging a PR that has a .sln file pointing to https://github.com/Hopac/Hopac/tree/master/Libs as well as the examples, and then building that without much ado.

@mrakgr mrakgr changed the title How to get the build working? How to get the build working on Windows? May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants