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

improve support for cargo workspaces #273

Open
0xalpharush opened this issue Nov 7, 2023 · 0 comments
Open

improve support for cargo workspaces #273

0xalpharush opened this issue Nov 7, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@0xalpharush
Copy link

0xalpharush commented Nov 7, 2023

I am getting an error like Error: package '/Users/alpharush/tob/../Cargo.toml' is a member of the wrong workspace. Can we improve support for cargo workspaces?

Probably relevant to the fix:

siderophile/src/main.rs

Lines 41 to 67 in debb857

let config = cargo::Config::default()?;
let workspace_root = cargo::util::important_paths::find_root_manifest_for_wd(config.cwd())?;
let ws = cargo::core::Workspace::new(&workspace_root, &config)?;
let mut ws = if let Some(name) = &args.package {
let package =
find_package(&ws, name).ok_or_else(|| anyhow!("Could not find package `{}`", name))?;
Workspace::ephemeral(package.clone(), &config, None, false)?
} else {
ws
};
let tempdir = tempdir_in(config.cwd())?;
ws.set_target_dir(Filesystem::new(tempdir.path().to_path_buf()));
let crate_name = crate_name(&ws, &args.package)?;
if let Some(deprecated_crate_name) = &args.crate_name {
eprintln!("Warning: `--crate-name` is deprecated. Use `--package` instead.");
if deprecated_crate_name != &crate_name {
bail!(
"Crate `{}` was specified, but crate `{}` was found",
deprecated_crate_name,
crate_name
);
}
}

Maybe related to #31

@woodruffw woodruffw added enhancement New feature or request help wanted Extra attention is needed labels Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants