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

$(PaketRootPath) is not set on a fresh dotnet restore #2519

Closed
piaste opened this issue Jul 14, 2017 · 9 comments
Closed

$(PaketRootPath) is not set on a fresh dotnet restore #2519

piaste opened this issue Jul 14, 2017 · 9 comments

Comments

@piaste
Copy link
Contributor

piaste commented Jul 14, 2017

Description

On a fresh restore of a Fable template, the paket restore fails due to an unset path variable.

I initially thought the problem was in (mono's version of) MSBuild, since apparently $(PaketRootPath) is set as $(MSBuildThisFileDirectory).

However, once I went and manually replaced $(PaketRootPath) with $(MSBuildThisFileDirectory) in Paket.Restore.Targets the problem went away because $(MSBuildThisFileDirectory) was set correctly, so I guess the issue may be on the Paket side?

Repro steps

On Ubuntu 17.04 with the dotnet 2.0 Preview 2 installed, run this:

dotnet new -i Fable.Template.Simple
dotnet new fable -n fsimple
dotnet restore

Expected behavior

The restore process starts (and then hangs due to an unrelated bug :) )

Actual behavior

The restore process exits immediately with:

  Cannot open assembly '': No such file or directory.
/home/piaste/Projects/fsimple/.paket/Paket.Restore.targets(18,5): error MSB3073: The command "mono --runtime=v4.0.30319 "" restore --project "/home/piaste/Projects/fsimple/src/fsimple.fsproj" --target-framework netstandard1.6" exited with code 2. [/home/piaste/
Projects/fsimple/src/fsimple.fsproj]

The argument which comes up empty after --runtime is $(PaketExePath), which is defined as follows:

<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>

Known workarounds

As mentioned above, manually replacing $(PaketRootPath) with $(MSBuildThisFileDirectory) in Paket.Restore.Targets fixes the problem.

Environment

Paket version 5.6.11

dotnet --info:

.NET Command Line Tools (2.0.0-preview2-006497)

Product Information:
Version: 2.0.0-preview2-006497
Commit SHA-1 hash: 06a2093335

Runtime Environment:
OS Name: ubuntu
OS Version: 17.04
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/2.0.0-preview2-006497/

Microsoft .NET Core Shared Framework Host

Version : 2.0.0-preview2-25407-01
Build : 40c565230930ead58a50719c0ec799df77bddee9

@forki
Copy link
Member

forki commented Jul 14, 2017

this is a known issue with dotnet templating (see dotnet/templating#1021)

please run .paket/paket.exe install that will fix the targets file

@MangelMaxime we did fix that template right?

@piaste
Copy link
Contributor Author

piaste commented Jul 14, 2017

Thank you, that was an easier fix.

Before I close the issue, any guesses as to why dotnet restore runs paket restore twice?

  piaste@piaste-UbuntuDev:~/Projects/fsimple$ dotnet restore
  Paket version 5.6.11
  Performance:
   - Disk IO: 75 milliseconds
   - Runtime: 2 seconds
  Paket version 5.6.11
  Performance:
   - Disk IO: 90 milliseconds
   - Runtime: 2 seconds
  Restore completed in 44.59 ms for /home/piaste/Projects/fsimple/src/fsimple.fsproj.
  Restore completed in 12.48 ms for /home/piaste/Projects/fsimple/src/fsimple.fsproj.

@forki
Copy link
Member

forki commented Jul 14, 2017

do you have multiple target frameworks?

@forki
Copy link
Member

forki commented Jul 14, 2017

can you please upload a zip with that repro?

@piaste
Copy link
Contributor Author

piaste commented Jul 14, 2017

sure:
fsimple.zip

@forki
Copy link
Member

forki commented Jul 14, 2017

ok nuget restore runs twice. I assume that is a bug in dotnet cli /cc @enricosada

@MangelMaxime
Copy link

@forki I fixed the elmish templates. But perhaps not the fable.Simple

@forki
Copy link
Member

forki commented Jul 14, 2017 via email

@MangelMaxime
Copy link

Change push in this PR: fable-compiler/Fable#1069

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

3 participants