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

Look into -linkobj flag for compiles #96

Open
peterebden opened this issue May 5, 2023 · 0 comments
Open

Look into -linkobj flag for compiles #96

peterebden opened this issue May 5, 2023 · 0 comments

Comments

@peterebden
Copy link
Contributor

go tool compile supports splitting the actual compiled code from the export info that other packages need to compile against. This is achieved by passing -linkobj (the -o target then contains only the export info).

Theoretically we could take advantage of this to improve incrementality; altering the implementation of a function but not its signature (or just altering non-exported functions) would then not cause rebuilds of anything downstream except the final binaries.

This isn't super easy to achieve though. Adding the flag & extra output obviously isn't hard but we can't provide a specific output of a target. It could be done by splitting into two actions but then we're doubling the compile work which seems basically worse. It's not dissimilar to how our C++ rules work but they get around it because they can just spit out their headers, whereas here both are outputs of the compiler. We may need some kind of extension to Please to support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant