RFR: JDK-8171548: JDK bundles changes sym links incorrectly in the legal directory
Erik Joelsson
erik.joelsson at oracle.com
Thu Dec 22 08:31:23 UTC 2016
On 2016-12-21 18:00, Mandy Chung wrote:
>> On Dec 21, 2016, at 8:52 AM, Erik Joelsson <erik.joelsson at oracle.com> wrote:
>>
>>
>>
>> On 2016-12-21 17:11, Mandy Chung wrote:
>>>> On Dec 21, 2016, at 4:43 AM, Erik Joelsson <erik.joelsson at oracle.com> wrote:
>>>>
>>>> Hello,
>>>>
>>>> Please review this very small fix in the bundle creation. The tar --transform parameter, which we use to create a top level directory inside the bundles, does weird things to relative symlinks. By adding the option 'S', this is fixed. I found this in the gnutar documentation here:
>>>>
>>>> https://www.gnu.org/software/tar/manual/html_section/tar_52.html#transform
>>>>
>>>> When we run tar without support for --transform, we have a fall back implementation where we copy files to a new directory structure and then bundle with tar. I verified that this isn't a problem there too.
>>>>
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8171548
>>>>
>>>> Patch:
>>>>
>>>> diff -r 6234069ff978 make/Bundles.gmk
>>>> --- a/make/Bundles.gmk
>>>> +++ b/make/Bundles.gmk
>>>> @@ -103,7 +103,7 @@
>>>> $(CD) $$($1_BASE_DIRS) \
>>>> && ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
>>>> -$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
>>>> - $$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|') \
>>>> + $$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|S') \
>>>> $(TAR_IGNORE_EXIT_VALUE) ) \
>>>> | $(GZIP) > $$@
>>>> else
>>>>
>>> This looks okay. Does it work for all platforms except windows?
>> Thanks!
>>
>> Not sure what you are asking.
> I just wonder if the S flag works on macosx, linux, solaris, i.e. verifying the content from the bundles generated for these platforms.
Ah, the flag works with gnu tar. Configure has a test that checks if tar
supports --transform. If it supports --transform I assume it also
supports the flag. At least on Solaris, we might find a Solaris tar and
on Macosx bsdtar, which don't have --transform. If so, the bundle logic
has a fallback implementation that copies files to a new directory and
runs tar there, without using transform.
/Erik
> Mandy
More information about the build-dev
mailing list