Re: [go-nuts] Leading dash invalid in test filename inside module

2021-08-18 Thread Ben Hoyt
Awesome, thanks. At a previous company, we used to take months/years to
upgrade to a new Go version, so it's nice that you guys are eating your own
dog food so quickly. :-)

For now, I've removed the leading-dash test file and released a new patch
version. When I reinstate it I may end up putting that file in a
subdirectory in any case, just because it's weird to have a file named
"-ftest" in the repo's root.

-Ben

On Thu, Aug 19, 2021 at 11:17 AM Jay Conrod  wrote:

> You're exactly right, the proxy is still in the process of migrating to Go
> 1.17. It should be done in the next day or two, at which point it should be
> able to fetch this version.
>
> In the mean time, you can work around it by setting GOPRIVATE=
> github.com/benhoyt/goawk , which
> tells the go command to fetch that module directly from vcs and not to
> contact GOSUMDB for it.
>
> On Wed, Aug 18, 2021 at 2:57 PM Ben Hoyt  wrote:
>
>> (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
>> 
>> .
>>
>

-- 
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/CAL9jXCHoo3LeGL7xxnwOX0bqpZBtvPv%2Br59d%2BGZ9%3DuT_KOAjTQ%40mail.gmail.com.


Re: [go-nuts] Leading dash invalid in test filename inside module

2021-08-18 Thread 'Jay Conrod' via golang-nuts
You're exactly right, the proxy is still in the process of migrating to Go
1.17. It should be done in the next day or two, at which point it should be
able to fetch this version.

In the mean time, you can work around it by setting GOPRIVATE=
github.com/benhoyt/goawk , which
tells the go command to fetch that module directly from vcs and not to
contact GOSUMDB for it.

On Wed, Aug 18, 2021 at 2:57 PM Ben Hoyt  wrote:

> (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
> 
> .
>

-- 
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/CAGCADbZio42hMnvb0knx6z2iZsKCydy-UZyo3zrqMLP5OnfJnQ%40mail.gmail.com.


[go-nuts] Leading dash invalid in test filename inside module

2021-08-18 Thread Ben Hoyt
(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.