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

Allow setting manual project root #1274

Closed
1 of 2 tasks
svenstaro opened this issue Jun 8, 2023 · 6 comments
Closed
1 of 2 tasks

Allow setting manual project root #1274

svenstaro opened this issue Jun 8, 2023 · 6 comments

Comments

@svenstaro
Copy link
Contributor

svenstaro commented Jun 8, 2023

Checklist

Describe your request

My project looks like this:

myproj
 |- .git
 |- some_other_stuff/my_thing.lol
 |- the_rust_thing_im_building/
 |- the_rust_thing_im_building/Cargo.toml
 |- the_rust_thing_im_building/Cross.toml
 |- the_rust_thing_im_building/build.rs

My build.rs needs to access some_other_stuff/my_thing.lol.

When building via Cross, I get paths such as this:

-v /home/svenstaro/myproj/the_rust_thing_im_building:/project
-w /project

However, I'd like it instead to be

-v /home/svenstaro/myproj/:/project
-w /project/the_rust_thing_im_building

I don't think this currently possible but it's a use case I have fairly often as my builds might need to access resources outside the current Cargo project.

Describe why this would be a good inclusion for cross

Currently I can probably throw some CROSS_CONTAINER_OPTS at it and wrestle it into submission but it would be great if this were a supported mode of operation.

@svenstaro
Copy link
Contributor Author

I also found #405 but I'm not sure it's exactly the use case here. At least I don't see how to hack that to work for me.

@Emilgardis
Copy link
Member

Emilgardis commented Jun 8, 2023

With current cross we have entirely gotten rid of the concept of /project, does that work better?

cargo install cross --git https://github.com/cross-rs/cross should handle this better basically

@svenstaro
Copy link
Contributor Author

I see. However, I still don't see how I can easily accomplish my use case here. Is there something I'm missing?

@Emilgardis
Copy link
Member

Emilgardis commented Jun 8, 2023

ah, sorry, you can use volumes

[build.env]
volumes = ["MY_THING=../some_other_stuff/my_thing.lol"]

or, if . is the workspace root (e.g has a Cargo.toml with [workspace] in it) it'd work fine as well.

@svenstaro
Copy link
Contributor Author

Ah hm, that does work for me! I'll consider this feature request void then. Would be great if you could cut a release some time soon! Last one is fairly long ago and this seems like an important feature to have.

@Emilgardis
Copy link
Member

these features should already be present in 0.2.5, and definitely yes we need to do a release...

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

No branches or pull requests

2 participants