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

cargo deb looks for target-specific configuration in target directory #84

Closed
domenicquirl opened this issue Apr 24, 2023 · 4 comments
Closed

Comments

@domenicquirl
Copy link

Hi, cargo deb doesn't seem to pick up a target-specific strip command if I set $CARGO_TARGET_DIR to a non-local folder (such as /target or whatever). I'd expect this to not influence loading a project's config, as cargo loads from the project directory (and up) or $CARGO_HOME, not $CARGO_TARGET_DIR, and it picks up config values like aliases just fine with this setup.

I think what might be happening is that Config::cargo_config passes self.target_dir to CargoConfig::new, which expects a project_path instead.

It also seems a little inconsistent to read $HOME from the environment to check a user-wide configuration, but not $CARGO_HOME (the Cargo Book lists $CARGO_HOME/config.toml as the global configuration directory, which the current behaviour matches for the default cargo home directory, I assume you already knew this). At least, that makes it quite annoying to work around this, because I have to actually put the config inside the target directory (the build itelf is running inside a Docker container).

@domenicquirl
Copy link
Author

While this is an issue, I also want to say that cargo-deb generally handles the setup very well otherwise. Including some very nice things like automatically resolving the path of assets that are targets - that was very welcome, so thanks for that!

@kornelski
Copy link
Owner

You're right that target dir shouldn't be used for config, and that conflated it with manifest dir. Can you make a PR?

@domenicquirl
Copy link
Author

Opened #85 with a fix. It includes looking into CARGO_HOME as well, but you can let me know how you'd like to proceed there.

@kornelski
Copy link
Owner

Thank you

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

No branches or pull requests

2 participants