Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--override-input as EXTRA_NIX_ARGS is broken #438

Closed
shivaraj-bh opened this issue Mar 12, 2025 · 3 comments · Fixed by #439
Closed

--override-input as EXTRA_NIX_ARGS is broken #438

shivaraj-bh opened this issue Mar 12, 2025 · 3 comments · Fixed by #439

Comments

@shivaraj-bh
Copy link
Member

I have added a test in 65bbe90, which is expected to pass. But fails with:

> cargo test -p omnix-cli command::ci::test_haskell_multi_nix_override_input
...
test command::ci::test_haskell_multi_nix_override_input ... FAILED

failures:

---- command::ci::test_haskell_multi_nix_override_input stdout ----
Error: Failed to run `om ci run`:

👟 Reading om.ci config from flake
❄️  nix --override-input haskell-flake github:srid/haskell-flake/c8622c8a259e18e0a1919462ce885380108a723c build '/nix/store/j252k66dnma68pygfqhk8pwacdyykcyh-nix-rs-flake-metadata#default' -L --print-out-paths --no-link --override-input flake github:srid/haskell-multi-nix/c85563721c388629fa9e538a1d97274861bc8321 --override-input include-inputs /nix/store/wb47j3cp8fjjgidlqlr2mhwi5zwmvsqh-source️
error: unrecognised flag '--override-input'
Try 'nix --help' for more information.
Error: Flake function error: `nix build` failed; exit code: Some(1)

Caused by:
    `nix build` failed; exit code: Some(1)

The test passes in 187547c but fails starting from 5485408

@shivaraj-bh shivaraj-bh changed the title —override-input as EXTRA_NIX_ARGS is broken --override-input as EXTRA_NIX_ARGS is broken Mar 12, 2025
@shivaraj-bh
Copy link
Member Author

shivaraj-bh commented Mar 12, 2025

semantically it makes sense to not treat --override-input as EXTRA_NIX_ARGS as it is extra args for some subcommands of nix. But since there was a change in behaviour, I was wondering what could be the alternative way to pass --override-input to only subcommands that supports it? (Without an alternative, CI workflows internally at Juspay will break)

@srid srid added bug Something isn't working case-for-tests and removed bug Something isn't working labels Mar 12, 2025
@srid
Copy link
Member

srid commented Mar 12, 2025

The particular problem in this case is to do with position of the argument, not its kind itself. --override-input should appear after the subcommand, build, and not before that. Nix's CLI parser is rather retarded 🤷🏾

❯ cargo run -p omnix-cli -- ci run github:srid/haskell-template -- --override-input flake-parts github:hercules-ci/flake-parts
[..]
👟 Reading om.ci config from flake
❄️  nix --override-input flake-parts github:hercules-ci/flake-parts build '/nix/store/f9l6vrwrwnfba76cy5vrw64rb19rwfsx-nix-rs-flake-metadata#default' -L --print-out-paths --no-link --override-input flake github:srid/haskell-template --override-input include-inputs /nix/store/wb47j3cp8fjjgidlqlr2mhwi5zwmvsqh-source️
error: unrecognised flag '--override-input'

@srid
Copy link
Member

srid commented Mar 12, 2025

only subcommands that supports it

More generally: #440

@srid srid closed this as completed in #439 Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants