RFR: 8258925: configure script failed on WSL [v3]
Yasumasa Suenaga
ysuenaga at openjdk.java.net
Fri Jan 8 14:51:54 UTC 2021
On Fri, 8 Jan 2021 14:15:08 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
>> Hi Yasumasa,
>>
>> Okay I see the problem case now, and the latest fix seems to fix things in a way that makes sense to me now. We still need to wait to see what Magnus or Erik think though.
>>
>> Thanks,
>> David
>
> I initially wanted to leave this for Magnus to look at since he wrote all of this, and I know he put a lot of effort into fixpath.sh. It's not a simple script. Now I have stared at it for a while, I think I understand the problem.
>
> One very important aspect of fixpath.sh is to not do heavy work unnecessarily. The latest solution unfortunately adds a call to $PATHTOOL when winpath does not contain forbidden characters. This is a pretty common case and will have performance impact.
>
> The problem is that on line 152, if we find the executable by adding .exe, we need to remember this and use it on line 166, but we cannot modify the variable "path" as it's also used in the else block starting on 168. I would propose introducing a new variable "unixpath" before line 151. Add .exe to it before line 152. Then overwrite it on line 162, and finally use it as the source on line 166.
Thanks @erikj79 for proposing the fix! but I think we should not add variable(s) as possible.
We use `$path` as a result, and we use `$path`, `$winpath` (and `$shortpath` generated by `$winpath`) as input for it if fixpath.sh runs on WSL.
The cause of this problem is fixpath.sh modifies `$winpath` only. If we add new variable, similar issue(s) may happen in future. Fortunately we can convert to unix path from windows path. So it is easy to maintenance if we converge the path to modify to `$winpath`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1889
More information about the build-dev
mailing list