Skip to content

Fix: Do not add a newline after the cargo-nextest args#1030

Merged
ipetkov merged 1 commit intoipetkov:masterfrom
matthiasbeyer:fix-newline-nextestcall
Apr 28, 2026
Merged

Fix: Do not add a newline after the cargo-nextest args#1030
ipetkov merged 1 commit intoipetkov:masterfrom
matthiasbeyer:fix-newline-nextestcall

Conversation

@matthiasbeyer
Copy link
Copy Markdown
Contributor

When overriding the checkPhase and re-using the checkPhaseCargoCommand from the old mkCargoDerivation definition here, with all of cargoExtraArgs, cargoNextestExtraArgs and moreArgs empty, the trailing \ adds a newline to the cargo-nextest call, which causes scripts to misbehave in situations like:

RUST_LOG=off ${old.checkPhaseCargoCommand} --custom-arg || somethingElse

With this change, this trailing newline is removed, which makes the scenario described above work.

Motivation

Checklist

  • added tests to verify new behavior
  • added an example template or updated an existing one
  • updated docs/API.md (or general documentation) with changes
  • updated CHANGELOG.md

When overriding the checkPhase and re-using the checkPhaseCargoCommand
from the old mkCargoDerivation definition here, with all of
`cargoExtraArgs`, `cargoNextestExtraArgs` and `moreArgs` empty, the
trailing `\` adds a newline to the cargo-nextest call, which causes
scripts to misbehave in situations like:

    RUST_LOG=off ${old.checkPhaseCargoCommand} --custom-arg || somethingElse

With this change, this trailing newline is removed, which makes the
scenario described above work.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
@ipetkov
Copy link
Copy Markdown
Owner

ipetkov commented Apr 28, 2026

The newline should have been escaped but maybe something gets confused with the nesting in the '' string but thanks for the change regardless!

@ipetkov ipetkov enabled auto-merge (squash) April 28, 2026 00:21
@ipetkov ipetkov merged commit 5e0fb2f into ipetkov:master Apr 28, 2026
18 checks passed
@matthiasbeyer matthiasbeyer deleted the fix-newline-nextestcall branch April 28, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants