Closed XuJiandong closed 5 months ago
Is contracts/test-cargo-config
the direcotry for the member crate? It should work if you put the .cargo
dir in project/workspace root.
It works if .cargo dir is moved to the root. But this will affect all projects.
I think it's just how cargo works, i.e. .cargo/config.toml
in a member crate dir is ignored unless you run cargo from the particular dir.
https://doc.rust-lang.org/cargo/reference/config.html
At present, when being invoked from a workspace, Cargo does not read config files from crates within the workspace. i.e. if a workspace has two crates in it, named /projects/foo/bar/baz/mylib and /projects/foo/bar/baz/mybin, and there are Cargo configs at /projects/foo/bar/baz/mylib/.cargo/config.toml and /projects/foo/bar/baz/mybin/.cargo/config.toml, Cargo does not read those configuration files if it is invoked from the workspace root (/projects/foo/bar/baz/).
It's possible that the cargo command(or cross) isn't invoked in proper directory. In a capsule project, there are multiple script projects whichs don't share config.toml.
capsule new a project
set a wrong .cargo/config for this project. Like following:
This config is wrong: there is no such target-feature.
run
capsule build
. There is no error output. Some error like this should appear:It seems that .cargo/config.toml isn't used.