Skip to content

cmd/compile: full go file paths produced in .a and bin files even with -trimpath #21720

@wak-google

Description

@wak-google

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

go1.9

Does this issue reproduce with the latest release?

Yes

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

linux/amd64

What did you do?

set GOPATH=/tmp/my-go-build/go
set CGO_CFLAGS="-fdebug-prefix-map=/tmp/my-go-build=/no-such-path"
go get -d leb.io/hashland
go build "-asmflags" "-trimpath=/tmp/my-go-build" "-gcflags" "-trimpath=/tmp/my-go-build" -v "leb.io/hashland/keccak"

What did you expect to see?

No references to my-go-build. This is the case on go1.8.3 and older

What did you see instead?

This produces a /tmp/my-go-build/go/pkg/linux_amd64/leb.io/hashland/keccak.a that contains a full path reference to /tmp/my-go-build even when the -trimpath flag was specified.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions