have a project including cgo headers using ${SRCDIR}
move that project to a new directory
build
Result:
ld: warning: directory not found for option '-L/Users/josh/...redacted...
The redacted directory is the previous directory pointed to by the ${SRCDIR} directive in the cgo sources.
After a go clean -cache, the error disappeared.
I suspect that cmd/go's caching may be too effective here. It probably doesn't take into account the absolute path containing the project, but it may need to when the ${SRCDIR} cgo directive is present.
When this is fixed, we should also test with -trimpath. When -trimpath is passed, most paths are not included in the cache key, but I think ${SRCDIR} needs to be there in any case.
bcmills
changed the title
cmd/go: include source dir in cache key when ${SRCDIR} present in cgo header?
cmd/go: include source dir in cache key when ${SRCDIR} is present in cgo header
Jan 10, 2020
What I did:
${SRCDIR}
Result:
ld: warning: directory not found for option '-L/Users/josh/...redacted...
The redacted directory is the previous directory pointed to by the
${SRCDIR}
directive in the cgo sources.After a
go clean -cache
, the error disappeared.I suspect that cmd/go's caching may be too effective here. It probably doesn't take into account the absolute path containing the project, but it may need to when the
${SRCDIR}
cgo directive is present.cc @bcmills @jayconrod
The text was updated successfully, but these errors were encountered: