cross-rs / cross

“Zero setup” cross compilation and “cross testing” of Rust crates
Apache License 2.0
6.4k stars 359 forks source link

Config via `package.metadata` does not get read when in a workspace #1381

Closed tgross35 closed 8 months ago

tgross35 commented 8 months ago

Checklist

Describe your issue

I have a Cargo.toml with the following dummy command:

[package.metadata.cross.build]
pre-build = ["IOIOOIJOIJI"]

As expected, running cross fails:

$ cross t --target aarch64-unknown-linux-musl
[+] Building 0.9s (5/5) FINISHED                                                docker:default
 => [internal] load build definition from Dockerfile.aarch64-unknown-linux-musl-custom    0.1s
 => => transferring dockerfile: 250B                                                      0.0s
 => [internal] load .dockerignore                                                         0.1s
 => => transferring context: 2B                                                           0.0s
 => [internal] load metadata for ghcr.io/cross-rs/aarch64-unknown-linux-musl:0.2.5        0.0s
 => [1/2] FROM ghcr.io/cross-rs/aarch64-unknown-linux-musl:0.2.5                          0.5s
 => ERROR [2/2] RUN eval "IOIOOIJOIJI"                                                    0.3s
------
 > [2/2] RUN eval "IOIOOIJOIJI":
0.258 /bin/sh: 1: eval: IOIOOIJOIJI: not found

However: putting the package in a workspace, i.e. adding an entry in a higher-level Cargo.toml, seems to make this pre-build script get skipped.

What target(s) are you cross-compiling for?

aarch64-unknown-linux-musl

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 -.2.5

Example

No response

Additional information / notes

No response

Emilgardis commented 8 months ago

This is related to / a duplicate of https://github.com/cross-rs/cross/issues/1158

tgross35 commented 8 months ago

Ah yes, thanks