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

DotnetRestore target failed during build #1995

Closed
pengo98 opened this issue Nov 1, 2016 · 34 comments
Closed

DotnetRestore target failed during build #1995

pengo98 opened this issue Nov 1, 2016 · 34 comments

Comments

@pengo98
Copy link

pengo98 commented Nov 1, 2016

Description

I have been trying to build Paket solution using build.cmd that comes with the repo and the build fails at Target DotnetRestore complaining "Cannot start process because a file name has not been provided."

Repro steps

  1. Clone repo

  2. Run build.cmd from the command line.

Expected behavior

The build script should run successfully.

Actual behavior

I'm getting the following error.

Starting Target: DotnetRestore (==> Build)
restore C:\Users\nelson.lin\Source\Github\Paket\src\Paket.Core\Paket.Core\project.json
Running build failed.
Error:
System.Exception: Start of process failed. Cannot start process because a file name has not been provided.
at Fake.ProcessHelper.ExecProcessWithLambdas@79-16.Invoke(String message) in C:\code\FAKE\src\app\FakeLib\ProcessHelper.fs:line 79
at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent, FSharpFunc2 errorF, FSharpFunc2 messageF) in C:\code\FAKE\src\app\FakeLib\ProcessHelper.fs:line 79 at FSI_0005.Fake.DotNet.Cli.Dotnet(DotnetOptions options, String args) at FSI_0005.Fake.DotNet.Cli.DotnetRestore(FSharpFunc2 setParams, String project)
at FSI_0005.Build.clo@151-9.Invoke(String proj)
at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc2 action, IEnumerable1 source)
at FSI_0005.Build.clo@148-8.Invoke(Unit _arg1)
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\FAKE\src\app\FakeLib\TargetHelper.fs:line 492

Known workarounds

n/a

@forki
Copy link
Member

forki commented Nov 1, 2016

We don't install the dotnet sdk during build yet. So you would have to
install it yourself.
@enricosada would it be possible to install during build?

Am 01.11.2016 05:14 schrieb "pengo98" notifications@github.com:

Description

I have been trying to build Paket solution using build.cmd that comes with
the repo and the build fails at Target DotnetRestore complaing "Cannot
start process because a file name has not been provided."
Repro steps

Clone repo
2.

Run build.cmd from the command line.

Expected behavior

The build script should run successfully.
Actual behavior

I'm getting the following error.

Starting Target: DotnetRestore (==> Build)
restore C:\Users\nelson.lin\Source\Github\Paket\src\Paket.Core
Paket.Core\project.json
Running build failed.
Error:
System.Exception: Start of process failed. Cannot start process because a
file name has not been provided.
at Fake.ProcessHelper.ExecProcessWithLambdas@79-16.Invoke(String message)
in C:\code\FAKE\src\app\FakeLib\ProcessHelper.fs:line 79
at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc2
configProcessStartInfoF, TimeSpan timeOut, Boolean silent, FSharpFunc2
errorF, FSharpFunc2 messageF) in C:\code\FAKE\src\app\FakeLib\ProcessHelper.fs:line
79 at FSI_0005.Fake.DotNet.Cli.Dotnet(DotnetOptions options, String args)
at FSI_0005.Fake.DotNet.Cli.DotnetRestore(FSharpFunc2 setParams, String
project)
at FSI_FSI_0005.Build.clo@151-9.Invoke(String proj)
at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc2 action,
IEnumerable1 source)
at FSI_FSI_0005.Build.clo@148-8.Invoke(Unit _arg1)
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in
C:\code\FAKE\src\app\FakeLib\TargetHelper.fs:line 492
Known workarounds

n/a


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1995, or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNA92rPbqTFIVoWy1W_MT2XG1yqXoks5q5ryHgaJpZM4KlwR8
.

@matthid
Copy link
Member

matthid commented Nov 1, 2016

@enricosada would it be possible to install during build?

Sorry to bring up old comments, but this feels like an old discussion:

I think the conclusion is that it isn't simple black/white. One makes the builds more reproducible. The other one saves significant bandwidth and is faster, but the user needs to install it (+PATH).
I'm not even sure if we should settle on one decision across the board or on a case-by-base basis (across the F# ecosystem).

@forki
Copy link
Member

forki commented Nov 1, 2016

What I would love to see is the Paket build using it's own toolchain (Paket 4) as dogfooding.

@matthid
Copy link
Member

matthid commented Nov 1, 2016

But we still need the dotnet sdk and therefore have this problem, don't we?

@forki
Copy link
Member

forki commented Nov 1, 2016

yes but tbf the sdk download is probably the fastest in the whole chain. (first restore of .NET standard takes much more time)

@matthid
Copy link
Member

matthid commented Nov 1, 2016

