(I wasn't quite sure whether golang-nuts or golang-dev was the best place
for this -- sending to golang-nuts for now.)

I just released a new version of GoAWK (v1.8.0) using Go version 1.17, and
then tested installing it using "go install". However, go install complains
with the following:

$ go install github.com/benhoyt/goawk@latest
go: downloading github.com/benhoyt/goawk v1.8.0
go install: github.com/benhoyt/goawk@latest: github.com/benhoyt/goawk@v1.8.0:
verifying module: github.com/benhoyt/goawk@v1.8.0: reading
https://sum.golang.org/lookup/github.com/benhoyt/goawk@v1.8.0: 410 Gone
server response: not found: create zip: -ftest: malformed file path
"-ftest": leading dash

Sure enough, I had a file in the repo's top-level directory called "-ftest"
(the "-" is a regular ASCII hyphen or "dash"). This file was used in tests,
to test whether the program's command line handling distinguished flags
from file names correctly.

It looks like this error is coming from Go's module code, in the checkPath
function:
https://cs.opensource.google/go/x/mod/+/refs/tags/v0.5.0:module/module.go;l=397

However, the module docs on file naming constraints don't seem to mention
this constraint: https://golang.org/ref/mod#zip-path-size-constraints

"File and directory names within a module may consist of Unicode letters,
ASCII digits, the ASCII space character (U+0020), and the ASCII punctuation
characters !#$%&()+,-.=@[]^_{}~. Note that package paths may not contain
all these characters. See module.CheckFilePath and module.CheckImportPath
for the differences."

I checked the module.CheckFilePath and module.CheckImportPath doc comments,
and they don't seem to mention a leading dash being a problem, either. The
/ref/mod doc *does* say that for module paths, "The leading path element
... must contain at least one dot and cannot start with a dash." However,
this is stated only for module paths, not for general file paths.

I noticed a related issue (https://github.com/golang/go/issues/45447) and
change (https://go-review.googlesource.com/c/mod/+/316629/) for "embed"
that looks like it would fix this issue -- the code now only does this
"leading dash" check for file paths, not import paths.

However, the "leading dash" error is a server response, so I suspect the
code running on Google's servers is not running Go 1.17 and doesn't have
this fix.

Will this just fix itself after Google compiles the server with Go 1.17? Or
is another fix required, even if it's just mentioning that constraint in
the docs?

-Ben

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAL9jXCFB0Ww427mx2pbB0MJf2c_3mTSw%2BQhwbRt%3D13ufF7Q-Nw%40mail.gmail.com.

Reply via email to