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

Unpacking of go1.12.linux-amd64.tar.gz with java fails #30593

Closed
krvs-esoptra opened this issue Mar 5, 2019 · 1 comment
Closed

Unpacking of go1.12.linux-amd64.tar.gz with java fails #30593

krvs-esoptra opened this issue Mar 5, 2019 · 1 comment

Comments

@krvs-esoptra
Copy link

What version of Go are you using (go version)?

$ go version
go1.12 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/var/lib/jenkins/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/var/lib/jenkins/go"
GOPROXY=""
GORACE=""
GOROOT="/var/lib/jenkins/tools/org.jenkinsci.plugins.golang.GolangInstallation/go-1.12"
GOTMPDIR=""
GOTOOLDIR="/var/lib/jenkins/tools/org.jenkinsci.plugins.golang.GolangInstallation/go-1.12/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build720322714=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Unpack of https://dl.google.com/go/go1.12.linux-amd64.tar.gz on a Jenkins slave

What did you expect to see?

go1.12 being installed on the Jenkins slave

What did you see instead?

The unpacking of the golang tar (by a java process) fails due to a couple of filenames in the tar containing non-ascii characters.
Error:
FATAL: Failed to install https://dl.google.com/go/go1.12.linux-amd64.tar.gz to /home/jenkins/jenkins_slave/tools/org.jenkinsci.plugins.golang.GolangInstallation/go-1.12
java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /home/jenkins/jenkins_slave/tools/org.jenkinsci.plugins.golang.GolangInstallation/go-1.12/go/test/fixedbugs/issue27836.dir/??main.go
at sun.nio.fs.UnixPath.encode(UnixPath.java:147)

Perhaps it is possible to solve the issue by tweaking the startup options of the java process (file.encoding, sun.jnu.encoding, ...)
But it would be more robust if the tar does not contain filenames with special characters. In earlier versions (e.g. 1.11.5 ) it was not yet the case.

@agnivade
Copy link
Contributor

agnivade commented Mar 5, 2019

The tar archive is in POSIX format which is the most recent and flexible format. It is perfectly valid to have non-ASCII names in a POSIX format tar archive.

In this case, the UTF-8 filename was needed for a test. So there is nothing much we can do about it. Even if we had light and full versions of the distribution, some version of it has to have this file.

I would suggest you to look into the java process extracting the archive and fixing some encoding attributes that you mentioned.

@agnivade agnivade closed this as completed Mar 5, 2019
@golang golang locked and limited conversation to collaborators Mar 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants