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

ydiff: init at 1.1 #45323

Merged
merged 1 commit into from Sep 10, 2018
Merged

ydiff: init at 1.1 #45323

merged 1 commit into from Sep 10, 2018

Conversation

leenaars
Copy link
Contributor

@leenaars leenaars commented Aug 19, 2018

Motivation for this change

Handy tool for working with diffs.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@teto
Copy link
Member

teto commented Aug 19, 2018

There is no homepage (in meta) ?

@leenaars
Copy link
Contributor Author

Added the GitHub page. With fetchFromGitHub that would have been automatic, but of course that doesn't hold.

@infinisil
Copy link
Member

@GrahamcOfBorg build ydiff

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ydiff

Partial log (click to expand)

writing dependency_links to ydiff.egg-info/dependency_links.txt
reading manifest file 'ydiff.egg-info/SOURCES.txt'
writing manifest file 'ydiff.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/gfjb6gflah6by0ywmxhlkwjrmn3x9shy-ydiff-1.1

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: ydiff

Partial log (click to expand)

writing dependency_links to ydiff.egg-info/dependency_links.txt
reading manifest file 'ydiff.egg-info/SOURCES.txt'
writing manifest file 'ydiff.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/psc54mg54yphcnm6z36l7csk24axk8zr-ydiff-1.1

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ydiff

Partial log (click to expand)

writing dependency_links to ydiff.egg-info/dependency_links.txt
reading manifest file 'ydiff.egg-info/SOURCES.txt'
writing manifest file 'ydiff.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/ychmnwnqaigcybgm58ipa06zpnaypz6c-ydiff-1.1

@infinisil
Copy link
Member

Ran 0 tests in 0.000s

Are you sure the tests get run?

@leenaars
Copy link
Contributor Author

The tests weren't being run, and for completeness sake I've added them.

checkInputs = [ coverage coreutils git subversion which ];

checkPhase = lib.optional (!isPy3k) "make test" ++
lib.optional (isPy3k) "make test3";
Copy link
Member

Choose a reason for hiding this comment

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

You can just use

checkPhase = if isPy3k then ''
  make test3
'' else ''
  make test
''

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now using checkTarget, as suggested.

@infinisil
Copy link
Member

@GrahamcOfBorg build ydiff

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: ydiff

Partial log (click to expand)

---------------------------------------------------
tests/test_ydiff.py     427     34    92%   80, 258-293, 800-802, 821-828, 831-835, 838-842
ydiff.py                482     96    80%   35-37, 319, 322-326, 329-337, 361-362, 401, 407, 481, 560-561, 568-576, 634-655, 718-734, 739-743, 748-750, 756-758, 770-773, 780-790, 814-815, 861-863, 868-872, 874-879, 890-903, 907
---------------------------------------------------
TOTAL                   909    130    86%
PYTHON=python3 tests/regression.sh
/bin/sh: tests/regression.sh: not found
make: *** [Makefile:45: reg3] Error 127
builder for '/nix/store/2f4p2zfv551nyl8pcwkxfqdm16zb0v15-ydiff-1.1.drv' failed with exit code 2
error: build of '/nix/store/2f4p2zfv551nyl8pcwkxfqdm16zb0v15-ydiff-1.1.drv' failed

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: ydiff

Partial log (click to expand)

---------------------------------------------------
tests/test_ydiff.py     427     34    92%   80, 258-293, 800-802, 821-828, 831-835, 838-842
ydiff.py                482     96    80%   35-37, 319, 322-326, 329-337, 361-362, 401, 407, 481, 560-561, 568-576, 634-655, 718-734, 739-743, 748-750, 756-758, 770-773, 780-790, 814-815, 861-863, 868-872, 874-879, 890-903, 907
---------------------------------------------------
TOTAL                   909    130    86%
PYTHON=python3 tests/regression.sh
/bin/sh: tests/regression.sh: not found
make: *** [Makefile:45: reg3] Error 127
builder for '/nix/store/gh7n8agyl3jynsn8xkxvs8gz6s0q5ajb-ydiff-1.1.drv' failed with exit code 2
error: build of '/nix/store/gh7n8agyl3jynsn8xkxvs8gz6s0q5ajb-ydiff-1.1.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ydiff

Partial log (click to expand)

python3 ./ydiff -c always                < tests/svn/in.diff              PASS
python3 ./ydiff -c always -s             < tests/svn/in.diff              PASS
python3 ./ydiff -c always -s -w70        < tests/svn/in.diff              PASS
python3 ./ydiff -c always -s -w70 --wrap < tests/svn/in.diff              PASS
python3 ./ydiff -c auto                  < tests/svn/in.diff              PASS
python3 ./ydiff -c auto -s               < tests/svn/in.diff              PASS
python3 ./ydiff -c auto -s -w70          < tests/svn/in.diff              PASS
python3 ./ydiff -c auto -s -w70 --wrap   < tests/svn/in.diff              PASS
All 102 tests passed.
/nix/store/n40migwsf1ls95sh6k2ajlh5drbca4qj-ydiff-1.1