I think they bundle a lot of the stuff and extract it first time. If you mean Paket restore maybe we should do something similar?

@forki
Copy link
Member

forki commented Nov 1, 2016

maybe later. At first I would just see Paket help building itself on coreclr

@forki
Copy link
Member

forki commented Nov 1, 2016

@forki
Copy link
Member

forki commented Nov 1, 2016

so dotnetcli install seems to work on master now. can you please check?

@theimowski
Copy link
Member

Starting Target: DotnetRestore (==> InstallDotNetCore)
dotnetcore/dotnet.exe restore c:\github\Paket\src\Paket.Core\Paket.Core\project.json
MSBUILD : error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1. [c:\github\Paket\src\Paket.Core\Paket.Core\project.json]

Looks like the latest restore doesn't expect JSON format anymore :)

@forki
Copy link
Member

forki commented Nov 1, 2016

Yeah I guess that's one for tomorrow

Am 01.11.2016 11:28 vorm. schrieb "Tomasz Heimowski" <
notifications@github.com>:

Starting Target: DotnetRestore (==> InstallDotNetCore)
dotnetcore/dotnet.exe restore c:\github\Paket\src\Paket.Core\Paket.Core\project.json
MSBUILD : error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1. [c:\github\Paket\src\Paket.Core\Paket.Core\project.json]

Looks like the latest restore doesn't expect JSON format anymore :)


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1995 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNLRtnXy-f6bJla4eTlNleKxu99xPks5q5xQ6gaJpZM4KlwR8
.

@forki
Copy link
Member

forki commented Nov 1, 2016

Question is if it's even possible to have net 45 + coreclr build in same
fsproj

Am 01.11.2016 11:57 vorm. schrieb "Steffen Forkmann" sforkmann@gmail.com:

Yeah I guess that's one for tomorrow

Am 01.11.2016 11:28 vorm. schrieb "Tomasz Heimowski" <
notifications@github.com>:

Starting Target: DotnetRestore (==> InstallDotNetCore)
dotnetcore/dotnet.exe restore c:\github\Paket\src\Paket.Core\Paket.Core\project.json
MSBUILD : error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1. [c:\github\Paket\src\Paket.Core\Paket.Core\project.json]

Looks like the latest restore doesn't expect JSON format anymore :)


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1995 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNLRtnXy-f6bJla4eTlNleKxu99xPks5q5xQ6gaJpZM4KlwR8
.

@enricosada
Copy link
Collaborator

Sure, just set targetframeworks ( plural ).
Example of multi fw ( works with dotnet pack too)
https://github.com/dotnet/netcorecli-fsc/blob/master/examples/preview3/console-crossgen/ExampleConsoleApp.fsproj

@enricosada
Copy link
Collaborator

Btw abut install.
I think the way for reproducible build is:

  1. check dotnet --version, if match expected, it's ok
  2. otherwise download zip, unzip in subdir .dotnetsdk and add that directory to PATH

The test of build script should just invoke dotnet.
Dont just invoke specific dotnet from a full path, becuase msbuild target can run dotnet and without PATH is going to use the wrong version (or not find it)
Atm is like that, PATH is important, no JAVA_HOME like ( the DOTNET_HOME existed in beta but was discorderai as idea )

@forki
Copy link
Member

forki commented Nov 1, 2016

Yes but what about development? Vs will just break right?

Am 01.11.2016 1:48 nachm. schrieb "Enrico Sada" notifications@github.com:

Btw abut install.
I think the way for reproducible build is:

  1. check dotnet --version, if match expected, it's ok
  2. otherwise download zip, unzip in subdir .dotnetsdk and add that
    directory to PATH

The test of build script should just invoke dotnet.
Dont just invoke specific dotnet from a full path, becuase msbuild target
can run dotnet and without PATH is going to use the wrong version (or not
find it)
Atm is like that, PATH is important, no JAVA_HOME like ( the DOTNET_HOME
existed in beta but was discorderai as idea )


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1995 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNDj4hftMQBQk504Q8ar4gvzUR6qyks5q5zUrgaJpZM4KlwR8
.

@enricosada
Copy link
Collaborator

Pretty sure doesnt work atm


