8303427: Fixpath confused if unix root contains "/jdk"#15461
8303427: Fixpath confused if unix root contains "/jdk"#15461erikj79 wants to merge 1 commit intoopenjdk:masterfrom
Conversation
|
👋 Welcome back erikj! A progress list of the required criteria for merging this PR into |
|
The GitHub Actions failures look terrifying, but all of them are just a failing JTReg download for some reason (Not related to the change). Will recompile with this change and report back as soon as I can |
|
Works normally on both master and the experimental JDK-8288293 branch |
I hit rerun and it seems have worked
Thank you for testing! I'm still running through more scenarios. |
|
I have done a lot of testing and comparison builds so I'm feeling pretty confident about this patch now. Does anyone dare reviewing? |
|
Just because I'm curious: in which cases would the prefix contain |
|
@erikj79 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 49 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
I don't have a concrete example, but one could imagine a command taking make or configure style variable arguments like this: The existing logic was already handling both |
|
/integrate |
|
Going to push as commit 2f7c65e.
Your commit was automatically rebased without conflicts. |
|
Some post-checkin reflections: I think this looks sane. In the end, we're doing a fair bit of guesswork to identify the paths, but this seems like a reasonable addition to the guessing machinery. If I recall correctly, one thing that really made this even more messed-up was that on Windows, you could have like With this change, if the user has a directory named We have tried to minimize the risk of this by using |
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:
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/foopart 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: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.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15461/head:pull/15461$ git checkout pull/15461Update a local copy of the PR:
$ git checkout pull/15461$ git pull https://git.openjdk.org/jdk.git pull/15461/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15461View PR using the GUI difftool:
$ git pr show -t 15461Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15461.diff
Webrev
Link to Webrev Comment