Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross targeting fails on Windows if target runtime contains symlinks #22

Open
aahlenst opened this issue Nov 7, 2020 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@aahlenst
Copy link
Contributor

aahlenst commented Nov 7, 2020

assertRequestSuccess(t, "http://localhost:8080/x64/linux/11.0.8+10?modules=java.base", "linux")
fails on Windows. The reason is that the tar.gz for Linux contains symlinks. Those cause archiver.Unarchive() to fail (as well as 7zip, so not archiver's fault) with the following error:

reading file in tar archive: C:\Users\andreas\AppData\Local\Temp\runtime_cache\OpenJDK11U-jdk_x64_linux_hotspot_11.0.8_10\jdk-11.0.8+10\legal\jdk.localedata\ASSEMBLY_EXCEPTION: making symbolic link for: symlink ..\java.base\ASSEMBLY_EXCEPTION C:\Users\andreas\AppData\Local\Temp\runtime_cache\OpenJDK11U-jdk_x64_linux_hotspot_11.0.8_10\jdk-11.0.8+10\legal\jdk.localedata\ASSEMBLY_EXCEPTION: A required privilege is not held by the client.

I'm not sure how to proceed here. https://pkg.go.dev/github.com/mholt/archiver/v3#TarGz has no option to ignore symlinks or continue on error. We could ignore the return code and continue no matter what, but I don't think this is desirable.

@cilki
Copy link
Member

cilki commented Nov 7, 2020

I had the same problem when creating an archive containing symlinks and added this line as a temporary solution:

_ = os.RemoveAll(filepath.FromSlash(output + "/legal"))

But I didn't have any problems extracting an archive with symlinks on Windows. I'll have to spin up a Windows VM and see what I can find.

@cilki cilki added the bug Something isn't working label Nov 7, 2020
@cilki cilki self-assigned this Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants