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

The executable generated from dotnet publish -r linux-x64 doesn't have "x" permission #1331

Closed
kichalla opened this issue Jun 9, 2017 · 11 comments
Labels
Milestone

Comments

@kichalla
Copy link

kichalla commented Jun 9, 2017

Related issues:

Repro steps:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <packageSources>
   <clear />
   <add key="DotNetCore" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
   <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
 </packageSources>
</configuration>
  • dotnet new console
  • Open the testconsole.csproj file and add the property <RuntimeIdentifier>linux-x64</RuntimeIdentifier> and save the file
  • dotnet restore
  • dotnet publish -r linux-x64
  • cd to the published directory
  • Run ./testconsole

Expected:
Hello World!

Actual:
bash: ./testconsole: Permission denied

cc @steveharter @gkhanna79

@gkhanna79
Copy link
Member

@kichalla This issue was present in Preview1 - do you know why it was not surfaced then and is surfacing only now? Is this because it was masked by the Nuget bug?

@livarcocc We should consider taking this for Preview2 SDK. What is the timeline for it?

@kichalla
Copy link
Author

@kichalla This issue was present in Preview1 - do you know why it was not surfaced then and is surfacing only now? Is this because it was masked by the Nuget bug?

Yes, this issue was masked by the Nuget bug. Also I couldn't report this earlier because I was waiting for a CLI which had this Nuget fix.

@steveharter
Copy link
Member

I can confirm the repro steps (Ubuntu 14)

The workarounds for now:

  • Manually perform a chmod +x testconsole
    or
  • Run via dotnet testconsole.dll instead of testconsole directly

I'll start working on the fix.

@gkhanna79
Copy link
Member

Run via dotnet testconsole.dll instead of testconsole directly

For standalone app, which is where this is a bug, this workaround is not correct. I think we should strive to get a fix in today so that we can have the potential to take in the SDK.

@livarcocc which branch should @steveharter prepare the fix in?

@gkhanna79
Copy link
Member

@steveharter Do you have an ETA on the PR?

@steveharter
Copy link
Member

Soon (EOD); verifying fix. Planning on targeting master branch first.

There are two approaches to the implementation: use File.Copy(apphost, testconsole) to copy the permissions from apphost to the testconsole and then replace the contents, or do a raw chmod +x on testconsole. I'm taking the File.Copy approach as a raw chmod will introduce calls into unix interop assemblies which is riskier.

@steveharter
Copy link
Member

See referenced PR; Tests are failing locally because the apphost being restored does not have the execute bit set. Need a newer version of NuGet?

Note: I must need permissions to the sdk repo as I can't modify any properties, including adding a reviewer.

@gkhanna79
Copy link
Member

@livarcocc @nguerrera Can you please help @steveharter with the issues above and also help answer the question around Nuget version as we should be taking this fix for Preview2.

CC @leecow as well.

@nguerrera
Copy link
Contributor

It's possible that NuGet version in master is too old. We haven't RIed in a while. PR should target 2.0 branch

@gkhanna79
Copy link
Member

Closing since the PR is now merged.

@sayhicoelho
Copy link

sayhicoelho commented Dec 14, 2018

  • Manually perform a chmod +x testconsole

@steveharter fixed my issue! thank you!

mmitche pushed a commit to mmitche/sdk that referenced this issue Jun 5, 2020
…0200310.1 (dotnet#1331)

- Microsoft.AspNetCore.Analyzers - 5.0.0-preview.3.20160.1
- Microsoft.AspNetCore.Components.Analyzers - 5.0.0-preview.3.20160.1
- Microsoft.AspNetCore.Mvc.Api.Analyzers - 5.0.0-preview.3.20160.1
- Microsoft.AspNetCore.Mvc.Analyzers - 5.0.0-preview.3.20160.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants