Skip to content

Cannot pass cargo test -- args with default target #1764

@flaviojs

Description

@flaviojs

Checklist

Describe your issue

I have a Cross.toml with a default target to avoid having to pass the target argument manually:

[build]
default-target = "powerpc-unknown-linux-gnu"

While running cross test -vv -- --show-output I get:

(...cut...)
+ rustup target list --toolchain nightly-x86_64-unknown-linux-gnu
+ rustup component list --toolchain nightly-x86_64-unknown-linux-gnu
+ /usr/bin/podman
+ /usr/bin/podman run --userns host (...cut...) cargo test -vv -- --show-output --target powerpc-unknown-linux-gnu'
(...cut...)
     Running `(...cut...) --show-output --target powerpc-unknown-linux-gnu`
error: Unrecognized option: 'target'
error: test failed, to rerun pass `--lib

so the real problem is cross adding "--target powerpc-unknown-linux-gnu" to cargo test after the "--" argument.

cross should place the target argument before "--" for any cargo command that supports "--", like cargo test.

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

powerpc-unknown-linux-gnu

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5

Example

No response

Additional information / notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions