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

proposal: cmd/compile: require build systems to specify -importcfg #51225

Open
mdempsky opened this issue Feb 16, 2022 · 0 comments
Open

proposal: cmd/compile: require build systems to specify -importcfg #51225

mdempsky opened this issue Feb 16, 2022 · 0 comments
Labels
Projects
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Feb 16, 2022

Originally, cmd/compile implemented a lot of logic for resolving import paths, finding installed packages, etc. internally. Nowadays, this is all handled by cmd/go instead, which then invokes cmd/compile with the -importcfg option. However, a lot of historical code and flags still exist within cmd/compile, and it's not obvious which use cases still matter.

The proposal here is to require build systems that want predictable behavior from cmd/compile must use -importcfg. If -importcfg is not used, then cmd/compile's handling of import paths is unspecified and subject to change at the discretion of the compiler team.

In practice, I don't anticipate the fallback logic to change much from today (to avoid breaking test/run.go or compiler dev workflows). But the current code has grown convoluted and has questionable code paths, and it would be easier to cleanup if we could constrain the set of supported options.

@mdempsky mdempsky added this to the Go1.19 milestone Feb 16, 2022
@ianlancetaylor ianlancetaylor added this to Incoming in Proposals Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Proposals
Incoming
Development

No branches or pull requests

1 participant