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
"dotnet new mini-scaffold" on Linux strips execute bit from build.sh #19
The build.sh file checked into the Git repo has the execute bit properly set, but after I run dotnet new -i "MiniScaffold::*" and then dotnet new mini-scaffold, the resulting files have build.sh without the execute bit. This is just a minor annoyance as it's easy to immediately run chmod +x build.sh, but if it can be fixed in the template that would be nice.
I rather suspect, though, that this is a limitation in the dotnet templating engine, in which case you can't fix it in the template. If that's the case, feel free to just close this issue. :-)
System info:
Dotnet version: 2.0.0-preview2-006497 OS version: Linux Mint 18.1 (based on Ubuntu Xenial 16.04)
My home computer has dotnet 1.0.1 (which I apparently installed on February 28th and forgot about until now), so I was able to try with 1.0.1. Doing so produced the amusing result that every file had the execute bit set! Specifically, running dotnet new -i "MiniScaffold::*" and then dotnet new mini-scaffold under dotnet 1.0.1 produced a project directory where every file was mode 744 (rwx for owner, r-- for group and other), and every directory was mode 755.
There are several other related issues and PRs in the coreclr repo, but I'm currently on a mobile phone so it's a bit difficult to reference all of them. I'll add more details when I get back to a computer. But basically, the 1.0 tools set the execute bit everywhere, and a PR was created to fix that bug by not setting the execute bit at all. I'm not yet sure if the tools have access to the needed information to correctly set the execute bit only on the files for which it was set in the Git repo. I haven't yet been able to tell if templates can specify execute bits in some way, so I'll keep this issue open until I'm sure it can't be fixed by templates.
It looks like the ultimate cause of this issue is NuGet/Home#4424. Comments in that issue's thread say that the relevant bug has been fixed, but that that fix didn't make it into the 2.0.0-preview2-006497 version of the .Net CLI tools. So I'll just need to test against the CLI tools once preview3 comes out (or the official release if they don't put out a preview 3), and see whether the execute bit is getting restored properly at that point.
Meanwhile, I think it's safe to close this particular issue since there's nothing you need to change in the template, as far as I know. If the preview3 release comes out and it turns out that the template does need to do something special besides having the execute bit set in the Git repo, then I'll reopen this issue.
Activity
TheAngryByrd commentedon Jun 30, 2017
Hmm I haven't tried
2.0.0-preview2-006497. Can you try with the 1.0.x version?rmunn commentedon Jul 1, 2017
My home computer has dotnet 1.0.1 (which I apparently installed on February 28th and forgot about until now), so I was able to try with 1.0.1. Doing so produced the amusing result that every file had the execute bit set! Specifically, running
dotnet new -i "MiniScaffold::*"and thendotnet new mini-scaffoldunder dotnet 1.0.1 produced a project directory where every file was mode 744 (rwxfor owner,r--for group and other), and every directory was mode 755.rmunn commentedon Jul 2, 2017
Related: https://github.com/dotnet/coreclr/issues/11232
There are several other related issues and PRs in the coreclr repo, but I'm currently on a mobile phone so it's a bit difficult to reference all of them. I'll add more details when I get back to a computer. But basically, the 1.0 tools set the execute bit everywhere, and a PR was created to fix that bug by not setting the execute bit at all. I'm not yet sure if the tools have access to the needed information to correctly set the execute bit only on the files for which it was set in the Git repo. I haven't yet been able to tell if templates can specify execute bits in some way, so I'll keep this issue open until I'm sure it can't be fixed by templates.
rmunn commentedon Jul 3, 2017
It looks like the ultimate cause of this issue is NuGet/Home#4424. Comments in that issue's thread say that the relevant bug has been fixed, but that that fix didn't make it into the
2.0.0-preview2-006497version of the .Net CLI tools. So I'll just need to test against the CLI tools oncepreview3comes out (or the official release if they don't put out a preview 3), and see whether the execute bit is getting restored properly at that point.Meanwhile, I think it's safe to close this particular issue since there's nothing you need to change in the template, as far as I know. If the
preview3release comes out and it turns out that the template does need to do something special besides having the execute bit set in the Git repo, then I'll reopen this issue.TheAngryByrd commentedon Jul 3, 2017
Thanks for the investigation!
mlorbetske commentedon Jul 6, 2017
For dotnet new, we're looking at ways of preserving or setting permissions on generated content here dotnet/templating#1028