RFR: 8268083: JDK-8267706 breaks bin/idea.sh on a Mac
Erik Joelsson
erikj at openjdk.java.net
Fri Jun 4 21:55:02 UTC 2021
On Fri, 4 Jun 2021 21:23:27 GMT, Nikita Gubarkov <github.com+9004656+YaaZ at openjdk.org> wrote:
> I got rid of `realpath` usage as discussed in https://github.com/openjdk/jdk/pull/4190 and used `RelativePath` macro instead, however there were quite a few problems with this macro, here's the example:
>
> $(call RelativePath,/foo/bar,/foo/bar/baz) -> " ..//foo/bar"
> $(call RelativePath,/foo/bar/baz/,/foo/bar/baz) -> SEGFAULT
> $(call RelativePath,/foo/bar/baz/banan,/foo/bar/) -> " ./baz/banan"
> $(call RelativePath,/foo/bar/baz,/foo/bar/banan) -> " ../baz"
>
> As you can see, 1st case is just plain wrong, 2nd crashes make because of infinite loop, 3rd can be simplified and all of them have leading whitespaces
> First commit in this PR fixes all these issues and adds corresponding test cases and second commit replaces usage of `realpath` in idea.sh with `RelativePath` macro in idea.gmk and fixes problems, when paths are incorrectly treated by IDEA
Nice work, this looks great! Thank you for improving the RelativePath macro. Since this is touching some very core and sensitive build functionality, I'm going to run it through all our internal builds just to be safe.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4369
More information about the core-libs-dev
mailing list