Closed pjljvandelaar closed 6 months ago
@pjljvandelaar indeed it should be all /
here. What differentiate gprbuild
and gnat_native
crates is that they are binary crates and the PATH is set with this in the manifest:
[environment]
PATH.prepend = "${CRATE_ROOT}/bin"
@mosteo We could have a different one for Windows in the manifest using a case
, or we could "fix" the path in Alire.
We have the Portable/Native path types to try and avoid these things, so If we can be consistent that would be the better fix. I guess there's some missing conversion from portable to native.
The PATH value worries me, due to the different slash before the bin directory of the first two entries
I've located the source of this problem in our sources and I have a fix incoming.
Also one of the last entries, worry me
This seems to happen only for the Alire Power Shell, and also with echo $env:PATH
, so probably coming from our installer, will check.
W.r.t. the C:/Program Files/Alire\bin;
PATH part, I'm puzzled because the installer is clearly using backslashes here. As long as it doesn't cause any trouble, I wouldn't lose more sleep over it.
@mosteo Looking at the issue with:
[environment]
PATH.prepend = "${CRATE_ROOT}/bin"
I don't see a clear solution for this. If we add a process to change /
into \
on Windows, when do we apply it?
We can make a special case for environment.PATH
.
Another solution would be to always have the directory separator at the end of the ${CRATE_ROOT}
value so the manifest would look like this.
[environment]
PATH.prepend = "${CRATE_ROOT}bin"
I don't see a clear solution for this. If we add a process to change
/
into\
on Windows, when do we apply it?
That's what #1483 addresses. Basically, these are always interpreted as paths, internally stored as portable ('/') and converted accordingly when emitted. My idea was to add the possibility of escaping them somehow down the line, in case a literal '\' is ever wanted on non-Windows (can't think of a use case but...).
I don't think making PATH
a particular case works, as this can be WHATEVER_PREFIX
, etc, and having a few trigger words seems a recipe for confusion. Another idea was to have VARIABLE.literal.prepend
(does not reformat) and VARIABLE.prepend
(reformats to native paths), but I thought that was too much at this time.
Finally, after seeing that Git for windows simply uses '/' (it stores paths like C:/foo/bar
) and there seems to be no ill effect, maybe we could just do the same. I should first research that Windows is indeed ok with '\' and '/' interchangeably.
For now, I think #1483 is the minimal intervention to keep things under general expectations.
Dear Alire developers,
While trying to find the root cause of a bug that only occurs on windows, I noticed the following: when typing
in the
tests
directory of the Rejuvenation-Ada project, one gets (something like)The PATH value worries me, due to the different slash before the bin directory of the first two entries
Can it be made consistent, like the other two alire bin directories that are included?
Also one of the last entries, worry me
Can it be made consistent, i.e. "C:\Program Files\Alire\bin"?
Thanks in advance, Pierre