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

Build plan should more clearly distinguish custom build steps #5719

Closed
luser opened this issue Jul 12, 2018 · 7 comments · Fixed by #6331
Closed

Build plan should more clearly distinguish custom build steps #5719

luser opened this issue Jul 12, 2018 · 7 comments · Fixed by #6331
Assignees
Labels
Z-build-plan Nightly: --build-plan feature

Comments

@luser
Copy link
Contributor

luser commented Jul 12, 2018

Currently each build script in a build produces two invocations in the build plan--one to compile the build script, and one to run it. However, they both have "target_kind": ["custom-build"] so it's difficult to distinguish them when consuming a build plan.

In my cargo-build-plan-graph tool I wound up using a heuristic that I do not love. It would be better if they had unique target_kind keys or some other straightforward way to distinguish them.

Here's a sample build plan from sccache.

@Mark-Simulacrum
Copy link
Member

For now a better heuristic might be endswith("build-script-build")

@ehuss
Copy link
Contributor

ehuss commented Jul 16, 2018

I think that would be starts_with("build-script-") since the user can change the name with the build key.

@Mark-Simulacrum
Copy link
Member

Huh, I never thought about the build being user dependent; is that documented anywhere? It seems needlessly complicated...

@ehuss
Copy link
Contributor

ehuss commented Jul 17, 2018

The key is documented in build scripts and the manifest reference. It doesn't really talk about the binary/crate name of the build script, presumably because that's not something that's really relevant to most users.

@dwijnand
Copy link
Member

Is changing the target_kind something we're happy to change in Cargo? (post soft freeze)

@ehuss
Copy link
Contributor

ehuss commented Oct 24, 2018

It might get complicated if something like #5855 is implemented. Something like Doctest would appear with target_kind=["lib"] with no other distinction. target_kind could be sort of a mix between TargetKind and CompileMode. I'm trying to think if it would be better to keep them separate, but I can't think of a good one.

@ehuss
Copy link
Contributor

ehuss commented Oct 24, 2018

cc #5508 which also discusses the problems with target_kind in the build-plan.

@dwijnand dwijnand self-assigned this Nov 18, 2018
bors added a commit that referenced this issue Nov 19, 2018
…r=alexcrichton

Distinguish custom build invocations

Distinguish building a build script from running it,
in build plan invocations.

Fixes #5719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-build-plan Nightly: --build-plan feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants