You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
// #cgo CFLAGS: -I"${SRCDIR}/include"import"C"funcmain() {
}
What did you expect to see?
Expected successful compilation/execution of the program.
What did you see instead?
# go run silly.go
package main: /somewhere/a%2Fb/silly.go: malformed #cgo argument: -I/somewhere/a%2Fb/include
This happens for CFLAGS and LDFLAGS on multiple architectures.
Related to #7906, #16455, #11868, which all discuss spaces in paths; there are issues with other valid path characters as well.
This path was not something I created naturally; it was a side-effect of our CI environment (Jenkins) which occasionally uses paths like foo%2Fbar if a Git branch has a name "foo/bar". It also can create paths like foo%2Fbar@2 when a second scratch directory is needed.
The text was updated successfully, but these errors were encountered:
The list of allowed characters for $SRCDIR is src/go/build/build.go's safeString. % is not one of them.
I am a bit wary of adding % for fear that it will lead to environment variable interpolation on Windows,
but I guess we can try it.
What version of Go are you using (
go version
)?go version go1.6.3 linux/amd64
Also tested with go version go1.6.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Save this Go program as
a%2fb/silly.go
:What did you expect to see?
Expected successful compilation/execution of the program.
What did you see instead?
This happens for
CFLAGS
andLDFLAGS
on multiple architectures.Related to #7906, #16455, #11868, which all discuss spaces in paths; there are issues with other valid path characters as well.
This path was not something I created naturally; it was a side-effect of our CI environment (Jenkins) which occasionally uses paths like
foo%2Fbar
if a Git branch has a name "foo/bar". It also can create paths likefoo%2Fbar@2
when a second scratch directory is needed.The text was updated successfully, but these errors were encountered: