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: make it easier for toolexec authors to get access to full package path #15677

Closed
josharian opened this issue May 13, 2016 · 5 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@josharian
Copy link
Contributor

I'm writing a toolexec-able program for which I want to know the full package path for whatever code is being operated on. The code to figure out this package path is currently a pile of hacks. E.g. for compile, look for the -p arg. For asm, use -trimpath to figure out $WORK and then slice that off the -o arg. This breaks down entirely for invocations of cgo with -dynpackage.

I would like to have cmd/go pass extra information when toolexec is in use. For backwards compatibility, I propose to do this via an environment variable, something like TOOLEXEC_PKG_PATH (improvements welcome). There might be other, similar bits of data to add in the future.

Feedback and suggestions requested. I'm going to hack this in myself anyway, it's just a question of whether I should plan to mail a CL at the end (for 1.8, of course).

@josharian josharian self-assigned this May 13, 2016
@josharian josharian added this to the Go1.8 milestone May 13, 2016
@bradfitz
Copy link
Contributor

I had this same pain recently but figured I was just doing something wrong. Glad I'm not alone.

josharian added a commit to josharian/go that referenced this issue May 13, 2016
WIP

For golang#15677

Change-Id: Ifced6a0397abe3a296e0cdbc432637f6afd8c127
@quentinmit quentinmit added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Oct 6, 2016
@rsc
Copy link
Contributor

rsc commented Oct 21, 2016

OK. Let's do TOOLEXEC_IMPORTPATH for now.

@rsc rsc added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Oct 21, 2016
@rsc rsc modified the milestones: Go1.8Maybe, Go1.8 Nov 3, 2016
@rsc rsc modified the milestones: Go1.9, Go1.8Maybe Nov 11, 2016
@rsc rsc modified the milestones: Go1.10, Go1.9 Jun 22, 2017
@bradfitz bradfitz modified the milestones: Go1.10, Go1.11 Nov 28, 2017
@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Unplanned Jul 6, 2018
@mvdan
Copy link
Member

mvdan commented Aug 31, 2020

@josharian given that you self-assigned this, do you still intend to implement this? If not, I'd like to have a go for 1.16 :)

@josharian
Copy link
Contributor Author

All yours.

@gopherbot
Copy link

Change https://golang.org/cl/263357 mentions this issue: cmd/go: set TOOLEXEC_IMPORTPATH for -toolexec tools

@golang golang locked and limited conversation to collaborators Oct 22, 2021
@rsc rsc unassigned mvdan Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

7 participants