RFR: 8303427: Fixpath confused if unix root contains "/jdk"

Erik Joelsson erikj at openjdk.org
Thu Aug 31 13:06:00 UTC 2023


On Tue, 29 Aug 2023 00:16:46 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> On Windows, when a directory exists in the "unix" root with the same name as a directory in the "test" dir, fixpath will corrupt test arguments to jtreg (and possibly other arguments as well). Fixpath sees a string like this:
> 
> test/jdk/foo
> 
> It looks for the first `/` and checks if the first element following that, until the next `/`, is an existing directory in the unix filesystem root. In this case, the reporter had a directory named "/jdk" which satisfies this heuristic check. This makes fixpath assume that the `/jdk/foo` part is an absolute unix path that needs to be rewritten to a Windows path.
> 
> My suggested fix is to look at the prefix part, "test" in this case, and see if that itself is a valid path in the current working directory, as that would indicate that the string is intended to be a relative path.
> 
> I think we also need to account for possible prefixes with `:` and `=` here to handle a string like:
> 
> jtreg:test/jdk/foo
> 
> In that case we need to remove anything up to the last `:` before we try to match it as a relative directory. (Same thing applies to `=`)
> 
> Changing the heuristics of fixpath is rather sensitive and risky. I would appreciate help from people using Windows with trying this patch with some of your regular workflows.

I have done a lot of testing and comparison builds so I'm feeling pretty confident about this patch now. Does anyone dare reviewing?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15461#issuecomment-1701001143


More information about the build-dev mailing list