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

Paths from --print-out-paths are swallowed into stderr, unless wrapper is used #149

Open
cab404 opened this issue Sep 29, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@cab404
Copy link

cab404 commented Sep 29, 2024

(nushell is used cause output is nice)

(nix "build" "nixpkgs#hello" "--log-format" "internal-json" --print-out-paths o+e>| nom --json) | complete
╭───────────┬──────────────────────────────────────────────────────────╮
│ stdout    │                                                          │
│ stderr    │ /nix/store/kwmqk7ygvhypxadsdaai27gl6qfxv7za-hello-2.12.1 │
│           │ Finished at 23:57:05 after 0s                            │
│           │                                                          │
│ exit_code │ 0                                                        │
╰───────────┴──────────────────────────────────────────────────────────╯

(nom "build" "nixpkgs#hello" "--log-format" "internal-json" --print-out-paths) | complete
╭───────────┬──────────────────────────────────────────────────────────╮
│ stdout    │ /nix/store/kwmqk7ygvhypxadsdaai27gl6qfxv7za-hello-2.12.1 │
│           │                                                          │
│ stderr    │ Finished at 23:57:32 after 0s                            │
│           │                                                          │
│ exit_code │ 0                                                        │
╰───────────┴──────────────────────────────────────────────────────────╯

It should probably be possible to just print out non-json stuff from stdin to stdout instead of stderr?
I am not sure if it will break anything.

@maralorn
Copy link
Owner

Problems like this are one of the reasons that I prefer the wrapper.

The problem is that nom can’t tell which part of the input were stdout and which ones stderr.

I honestly forgot. Have you tried what happens if stdout is not passed to nom?

@cab404
Copy link
Author

cab404 commented Sep 30, 2024

Problems like this are one of the reasons that I prefer the wrapper.

Wrapper is nice as long as I don't receive everything over ssh. Can I specify what to wrap?

@maralorn
Copy link
Owner

No, not currently. The main point of the wrapper was that it can add some flags to nix-build without you needing to worry about it.

@maralorn maralorn added the enhancement New feature or request label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants