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

x/pkgsite: unable to publish a package with : in a file in testdata #68722

Closed
mitar opened this issue Aug 4, 2024 · 3 comments
Closed

x/pkgsite: unable to publish a package with : in a file in testdata #68722

mitar opened this issue Aug 4, 2024 · 3 comments
Labels
Milestone

Comments

@mitar
Copy link
Contributor

mitar commented Aug 4, 2024

What is the URL of the page with the issue?

https://pkg.go.dev/gitlab.com/tozd/go/fun

What is your user agent?

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Screenshot

No response

What did you do?

I am trying to publish a new version of my package. So I run:

GOPROXY=proxy.golang.org go list -m "gitlab.com/tozd/go/fun@v0.2.0

What did you see happen?

That the version is published and that I see a new version at https://pkg.go.dev/gitlab.com/tozd/go/fun.

What did you expect to see?

go: gitlab.com/tozd/go/fun@v0.2.0: reading https://proxy.golang.org/gitlab.com/tozd/go/fun/@v/v0.2.0.info: 404 Not Found
	server response:
	not found: create zip: testdata/expected-llama3:8b/1.txt: malformed file path "testdata/expected-llama3:8b/1.txt": invalid char ':'
	testdata/expected-llama3:8b/10.txt: malformed file path "testdata/expected-llama3:8b/10.txt": invalid char ':'
	testdata/expected-llama3:8b/11.txt: malformed file path "testdata/expected-llama3:8b/11.txt": invalid char ':'
	testdata/expected-llama3:8b/12.txt: malformed file path "testdata/expected-llama3:8b/12.txt": invalid char ':'
	testdata/expected-llama3:8b/13.txt: malformed file path "testdata/expected-llama3:8b/13.txt": invalid char ':'
	[Truncated: too long.]

The reason is that in testdata directory I have a sub-directory with : in it. It seems this breaks the publishing process?

I would expect that testdata directory is ignored by Go.

@mitar mitar added the pkgsite label Aug 4, 2024
@gopherbot gopherbot added this to the Unreleased milestone Aug 4, 2024
@seankhliao
Copy link
Member

colon is a reserved character for NTFS, tesdata is included in modules.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2024
@mitar
Copy link
Contributor Author

mitar commented Aug 4, 2024

What is testdata included in modules? That can lead to huge modules. I was under impression that testdata is ignored by Go. It says in go help test:

The go tool will ignore a directory named "testdata", making it available
to hold ancillary data needed by the tests.

So it seems go tool is not ignoring it. I think that should be at least documented if not fixed (by ignoring it for real).

mitar added a commit to tozd/go-fun that referenced this issue Aug 4, 2024
@ianlancetaylor
Copy link
Contributor

go test ignores testdata, as do commands that look for packages in the hierarchy of directories. But the files in testdata are expected to be used by tests, so they are part of a module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants