Skip to content

Commit

Permalink
Avoid unicode filename
Browse files Browse the repository at this point in the history
This is similar to 53e9d3e.

Over at https://github.com/cockroachdb/cockroach, we use bazel and it
chokes on this file:

```
java.io.IOException: Error extracting
[...]/com_github_maruel_panicparse_v2-v2.2.1.zip to [...]:
[...]/com_github_maruel_panicparse_v2/cmd/panic/internal/utf8/?tf8.go
(Illegal byte sequence)
```

which is why we're on a fork so far. It would be nice to avoid this.

There is an (eternal, it seems) [upstream discussion], so there is
little home of bazel starting to support non-unicode filenames.

I wonder if the loss in test coverage (if any) is acceptable in return
for avoiding build problems like the ones we've been seeing.

[upstream discussion]: bazelbuild/bazel#374
  • Loading branch information
tbg committed May 13, 2022
1 parent c579e89 commit d87647d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// that can be found in the LICENSE file.

// Package ùtf8 tests a package and function with non-ASCII names.
//
// The filename itself does not contain unicode as this causes issues
// importing panicparse under bazel. For more context, see PR #78.
package ùtf8

// Strùct is a totally normal structure with a totally normal name.
Expand Down
2 changes: 1 addition & 1 deletion stack/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,7 @@ func testPanicUTF8(t *testing.T, s *Snapshot, b *bytes.Buffer, ppDir string) {
),
// See TestCallUTF8 in stack_test.go for exercising the methods on
// Call in this situation.
pathJoin(ppDir, "internal", "utf8", "ùtf8.go"),
pathJoin(ppDir, "internal", "utf8", "utf8.go"),
10),
newCallLocal("main.glob..func21", Args{}, pathJoin(ppDir, "main.go"), 322),
newCallLocal("main.main", Args{}, pathJoin(ppDir, "main.go"), 340),
Expand Down
10 changes: 5 additions & 5 deletions stack/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ func TestCallPkg(t *testing.T) {
// See testPanicUTF8 in context_test.go.
name: "UTF8",
f: "github.com/maruel/panicparse/cmd/panic/internal/%c3%b9tf8.(*Strùct).Pànic",
s: "/gpremote/src/github.com/maruel/panicparse/cmd/panic/internal/ùtf8/ùtf8.go",
DirSrc: pathJoin("ùtf8", "ùtf8.go"),
SrcName: "ùtf8.go",
LocalSrcPath: "/gplocal/src/github.com/maruel/panicparse/cmd/panic/internal/ùtf8/ùtf8.go",
RelSrcPath: "github.com/maruel/panicparse/cmd/panic/internal/ùtf8/ùtf8.go",
s: "/gpremote/src/github.com/maruel/panicparse/cmd/panic/internal/ùtf8/utf8.go",
DirSrc: pathJoin("ùtf8", "utf8.go"),
SrcName: "utf8.go",
LocalSrcPath: "/gplocal/src/github.com/maruel/panicparse/cmd/panic/internal/ùtf8/utf8.go",
RelSrcPath: "github.com/maruel/panicparse/cmd/panic/internal/ùtf8/utf8.go",
ImportPath: "github.com/maruel/panicparse/cmd/panic/internal/ùtf8",
Location: GOPATH,
},
Expand Down

0 comments on commit d87647d

Please sign in to comment.