-
Notifications
You must be signed in to change notification settings - Fork 121
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
Recursively descend into crates NOT in workspace? #415
Comments
interesting problem. let me think of how i can set a 'workspace' mode without a real workspace. |
@connorkuehl this is now implemented in the 0.30.6 development branch. The docs to set it up: basically: [env]
# this is optional of course...
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"
# this tells cargo-make that this directory acts as a workspace root
CARGO_MAKE_WORKSPACE_EMULATION = true
# a list of crate members. since we do not have a Cargo.toml, we will need to specify this in here.
CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = "member1;member2" |
Hi @sagiegurari! Wow! That was quick. It seems to work well! I can't speak to some of the more advanced configurations because for our purposes we are mainly just building, testing, running I don't think Cargo workspaces do this, but do you think that I think that might allow for some interesting flexibility with 'cargo make'. I was able to accomplish an overall build with that same directory structure by just using the full filepaths for members of course. Example of that. I'd be happy to help in any way I can with this. Also, is there any way to list the members for the environment variable on their own separate lines? the |
env_scripts = [
'''
#!@duckscript
handle = array()
array_push ${handle} member1
array_push ${handle} member2
array_push ${handle} member3
array_push ${handle} member4
members = array_join ${handle} ;
set_env CARGO_MAKE_CRATE_WORKSPACE_MEMBERS ${members}
'''
] |
That's fair. We're just trying to think of ways to organize our repo. Thanks for the great work on this! |
shouldn't this be an array instead of a |
that's good feedback. |
just thought, the question is why the var is string and not an array type, and not how to define it. so those variables are basically environment variables. as such its a map<string,string> structure. |
@connorkuehl @haraldh based on your feedback, i now support arrays, so it can be more easily defined as follows: CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = [
"member1",
"member2"
] |
both features have been released in 0.30.6 version. |
Is there any way to set up a root-level Makefile such that 'cargo make' can be ran at the root folder and it will descend into other folders which contain crates?
We specifically cannot use cargo workspaces due to how cargo coalesces features which complicates things for us when we have a number of crates that are using the same dependency like
libc
inno_std
andstd
modes.For example, our repository looks something like this:
I'd like to be able to just run 'cargo make build' or some other target at the top level and have 'cargo make' descend into these crates and execute the target.
The text was updated successfully, but these errors were encountered: