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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] aptos-cached-packages writes to cargo home if you use it in your dependencies tree #12664

Open
i1i1 opened this issue Mar 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@i1i1
Copy link

i1i1 commented Mar 25, 2024

馃悰 Bug: aptos-cached-packages writes to cargo home if you use it in your dependencies tree

Right now during build of move packages build directory is created inside of its sources. Imagine adding aptos-cached-packages as your dependency - it ends up modifying cloned sources from git.

This build workflow is not compliant with Cargo. Quoting cargo book:

In general, build scripts should not modify any files outside of OUT_DIR. It may seem fine on the first blush, but it does cause problems when you use such crate as a dependency, because there鈥檚 an implicit invariant that sources in .cargo/registry should be immutable. cargo won鈥檛 allow such scripts when packaging.

To reproduce

Create new package and add dependency to Cargo.toml:

[dependencies]
aptos-cached-packages = { git = "https://github.com/aptos-labs/aptos-core", tag = "aptos-cli-v3.0.1" }

And run cargo build.

Expected Behavior

Use OUT_DIR for all move packages build artifacts and build files.

System information

Please complete the following information:

  • Tag aptos-cli-v3.0.1 but applies to latter

Additional context

@i1i1 i1i1 added the bug Something isn't working label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant