Skip to content

cmd/go: regression: UTF-8 package import path fails on master, succeeds on go1.15.6 #43035

@maruel

Description

@maruel

What version of Go are you using (go version)?

$ go version
go version devel +3a65abfbda Tue Oct 13 20:13:25 2020 +0000 linux/amd64

Does this issue reproduce with the latest release?

Not on go1.15.6.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOOS="linux"

What did you do?

Run unit tests for corner cases for import paths.

What did you expect to see?

Non-ascii import path works.

What did you see instead?

Non-ascii import path fails as if it didn't exist.

cmd/panic/main.go:40:2: malformed import path "github.com/maruel/panicparse/v2/cmd/panic/internal/ùtf8": invalid char 'ù'

Source: https://github.com/maruel/panicparse/blob/v2.0.1/cmd/panic/internal/%C3%B9tf8/%C3%B9tf8.go

A bisect points to https://go-review.googlesource.com/c/go/+/258298
Paging author @bcmills

Bisected with golang checked out at $HOME/src-oth/golang and github.com/maruel/panicparse checked out at $HOME/src/panicparse:

$HOME/src-oth/bisect.sh:

#!/bin/bash
set -eu
git bisect reset
git checkout $(git merge-base origin/master go1.15.6)
git bisect start
git bisect good
git checkout origin/master
git bisect bad
git bisect run $HOME/src-oth/test.sh

and $HOME/src-oth/test.sh:

#!/bin/sh
set -eu
cd $HOME/src-oth/golang/src
./make.bash
cd $HOME/src/panicparse
$HOME/src-oth/golang/bin/go test ./cmd/panic

I used panicparse at origin/master but I expect v2.0.1 to have the same outcome.

To be clear, it's a corner case. I'm not sure there's a lot of people that create non-ascii package path name but it'd be sad if it regressed. Should probably have a unit test for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions