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

create_rust_makefile not Cargo workspace aware, target dir is hardcoded #295

Open
wilsonzlin opened this issue Dec 23, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@wilsonzlin
Copy link

wilsonzlin commented Dec 23, 2023

It appears that the create_rust_makefile is hardcoded to assume that the target dir is at target, instead of querying the cargo metadata. This makes it break when building a crate in a workspace (the cp command to copy the output library fails), which is reasonably common. I'm not familiar with Ruby, Rake, or how the Makefile is generated and executed so please correct me if I'm wrong.

Perhaps something like this could be useful? For example, cargo metadata | jq -r .target_directory.

So far, I have only been able to work around this by setting the RB_SYS_CARGO_TARGET_DIR environment variable to the absolute path of the workspace target dir. I tried setting do |r| r.target_dir = ... but this doesn't seem to have any effect.

@ianks
Copy link
Collaborator

ianks commented Dec 26, 2023

Hey thanks for the report. We actually already query cargo metadata elsewhere in the crate, so perhaps we could leverage that in some way

@ianks ianks added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants