You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Executables restored from NuGet packages are no longer executable with .NET Core "2.0" #4424
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
Erics-MBP:cli eerhardt$ ./.dotnet_stage0/x64/dotnet --info
.NET Command Line Tools (2.0.0-alpha-004622)
Product Information:
Version: 2.0.0-alpha-004622
Commit SHA-1 hash: 1f44cabf4a
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.11-x64
Worked before? If so, with which NuGet version: Yes, with dotnet restore version 1.0.0-rc3-004530.
Detailed repro steps so we can see the same problem
Restore a package that contains a tool/executable. For example, Microsoft.NETCore.Runtime.CoreCLR version 1.2.0-beta-24904-03.
Try to execute the crossgen executable at .nuget/packages/runtime.osx.10.10-x64.microsoft.netcore.runtime.coreclr/1.2.0-beta-24904-03/tools/crossgen
Expected result:
With "1.0", the executable would run.
Actual result:
15:57:11.104 1>/Users/dotnet-bot/j/workspace/dotnet_cli/master/release_osx_x64_prtest/build/Microsoft.DotNet.Cli.Compile.targets(225,7): error MSB6003: The specified task executable "crossgen" could not be run. Operation not permitted [/Users/dotnet-bot/j/workspace/dotnet_cli/master/release_osx_x64_prtest/build.proj]
This is going to be an issue for all tooling using NuGet to restore executables on non-Windows platforms. We shouldn't expect every place that is executing programs from NuGet packages to have to ensure the file has an "x" permission on it.
@rrelyea - when VS 2017 is out the door, can we get this issue triaged? This is going to affect a lot of "2.0" scenarios, so I'd like to get it fixed early in "2.0".
For example, this is breaking the dotnet cache feature on non-Windows machines in 2.0 because the crossgen executable is not marked with the "x" permission.
@rrelyea - this issue blocks ASP.NET Core (and presumably other) apps from running after running the publish operation. Do we have an idea when we might see a fix for this?
If the possible cause identified by @tmds is correct, then this issue has been present for standalone publish in Preview1 as well and fix would be to set the X bit once the modified binary is published.
If the file is signed in the NuGet package, why is it losing that permission? It seems like these permissions should not be lost when copying/moving the file. And explicitly setting it in the SDK seems like a workaround for an issue somewhere else.
If the file is signed in the NuGet package, why is it losing that permission? It seems like these permissions should not be lost when copying/moving the file.
Activity
Fix crossgen executable permissions
rrelyea commentedon Jan 30, 2017
Any reason this is a shipstopper for rtm?
eerhardt commentedon Jan 30, 2017
Not a shipstopper. This only affects "2.0". "1.0" works fine.
eerhardt commentedon Feb 28, 2017
@rrelyea - when VS 2017 is out the door, can we get this issue triaged? This is going to affect a lot of "2.0" scenarios, so I'd like to get it fixed early in "2.0".
eerhardt commentedon Mar 1, 2017
For example, this is breaking the
dotnet cachefeature on non-Windows machines in 2.0 because the crossgen executable is not marked with the "x" permission.@gkhanna79 @ramarag
eerhardt commentedon Mar 3, 2017
Shell scripts need to be marked executable as well.
/cc @livarcocc
Work around issue where executables from NuGet packages are not marke…
eerhardt commentedon Apr 14, 2017
@rrelyea - as we are getting more people using .NET Core 2.0, this is becoming more of an issue. See https://github.com/dotnet/cli/issues/6286. Can we get this looked into?
eerhardt commentedon Apr 14, 2017
/cc @livarcocc
Eilon commentedon Apr 24, 2017
@rrelyea - this issue blocks ASP.NET Core (and presumably other) apps from running after running the publish operation. Do we have an idea when we might see a fix for this?
muratg commentedon Apr 24, 2017
👀
27 remaining items
tmds commentedon Jun 9, 2017
@kichalla If I followed the breadcrumbs correctly, the execute bit gets lost here: https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/EmbedAppNameInHost.cs#L62.
gkhanna79 commentedon Jun 9, 2017
gkhanna79 commentedon Jun 9, 2017
If the possible cause identified by @tmds is correct, then this issue has been present for standalone publish in Preview1 as well and fix would be to set the X bit once the modified binary is published.
@steveharter can you PTAL?
gkhanna79 commentedon Jun 9, 2017
@kichalla Can you please file an issue in SDK for your repro above and assign it to @eerhardt and @steveharter?
gkhanna79 commentedon Jun 9, 2017
@steveharter Possbile fix needs to be like https://github.com/dotnet/sdk/blob/ddfd75cacfd5fb94bebc442441c75852ca4b1ee2/test/Microsoft.NET.TestFramework/CommandExtensions.cs#L16.
tmds commentedon Jun 9, 2017
or alternatively, the apphost can be placed in the publish folder using File.Copy and renamed using File.Move.
gkhanna79 commentedon Jun 9, 2017
Apphost needs to be modified as part of publish operation so simply copying is not going to work.
tmds commentedon Jun 9, 2017
You can open the copied file
gkhanna79 commentedon Jun 9, 2017
@livarcocc When CLI published a standalone app, does it ever mark its entrypoint executable with the "X" bit on non-Windows?
steveharter commentedon Jun 9, 2017
Taking a look now
steveharter commentedon Jun 9, 2017
My understanding:
I am still going through the repro steps; clearing the nuget cache and then restore is being very slow...
gkhanna79 commentedon Jun 9, 2017
livarcocc commentedon Jun 9, 2017
If the file is signed in the NuGet package, why is it losing that permission? It seems like these permissions should not be lost when copying/moving the file. And explicitly setting it in the SDK seems like a workaround for an issue somewhere else.
kichalla commentedon Jun 9, 2017
dotnet/sdk#1331
tmds commentedon Jun 12, 2017
@livarcocc This is the code which is 'copying' the app host: https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/EmbedAppNameInHost.cs#L62. It is creating a new file from bytes in memory.