Paket icon indicating copy to clipboard operation
Paket copied to clipboard

paket restore failing in 5.201.2

Open 2sComplement opened this issue 7 years ago • 45 comments

Description

Running paket restore on an existing solution results in an error on 5.201.2:

Resource stream 'Paket.Restore.targets' could not be found in the Paket.Core assembly

Running paket restore on the same project with 5.201.1 works.

Repro steps

Run a paket restore using version 5.201.2 on an existing solution.

Expected behavior

paket restore should run successfully.

Actual behavior

Paket failed with
-> Resource stream 'Paket.Restore.targets' could not be found in the Paket.Core assembly

Known workarounds

Use 5.201.1

2sComplement avatar Apr 10 '19 14:04 2sComplement

I'm seeing the same behavior. Any chance this release could be rolled back?

WramblinWreck avatar Apr 10 '19 16:04 WramblinWreck

Me too.

0xjeremyfrank avatar Apr 10 '19 16:04 0xjeremyfrank

Same here...causing a lot of issues on our build server that uses the bootstrapper to get the latest.

sandoichi avatar Apr 10 '19 16:04 sandoichi

I agree with @WramblinWreck that this release should be rolled back or a new release should be made with a revert commit. If anyone is using paket in "Magic Mode" it breaks quite mysteriously on the build server. That is not that magic I expected 😢

mandrepont avatar Apr 10 '19 16:04 mandrepont

This has to do with the names of resources: The name of the resource has changed somehow from the simple version to the fully-qualified version. For example in my work application I had to make a function to prepend the expected namespace of an embedded resource to the 'simple name', like so:

let resourceName simpleName = sprintf "%s.%s" "My.Assembly.Fully.Qualified.Name" simpleName

baronfel avatar Apr 10 '19 16:04 baronfel

I made a change recently to always get the targets file...but that has been in a while (since 5.201.0), so don't think that it's that. Maybe we should make it check simple and fully qualified names.

BlythMeister avatar Apr 10 '19 16:04 BlythMeister

Does anyone know how to pin the paket.exe version so that we can work around this?

SirRippovMaple avatar Apr 10 '19 16:04 SirRippovMaple

@trumpi https://fsprojects.github.io/Paket/dependencies-file.html#Global-options

blair55 avatar Apr 10 '19 16:04 blair55

The "extractElement" function in https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/Installation/RestoreProcess.fs is where this error is coming from.

I'm not near a machine to put logic to handle simple and full resource names if anyone else is able 👍

BlythMeister avatar Apr 10 '19 16:04 BlythMeister

@BlythMeister I'm looking right now to prove my assertion above. On .net core I get the following resource names:

resource names: [|"Paket.Restore.targets"; "FSharpSignatureData.Paket.Core";
  "FSharpOptimizationData.Paket.Core"|]

which is what I expect to see (and what the code looks for), but I think on full-framework the behavior might be different. Having a hard time building on mono right now to validate that assertion though.

baronfel avatar Apr 10 '19 16:04 baronfel

@baronfel Just from past experience, I've always had to use fully-namespaced paths in C# on .NET Framework.

jaredreynolds avatar Apr 10 '19 16:04 jaredreynolds

Now I am confused: I finally got a good build on mono 5.23 and get the following results:

resource names: [|"Paket.Restore.targets"; "FSharpSignatureData.Paket.Core";
  "FSharpOptimizationData.Paket.Core"|]

these are the same as for .net core.

baronfel avatar Apr 10 '19 17:04 baronfel

All of this makes sense as to why this mysteriously started happening. Maybe @forki just needs to rebuild/release

BlythMeister avatar Apr 10 '19 17:04 BlythMeister

These exe has dropped in size by approx 200kb in this 1 release...I'm not convinced the resources are in there 🙄

BlythMeister avatar Apr 10 '19 17:04 BlythMeister

I downloaded the latest release and can confirm the resource is missing:

> let paketAssy = Assembly.LoadFrom(paketPath);;
val paketAssy : Assembly =
  paket, Version=5.201.2.0, Culture=neutral, PublicKeyToken=null

> paketAssy.GetManifestResourceNames();;
val it : string [] =
  [|"FSharpSignatureData.Paket.Core"; "FSharpOptimizationData.Paket.Core";
    "FSCore.resources"; "FSharpSignatureInfo.FSharp.Core";
    "FSharpOptimizationInfo.FSharp.Core"; "FSharpSignatureData.Argu";
    "FSharpOptimizationData.Argu"; "FSharpSignatureData.Chessie";
    "FSharpOptimizationData.Chessie"; "FSharpSignatureData.paket";
    "FSharpOptimizationData.paket"; "ILRepack.List"|]

baronfel avatar Apr 10 '19 17:04 baronfel

Mystery solved...but now need someone to re-release...

BlythMeister avatar Apr 10 '19 17:04 BlythMeister

oh my fucking god. something really bad happened after installing VS 2019

I'm trying to revert. and then please retry. But I assume this is unrelated to the changes I made

forki avatar Apr 10 '19 19:04 forki

I don't think it's your changes.

BlythMeister avatar Apr 10 '19 19:04 BlythMeister

ok please retry. and sorry for delay

forki avatar Apr 10 '19 20:04 forki

At a guess...based on exe size still being down a few hundred kB...it might still be broken...not at a machine to test though.

BlythMeister avatar Apr 10 '19 20:04 BlythMeister