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

cmd/go: include source dir in cache key when ${SRCDIR} is present in cgo header #36471

Open
josharian opened this issue Jan 9, 2020 · 2 comments
Open
Milestone

Comments

@josharian
Copy link
Contributor

@josharian josharian commented Jan 9, 2020

What I did:

  • 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.

cc @bcmills @jayconrod

@jayconrod jayconrod added the NeedsFix label Jan 9, 2020
@jayconrod jayconrod added this to the Go1.15 milestone Jan 9, 2020
@jayconrod
Copy link
Contributor

@jayconrod jayconrod commented Jan 9, 2020

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 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
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 16, 2020

Moving to backlog milestone.

@ianlancetaylor ianlancetaylor modified the milestones: Go1.15, Backlog Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.