Thread overview
Re: core/sys/windows/windows.d is executable
Sep 27, 2013
Jonathan M Davis
Sep 28, 2013
Benjamin Thaut
September 27, 2013
On Friday, September 27, 2013 14:45:37 Joseph Rushton Wakeling wrote:
> Hello all,
> 
> While updating my DMD/druntime/phobos install from git HEAD, I noticed that the druntime file core/sys/windows/windows.d has executable permissions.
> 
> Am I right to assume this is a mistake which probably stems from someone editing it _on Windows_, from whence all files seem to arrive on POSIX with executable permissions?
> 
> I'll file a bug report & patch, but first thought I'd check I wasn't mistaken about this being a mistake.

No, it should not be executable. The only time that it makes sense for a .d file to be executable is when it's a script with something like #!/bin/rdmd at the top, which certainly isn't the case for windows.d.

- Jonathan M Davis
September 28, 2013
On 27/09/13 21:13, Jonathan M Davis wrote:
> No, it should not be executable. The only time that it makes sense for a .d
> file to be executable is when it's a script with something like #!/bin/rdmd at
> the top, which certainly isn't the case for windows.d.

OK, I'll file a bug report and prepare a patch.  Might not arrive 'til next week.

September 28, 2013
On 27/09/13 21:13, Jonathan M Davis wrote:
> No, it should not be executable. The only time that it makes sense for a .d
> file to be executable is when it's a script with something like #!/bin/rdmd at
> the top, which certainly isn't the case for windows.d.

Is testing for correct permissions something that can be included in the auto-tester?  Seems likely that it could happen again by accident if someone edits windows.d on Windows (which is probably the most typical place to edit it).
September 28, 2013
Am 28.09.2013 11:16, schrieb Joseph Rushton Wakeling:
> On 27/09/13 21:13, Jonathan M Davis wrote:
>> No, it should not be executable. The only time that it makes sense for
>> a .d
>> file to be executable is when it's a script with something like
>> #!/bin/rdmd at
>> the top, which certainly isn't the case for windows.d.
>
> Is testing for correct permissions something that can be included in the
> auto-tester?  Seems likely that it could happen again by accident if
> someone edits windows.d on Windows (which is probably the most typical
> place to edit it).

Wouldn't it make more sense to automatically remove execute permission instead of testing against them? For someone only developing on windows it will not help when the autotester rejects the pull request just because it hase been made from a windows machine.
September 28, 2013
On 28/09/13 11:19, Benjamin Thaut wrote:
> Wouldn't it make more sense to automatically remove execute permission instead
> of testing against them? For someone only developing on windows it will not help
> when the autotester rejects the pull request just because it hase been made from
> a windows machine.

Sure.  Can't remember off the top of my head if/how git handles this sort of thing.
September 28, 2013
On 28/09/13 11:12, Joseph Rushton Wakeling wrote:
> OK, I'll file a bug report and prepare a patch.  Might not arrive 'til next week.

Pull request sent: https://github.com/D-Programming-Language/druntime/pull/618

I'll file a bug report next week, but to request that permissions are checked and corrected rather than for this single file's permissions status.