From: Steffen Forkmann notifications@github.com
Sent: Tuesday, November 1, 2016 2:07:21 PM
To: fsprojects/Paket
Cc: Enrico Sada; Mention
Subject: Re: [fsprojects/Paket] DotnetRestore target failed during build (#1995)

Yes but what about development? Vs will just break right?

Am 01.11.2016 1:48 nachm. schrieb "Enrico Sada" notifications@github.com:

Btw abut install.
I think the way for reproducible build is:

  1. check dotnet --version, if match expected, it's ok
  2. otherwise download zip, unzip in subdir .dotnetsdk and add that
    directory to PATH

The test of build script should just invoke dotnet.
Dont just invoke specific dotnet from a full path, becuase msbuild target
can run dotnet and without PATH is going to use the wrong version (or not
find it)
Atm is like that, PATH is important, no JAVA_HOME like ( the DOTNET_HOME
existed in beta but was discorderai as idea )

You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1995 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNDj4hftMQBQk504Q8ar4gvzUR6qyks5q5zUrgaJpZM4KlwR8
.

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/1995#issuecomment-257561871, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAI_K02ktFOpq78cfLGrJqjEeDU_8Hhdks5q5zmJgaJpZM4KlwR8.

@forki
Copy link
Member

forki commented Nov 1, 2016

So in other words: situation is currently worse than with preview 2 and project.json? We can no longer develop in VS and just have a few project.json files next to the fsproj. Since everything is in the same file and that file is not backwards compatible, we basically break everything. Damn

@enricosada
Copy link
Collaborator

@forki a bit too negative dont you think? 😄

So atm, we can use another fsproj next to original, like with project.json, so it's the same as preview2 in worst case, but easier to maintain.
Anyway, development just started, so i think we should get a better idea soon (about vs for example) and some support in next weeks.

For sure the starting point is having the projects working in the sdk from the cli (so restore/build/pack etc), and ide after that.

As a note, we started a group to focus on contributing on netcore and the sdk http://fsharp.github.io/2016/10/31/dotnetcore_sdk_group.html for the full experience (so from templates to ide) for both new projects and existing projects.

The group is about .net core AND sdk, that mean the new fsproj msbuild project system who replace project.json, because that's and important part of the sdk.
So multi targeting support is a goal for sure, because the idea is to improve also ide when needed for basic use cases (like multi targeting).

@forki
Copy link
Member

forki commented Nov 1, 2016

That might be a solution. Will try tomorrow. Thx

Am 01.11.2016 23:32 schrieb "Enrico Sada" notifications@github.com:

@forki https://github.com/forki a bit too negative dont you think? 😄

So atm, we can use another fsproj next to original, like with project.json,
so it's the same as preview2 in worst case, but easier to maintain.
Anyway, development just started, so i think we should get a better idea
soon (about vs for example) and some support in next weeks.

For sure the starting point is having the projects working in the sdk from
the cli (so restore/build/pack etc), and ide after that.

As a note, we started a group to focus on contributing on netcore and the
sdk http://fsharp.github.io/2016/10/31/dotnetcore_sdk_group.html for the
full experience (so from templates to ide) for both new projects and
existing projects.

The group is about .net core AND sdk, that mean the new fsproj msbuild
project system who replace project.json, because that's and important part
of the sdk.
So multi targeting support is a goal for sure, because the idea is to
improve also ide when needed for basic use cases (like multi targeting).


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1995 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNHk4Tt6BBo-nzhA-ZR3-WI56mnneks5q573mgaJpZM4KlwR8
.

@pengo98
Copy link
Author

pengo98 commented Nov 2, 2016

@forki : I believe I do have dotnet SDK installed on my machine so the DotnetRestore target should not need to run. Can you confirm the path of dotnet SDK? Is it "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\ "?

System.Exception: Start of process failed. Cannot start process because a file name has not been provided.

Re above exception, which executable is it trying to launch? From build.fsx, it seems like it's looking for dotnet.exe.

@yishaigalatzer
Copy link

We didn't move off project.json just yet, not ready enough for us

@forki
Copy link
Member

forki commented Nov 2, 2016

@yishaigalatzer still 1.0.0-preview3-003892 fails with dotnet restore on project.sjon files. is there a "backwards-compatible" command. Maybe restore2 or something?

@forki
Copy link
Member

forki commented Nov 2, 2016

@pengo98 we want to make sure it's the right version...

@yishaigalatzer
Copy link

Looping in help

@enricosada
Copy link
Collaborator

@yishaigalatzer i'll send a pr soon

@emgarten
Copy link

emgarten commented Nov 2, 2016

Restore now takes msbuild project files as input, you could try putting a project file next to the project.json file and passing that to dotnet restore. It will then treat it as a UWP project instead of an xproj project.json.

@enricosada
Copy link
Collaborator

Ok updated f# integration to latest sdk drop ( https://github.com/dotnet/netcorecli-fsc/tree/master/examples/preview3 ).
Tomorrow I'll try to migrate the project.fson to fsproj

@dariuszparys
Copy link

Just tried to do an ./build.sh on Ubuntu 16.04/Linux Mint 18.1 and have this error

1) System.Exception: Start of process /home/coder/src/Paket/dotnetcore/dotnet failed. ApplicationName='/home/coder/src/Paket/dotnetcore/dotnet', CommandLine='"restore" "/home/coder/src/Paket/src/Paket.Core.preview3/Paket.Core.fsproj" ', CurrentDirectory='/home/coder/src/Paket', Native error= Cannot find the specified file
  at Fake.ProcessHelper+ExecProcessWithLambdas@91-16.Invoke (System.String message) <0x403564f0 + 0x0001f> in <filename unknown>:0 
  at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () <0x40329640 + 0x00039> in <filename unknown>:0 
  at Microsoft.FSharp.Core.PrintfImpl+Final2@235[TState,TResidue,TResult,A,B].Invoke (Microsoft.FSharp.Core.FSharpFunc`2 env, A a, B b) <0x40339400 + 0x000f7> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3266-1[T2,T3,TResult,T1].Invoke (T2 u, T3 v) <0x403291f0 + 0x00033> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) <0x403291c0 + 0x00029> in <filename unknown>:0 
  at Fake.ProcessHelper+ExecProcessWithLambdas@91-18.Invoke (System.String arg20) <0x403564c0 + 0x00021> in <filename unknown>:0 
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V] (Microsoft.FSharp.Core.FSharpFunc`2 func, Microsoft.FSharp.Core.T arg1, Microsoft.FSharp.Core.TResult arg2) <0x40329040 + 0x000a5> in <filename unknown>:0 
  at Fake.ProcessHelper.ExecProcessWithLambdas (Microsoft.FSharp.Core.FSharpFunc`2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent, Microsoft.FSharp.Core.FSharpFunc`2 errorF, Microsoft.FSharp.Core.FSharpFunc`2 messageF) <0x40351000 + 0x00aff> in <filename unknown>:0 
  at Fake.DotNetCli.Restore (Microsoft.FSharp.Core.FSharpFunc`2 setRestoreParams) <0x403bc310 + 0x00373> in <filename unknown>:0 
  at FSI_0005.Build+clo@188-18.Invoke (System.String proj) <0x403bc250 + 0x0003f> in <filename unknown>:0 
  at Microsoft.FSharp.Collections.SeqModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc`2 action, IEnumerable`1 source) <0x402a7710 + 0x000ce> in <filename unknown>:0 
  at FSI_0005.Build+clo@186-17.Invoke (Microsoft.FSharp.Core.Unit _arg5) <0x403bc1f0 + 0x00053> in <filename unknown>:0 
  at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) <0x40348070 + 0x00023> in <filename unknown>:0 
  at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) <0x4033b3e0 + 0x000ca> in <filename unknown>:0 