@leenaars leenaars force-pushed the ydiff branch 3 times, most recently from f379c61 to 82d80c7 Compare August 19, 2018 21:47
propagatedBuildInputs = [ less patchutils ];
checkInputs = [ coverage coreutils git subversion which ];

checkPhase = if isPy3k then ''make test3'' else ''make test'';
Copy link
Member

Choose a reason for hiding this comment

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

Sorry to nitpick, but if it's in a single line, then the '' quotes aren't needed:

{
  checkPhase = if isPy3k then "make test3" else "make test";
}

:D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, so let's shave off those two extra characters...

Copy link
Contributor Author

@leenaars leenaars Aug 19, 2018

Choose a reason for hiding this comment

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

BTW: There is something rewarding with a tool that you can use on the commit itself.

ydiff -l -s

@infinisil
Copy link
Member

@GrahamcOfBorg build ydiff

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: ydiff

Partial log (click to expand)

---------------------------------------------------
tests/test_ydiff.py     427     34    92%   82, 258-293, 800-802, 821-828, 831-835, 838-842
ydiff.py                482     97    80%   35-37, 41-42, 319, 322-326, 329-337, 361-362, 401, 407, 481, 560-561, 568-576, 634-655, 718-734, 739-743, 748-750, 756-758, 765, 773, 780-790, 814-815, 861-863, 868-872, 874-879, 890-903, 907
---------------------------------------------------
TOTAL                   909    131    86%
tests/regression.sh
make: tests/regression.sh: Command not found
make: *** [Makefile:42: reg] Error 127
builder for '/nix/store/lhgayg740x129cwncm4zxh6xsd6lvpns-ydiff-1.1.drv' failed with exit code 2
error: build of '/nix/store/lhgayg740x129cwncm4zxh6xsd6lvpns-ydiff-1.1.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ydiff

Partial log (click to expand)

python  ./ydiff -c always                < tests/svn/in.diff              PASS
python  ./ydiff -c always -s             < tests/svn/in.diff              PASS
python  ./ydiff -c always -s -w70        < tests/svn/in.diff              PASS
python  ./ydiff -c always -s -w70 --wrap < tests/svn/in.diff              PASS
python  ./ydiff -c auto                  < tests/svn/in.diff              PASS
python  ./ydiff -c auto -s               < tests/svn/in.diff              PASS
python  ./ydiff -c auto -s -w70          < tests/svn/in.diff              PASS
python  ./ydiff -c auto -s -w70 --wrap   < tests/svn/in.diff              PASS
All 102 tests passed.
/nix/store/q23h2ywfd6k9s1j6b0kz5bwv9pa2p2w3-ydiff-1.1

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: ydiff

Partial log (click to expand)

---------------------------------------------------
tests/test_ydiff.py     427     34    92%   82, 258-293, 800-802, 821-828, 831-835, 838-842
ydiff.py                482     97    80%   35-37, 41-42, 319, 322-326, 329-337, 361-362, 401, 407, 481, 560-561, 568-576, 634-655, 718-734, 739-743, 748-750, 756-758, 765, 773, 780-790, 814-815, 861-863, 868-872, 874-879, 890-903, 907
---------------------------------------------------
TOTAL                   909    131    86%
tests/regression.sh
make: tests/regression.sh: Command not found
make: *** [Makefile:42: reg] Error 127
builder for '/nix/store/6wcijhiyknwjyfhvs6x8cjmcgxp7h5jq-ydiff-1.1.drv' failed with exit code 2
error: build of '/nix/store/6wcijhiyknwjyfhvs6x8cjmcgxp7h5jq-ydiff-1.1.drv' failed

@leenaars leenaars force-pushed the ydiff branch 3 times, most recently from 86aef4f to e71cff0 Compare August 19, 2018 22:43
@infinisil
Copy link
Member

Can't you test this locally?

@leenaars
Copy link
Contributor Author

Annoyingly, it builds on my system - I only push when it does that. But then there is different behaviour on the CI I'm trying to fix. Apologies!

@infinisil
Copy link
Member

Try enabling the sandbox for your builds

propagatedBuildInputs = [ less patchutils ];
checkInputs = [ coverage coreutils git subversion which ];

checkPhase = if isPy3k then "make test3" else "make test";
Copy link
Member

Choose a reason for hiding this comment

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

You can use checkTarget instead of checkPhase here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matthewbauer: thanks, didn't know about that. Did that.

@matthewbauer matthewbauer merged commit 579e206 into NixOS:master Sep 10, 2018
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

5 participants