Checklist
Describe your issue
Running CROSS_REMOTE=1 cross metadata prints /target as the target_directory value. This does not match the directory used in practice.
What target(s) are you cross-compiling for?
No response
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.5 (4282f2f 2023-12-27)
Example
I am writing a script to automate cross-compilation of [one of my projects]. As part of this, I want to find the output binary and move copy it for packaging.
To achieve this, I run cross build with the --message-format=json option to get the build path. In my case, cross build yields "/cross/data/projects/eternaltwin/etwin/bin/target/x86_64-unknown-linux-gnu/release/eternaltwin".
Details
{
"reason": "compiler-artifact",
"package_id": "eternaltwin 0.13.0 (path+file:///cross/data/projects/eternaltwin/etwin/bin)",
"manifest_path": "/cross/data/projects/eternaltwin/etwin/bin/Cargo.toml",
"target": {
"name": "eternaltwin",
"kind": [
"bin"
],
"crate_types": [
"bin"
],
"required-features": [],
"src_path": "/cross/data/projects/eternaltwin/etwin/bin/src/main.rs",
"edition": "2021",
"doctest": false,
"test": true,
"doc": true
},
"profile": {
"opt_level": "z",
"debuginfo": 0,
"debug_assertions": false,
"overflow_checks": false,
"test": false
},
"features": [],
"filenames": [
"/cross/data/projects/eternaltwin/etwin/bin/target/x86_64-unknown-linux-gnu/release/eternaltwin"
],
"executable": "/cross/data/projects/eternaltwin/etwin/bin/target/x86_64-unknown-linux-gnu/release/eternaltwin",
"fresh": false
}
This implies that the target directory used by the build is /cross/data/projects/eternaltwin/etwin/bin/target. However, when I run CROSS_REMOTE=1 cross metadata then I get /target for the target directory.
Details
https://gist.github.com/demurgos/77188279ee51de1f5af06d22c020b045
This discrepancy makes it impossible to reliably find the path of the executable relative to the target directory.
Additional information / notes
Also tested on
$ cross --version
cross 0.2.5 (202013b 2023-03-24)
[cross] note: Falling back to `cargo` on the host.
cargo 1.75.0 (1d8b05cdd 2023-11-20)
This was the first version with a fix for #1218; but the issue is already present there.
Checklist
Describe your issue
Running
CROSS_REMOTE=1 cross metadataprints/targetas thetarget_directoryvalue. This does not match the directory used in practice.What target(s) are you cross-compiling for?
No response
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.5 (4282f2f 2023-12-27)
Example
I am writing a script to automate cross-compilation of [one of my projects]. As part of this, I want to find the output binary and move copy it for packaging.
To achieve this, I run
cross buildwith the--message-format=jsonoption to get the build path. In my case,cross buildyields"/cross/data/projects/eternaltwin/etwin/bin/target/x86_64-unknown-linux-gnu/release/eternaltwin".Details
{ "reason": "compiler-artifact", "package_id": "eternaltwin 0.13.0 (path+file:///cross/data/projects/eternaltwin/etwin/bin)", "manifest_path": "/cross/data/projects/eternaltwin/etwin/bin/Cargo.toml", "target": { "name": "eternaltwin", "kind": [ "bin" ], "crate_types": [ "bin" ], "required-features": [], "src_path": "/cross/data/projects/eternaltwin/etwin/bin/src/main.rs", "edition": "2021", "doctest": false, "test": true, "doc": true }, "profile": { "opt_level": "z", "debuginfo": 0, "debug_assertions": false, "overflow_checks": false, "test": false }, "features": [], "filenames": [ "/cross/data/projects/eternaltwin/etwin/bin/target/x86_64-unknown-linux-gnu/release/eternaltwin" ], "executable": "/cross/data/projects/eternaltwin/etwin/bin/target/x86_64-unknown-linux-gnu/release/eternaltwin", "fresh": false }This implies that the target directory used by the build is
/cross/data/projects/eternaltwin/etwin/bin/target. However, when I runCROSS_REMOTE=1 cross metadatathen I get/targetfor the target directory.Details
https://gist.github.com/demurgos/77188279ee51de1f5af06d22c020b045
This discrepancy makes it impossible to reliably find the path of the executable relative to the target directory.
Additional information / notes
Also tested on
This was the first version with a fix for #1218; but the issue is already present there.