@forki
Copy link
Member

forki commented Dec 21, 2016

please use core3 branch

@dariuszparys
Copy link

Same problem, here the error message

 1) System.Exception: Restore failed on "restore" "/home/coder/src/Paket/src/Paket.Core.preview3/Paket.Core.fsproj" 
  at Fake.DotNetCli+Restore@138-3.Invoke (System.String message) <0x401f5f70 + 0x0001f> in <filename unknown>:0 
  at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () <0x4015b640 + 0x00039> in <filename unknown>:0 
  at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc`2 env, A a) <0x4016a450 + 0x000a1> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) <0x4015b1c0 + 0x00029> in <filename unknown>:0 
  at Fake.DotNetCli.Restore (Microsoft.FSharp.Core.FSharpFunc`2 setRestoreParams) <0x401f4530 + 0x0042b> in <filename unknown>:0 
  at FSI_0005.Build+clo@229-30.Invoke (System.String proj) <0x401f4470 + 0x0003f> in <filename unknown>:0 
  at Microsoft.FSharp.Collections.SeqModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc`2 action, IEnumerable`1 source) <0x400d9710 + 0x000ce> in <filename unknown>:0 
  at FSI_0005.Build+clo@227-29.Invoke (Microsoft.FSharp.Core.Unit _arg2) <0x401f4410 + 0x00053> in <filename unknown>:0 
  at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) <0x4017a070 + 0x00023> in <filename unknown>:0 
  at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) <0x4016e270 + 0x000ca> in <filename unknown>:0 

And the log for completeness

build.log.txt

@dariuszparys
Copy link

It seems that resolving the local dotnet core package isn't working in my environment. When I use the global installed dotnet preview 3 it works fine until it tries to restore the sub packages.

Installed:
      112 package(s) to /tmp/byed2alq.pxh/byed2alq.pxh.csproj
/home/coder/src/Paket/src/Paket.Core.preview3/Paket.Core.fsproj : error MSB4057: The target "Restore" does not exist in the project.

@rtarta
Copy link

rtarta commented Dec 14, 2017

same problem goes on

@forki
Copy link
Member

forki commented Dec 14, 2017

@rtarta which dotnet version do you have installed?

@enricosada
Copy link
Collaborator

Closing, now should work

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

9 participants