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

Add support for test build scripts #1581

Closed
erickt opened this issue May 5, 2015 · 6 comments

Comments

@erickt
Copy link
Contributor

commented May 5, 2015

Testing code generation projects like quasi is a little difficult because I would like to use quasi to generate some test files, but I can't since the build scripts are compiled before the main project. As a work around I can add a test crate that depends on quasi, but it would be more convenient if the quasi Cargo.toml file had a test-build script that can depend on the current project and gets run before the tests.

@pnkfelix

This comment has been minimized.

Copy link
Member

commented Oct 19, 2015

Indeed, I was expecting to be able to put a demonstration of code-generation tool by putting a cargo project into the examples/ directory of the codegen tool, and naively assumed that cargo test would build the example.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Oct 19, 2015

I think that using build scripts for code generation is relatively common, and this seems like a pretty clear-cut thing that can be added! From a high-level design perspective, there's two possible routes I think we could take:

  1. Invoke current build scripts with a different set of arguments.
  2. Add a new dev-build entry to the manifest which is used whenever dev-dependencies are used as well.

I think (1) should be avoided because it'd probably break many existing build scripts (which aren't expected to run twice) and it also doesn't allow for dev-build-specific dependencies. Using (2) allows existing build scripts to be backwards compatible as well as adding a new dev-build-dependencies section to the manifest for those only used by the dev-build script.

This is a pretty meaty project, however, and it skirts the line of "this requires an RFC", but I'd be willing to help anyone who wishes to implement!

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Oct 19, 2015

Also cc #1430 (build scripts for just binaries) and #1162 which may start being required for this to become usable.

@alobb

This comment has been minimized.

Copy link

commented Mar 25, 2017

I'd be interested in taking a look at this, but don't have any idea where to start.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Mar 27, 2017

@alobb I think that we've pushed Cargo enough to its limits recently that given issues like this, #1430, and #1982 we may wish to explore an RFC in this space before tackling this issue specifically.

@carols10cents

This comment has been minimized.

Copy link
Member

commented Sep 10, 2017

Closing since this needs an RFC.

@marmistrz marmistrz referenced this issue Aug 21, 2019
0 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.