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

gitAndTools.git-interactive-rebase-tool: init #79078

Merged
merged 1 commit into from Feb 2, 2020

Conversation

masaeedu
Copy link
Contributor

@masaeedu masaeedu commented Feb 2, 2020

Motivation for this change

Adds git-interactive-rebase-tool, a nice interactive alternative to modifying a rebase task sequence file

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@Ma27 Ma27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test suite fails with the following errors:

git-interactive-rebase-tool> failures:
git-interactive-rebase-tool> ---- display::utils::tests::detect_color_mode_term_program_env_apple_terminal stdout ----
git-interactive-rebase-tool> thread 'display::utils::tests::detect_color_mode_term_program_env_apple_terminal' panicked at 'assertion failed: `(left == right)`
git-interactive-rebase-tool> left: `TwoTone`,
git-interactive-rebase-tool> right: `EightBit`', src/display/utils.rs:147:3
git-interactive-rebase-tool> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
git-interactive-rebase-tool> ---- display::utils::tests::detect_color_mode_vte_version_less_0_36_00 stdout ----
git-interactive-rebase-tool> thread 'display::utils::tests::detect_color_mode_vte_version_less_0_36_00' panicked at 'assertion failed: `(left == right)`
git-interactive-rebase-tool> left: `TrueColor`,
git-interactive-rebase-tool> right: `EightBit`', src/display/utils.rs:182:3
git-interactive-rebase-tool> failures:
git-interactive-rebase-tool> display::utils::tests::detect_color_mode_term_program_env_apple_terminal
git-interactive-rebase-tool> display::utils::tests::detect_color_mode_vte_version_less_0_36_00
git-interactive-rebase-tool> test result: FAILED. 172 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
git-interactive-rebase-tool> error: test failed, to rerun pass '--bin interactive-rebase-tool'
git-interactive-rebase-tool> builder for '/nix/store/y8v4vw37gzrkwcs2v1y3aq3w60lfl7w6-git-interactive-rebase-tool-1.2.1.drv' failed with exit code 101
error: build of '/nix/store/y8v4vw37gzrkwcs2v1y3aq3w60lfl7w6-git-interactive-rebase-tool-1.2.1.drv' on 'ssh://builder' failed: builder for '/nix/store/y8v4vw37gzrkwcs2v1y3aq3w60lfl7w6-git-interactive-rebase-tool-1.2.1.drv' failed with exit code 101

@masaeedu
Copy link
Contributor Author

masaeedu commented Feb 2, 2020

Hello @Ma27. Is that the output you're observing from trying to build the derivation? Could you share what platform you're building it on?

@Ma27
Copy link
Member

Ma27 commented Feb 2, 2020

Yes. The error seems to occur as well on ofborg.

λ ma27 [~] → nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.15, NixOS, 19.09.git.laptop-17681d37f3 (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.2`
 - nixpkgs: `/nix/store/5yplvvayvgw3hp3g2r043yn48pjsfa61-source`

@masaeedu
Copy link
Contributor Author

masaeedu commented Feb 2, 2020

@Ma27 Perhaps this has something to do with the terminal in which the Nix derivation is being built? When I try to build the derivation locally in my Konsole terminal (which supports true color) it works correctly:

test result: ok. 174 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/pvdr6lsg80bkzq6apnml9h66fqwb2y41-git-interactive-rebase-tool-1.2.1
shrinking /nix/store/pvdr6lsg80bkzq6apnml9h66fqwb2y41-git-interactive-rebase-tool-1.2.1/bin/interactive-rebase-tool
strip is /nix/store/7bhi29ainf5rjrk7k7wyhndyskzyhsxh-binutils-2.31.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/pvdr6lsg80bkzq6apnml9h66fqwb2y41-git-interactive-rebase-tool-1.2.1/bin
patching script interpreter paths in /nix/store/pvdr6lsg80bkzq6apnml9h66fqwb2y41-git-interactive-rebase-tool-1.2.1
checking for references to /build/ in /nix/store/pvdr6lsg80bkzq6apnml9h66fqwb2y41-git-interactive-rebase-tool-1.2.1...
/nix/store/pvdr6lsg80bkzq6apnml9h66fqwb2y41-git-interactive-rebase-tool-1.2.1

I'm not super familiar with the Nixpkgs contribution processes. Would the appropriate step from here on be to comment out the terminal specific tests using a patch?

@Ma27
Copy link
Member

Ma27 commented Feb 2, 2020

Just realized that you built this without an enabled sandbox. Would you mind retrying with a sandbox enabled (nix-build --option sandbox true).

In that case it's probably related the terminal and you should disable the tests as this means that those will break at least on Hydra and ofborg.

@masaeedu
Copy link
Contributor Author

masaeedu commented Feb 2, 2020

@Ma27 Thanks. After running:

➜  nixpkgs git:(git-interactive-rebase-tool) nix-build --option sandbox true -A gitAndTools.git-interactive-rebase-tool ./. --check

I once again see that the tests pass.

I'll try to figure out how to get rid of those tests.

@Ma27
Copy link
Member

Ma27 commented Feb 2, 2020

I once again see that the tests pass.

Ah, just realized that you're running on a non-NixOS Linux. Tbh I'm unfortunately not sure how the sandbox works in such an environment.

Would you mind trying to configure the sandbox as described here: https://nixos.wiki/wiki/Nix

@masaeedu
Copy link
Contributor Author

masaeedu commented Feb 2, 2020

@Ma27 Hmm. How do I tell whether or not sandboxing is working? Wouldn't the --option sandbox true have enabled it?

I tried adding build-use-sandbox=true to my ~/.config/nix/nix.conf and tried building again, but that didn't seem to change anything (note that I'm still building from my terminal). I'm not sure whether I need to restart my Nix daemon to get a different result.

@masaeedu
Copy link
Contributor Author

masaeedu commented Feb 2, 2020

At any rate, I've patched out the terminal related tests, so hopefully this should make the build succeed. Could you check whether the updated PR builds for you?

@Ma27 Ma27 force-pushed the git-interactive-rebase-tool branch from 8dfd983 to 4d67e30 Compare February 2, 2020 09:09
Copy link
Member

@Ma27 Ma27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests work fine now, squashed the three commits together into a single one (with this tool btw :)).

Hmm, for instance you could build a derivation that tries to access the network. With sandboxing enbled it should definetely fail.

@Ma27 Ma27 merged commit 5de5d75 into NixOS:master Feb 2, 2020
@Ma27
Copy link
Member

Ma27 commented Feb 2, 2020

@masaeedu thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants