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

quiet flags #342

Open
Artturin opened this issue Jul 13, 2023 · 3 comments
Open

quiet flags #342

Artturin opened this issue Jul 13, 2023 · 3 comments

Comments

@Artturin
Copy link
Collaborator

Artturin commented Jul 13, 2023

Would make it nicer to integrate this tool in to other programs

in diffing im working around this by doing

$ export ATTR=zsh-forgit && nixpkgs-review pr 241873 -p "$ATTR" --run "echo -n 'STOREPATH=' && readlink -f ./results/$ATTR" 2>/dev/null | grep "^STOREPATH" | sed 's/STOREPATH=//'
/nix/store/qbm6v081wnj7gnzgyqyrq3zvycdfrdai-zsh-forgit-23.07.0

without the workaround

$ export ATTR=zsh-forgit && nixpkgs-review pr 241873 -p "$ATTR" --run "echo -n 'STOREPATH=' && readlink -f ./results/$ATTR"
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/241873/head:refs/nixpkgs-review/1
$ git worktree add /home/artturin/.cache/nixpkgs-review/pr-241873-43/nixpkgs 7bc11802ed276c2d651bd4bf0dc4b0b05434e0bf
Preparing worktree (detached HEAD 7bc11802ed27)
Updating files: 100% (36047/36047), done.
HEAD is now at 7bc11802ed27 Merge pull request #238777 from ORichterSec/esdm-upstream
$ git merge --no-commit --no-ff 024afa2e99c5eb380286ee3cd86a49651d23937f
Automatic merge went well; stopped before committing as requested
$ nix build --extra-experimental-features nix-command no-url-literals --no-link --keep-going --no-allow-import-from-derivation --option build-use-sandboxrelaxed -f /home/artturin/.cache/nixpkgs-review/pr-241873-43/build.nix

Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/241873

1 package built:
zsh-forgit

$ /nix/store/q6r9kwmidiy6wx1w1nf3ff0q40sfq4dg-nix-2.15.1/bin/nix-shell /home/artturin/.cache/nixpkgs-review/pr-241873-43/shell.nix --run echo -n 'STOREPATH=' && readlink -f ./results/zsh-forgit
STOREPATH=/nix/store/qbm6v081wnj7gnzgyqyrq3zvycdfrdai-zsh-forgit-23.07.0
$ git worktree prune
@SuperSandro2000
Copy link
Collaborator

If you want some data in a structured way, why don't we add a flag to output them as json? Then we can send the progress to stderr and people can just void that.

@Artturin
Copy link
Collaborator Author

If you want some data in a structured way, why don't we add a flag to output them as json? Then we can send the progress to stderr and people can just void that.

nix build has a --json so forwarding that would work

@Mic92
Copy link
Owner

Mic92 commented Oct 20, 2023

Do you just need the out paths?

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

No branches or pull requests

3 participants