Skip to content

Leading spaces before shebang break custom cargo runner #11254

Open
@andre-richter

Description

@andre-richter

Problem

Newer versions of cargo fail to execute a test runner shell script which has leading spaces before the shebang.

Earlier versions of cargo were immune to this.

Steps

.cargo/config.toml:

[target.x86_64-unknown-linux-gnu]
runner = "./indented_bash_script.sh"

indented_bash_script.sh:

    #!/bin/bash

echo "I don't work
$ cargo test
error: test failed, to rerun pass '--lib'

Caused by:
  could not execute process `/tmp/foo/./indented_bash_script.sh /tmp/foo/target/debug/deps/foo-918a0726eb7b9123` (never executed)

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.64.0 (387270bc7 2022-09-16)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugP-lowPriority: LowS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions