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

Test failures with 5.1 and libyaml 0.2.2 #320

Closed
FRidh opened this issue Jul 15, 2019 · 9 comments
Closed

Test failures with 5.1 and libyaml 0.2.2 #320

FRidh opened this issue Jul 15, 2019 · 9 comments

Comments

@FRidh
Copy link

FRidh commented Jul 15, 2019

The issue occurs with both 2.7.16 and 3.7.4 of the Python interpreter.

===========================================================================
test_emitter_styles_ext(tests/data/spec-07-09.data, tests/data/spec-07-09.canonical): FAILURE
Traceback (most recent call last):
  File "tests/lib3/test_appliance.py", line 59, in execute
    function(verbose=verbose, *filenames)
  File "tests/lib3/test_yaml_ext.py", line 240, in wrapper
    function(*args, **kwds)
  File "tests/lib3/test_emitter.py", line 62, in test_emitter_styles
    _compare_events(events, new_events)
  File "tests/lib3/test_emitter.py", line 15, in _compare_events
    assert event1.value == event2.value, (event1, event2)
AssertionError: see below
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(ScalarEvent(anchor=None, tag='tag:yaml.org,2002:str', implicit=(False, False), value='foo'),
 ScalarEvent(anchor=None, tag='tag:yaml.org,2002:str', implicit=(False, False), value='foo %YAML 1.1'))
---------------------------------------------------------------------------
tests/data/spec-07-09.data:
---
foo
...
# Repeated end marker.
...
---
bar
# No end marker.
---
baz
...
---------------------------------------------------------------------------
tests/data/spec-07-09.canonical:
%YAML 1.1
---
!!str "foo"
%YAML 1.1
---
!!str "bar"
%YAML 1.1
---
!!str "baz"
===========================================================================
test_emitter_styles_ext(tests/data/spec-07-10.data, tests/data/spec-07-10.canonical): FAILURE
Traceback (most recent call last):
  File "tests/lib3/test_appliance.py", line 59, in execute
    function(verbose=verbose, *filenames)
  File "tests/lib3/test_yaml_ext.py", line 240, in wrapper
    function(*args, **kwds)
  File "tests/lib3/test_emitter.py", line 62, in test_emitter_styles
    _compare_events(events, new_events)
  File "tests/lib3/test_emitter.py", line 15, in _compare_events
    assert event1.value == event2.value, (event1, event2)
AssertionError: see below
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(ScalarEvent(anchor=None, tag='tag:yaml.org,2002:str', implicit=(False, False), value='Root flow scalar'),
 ScalarEvent(anchor=None, tag='tag:yaml.org,2002:str', implicit=(False, False), value='Root flow scalar %YAML 1.1'))
---------------------------------------------------------------------------
tests/data/spec-07-10.data:
"Root flow
 scalar"
--- !!str >
 Root block
 scalar
---
# Root collection:
foo : bar
... # Is optional.
---
# Explicit document may be empty.
---------------------------------------------------------------------------
tests/data/spec-07-10.canonical:
%YAML 1.1
---
!!str "Root flow scalar"
%YAML 1.1
---
!!str "Root block scalar\n"
%YAML 1.1
---
!!map {
  ? !!str "foo"
  : !!str "bar"
}
---
#!!str ""
!!null ""
===========================================================================
test_emitter_styles_ext(tests/data/spec-07-13.data, tests/data/spec-07-13.canonical): FAILURE
Traceback (most recent call last):
  File "tests/lib3/test_appliance.py", line 59, in execute
    function(verbose=verbose, *filenames)
  File "tests/lib3/test_yaml_ext.py", line 240, in wrapper
    function(*args, **kwds)
  File "tests/lib3/test_emitter.py", line 62, in test_emitter_styles
    _compare_events(events, new_events)
  File "tests/lib3/test_emitter.py", line 15, in _compare_events
    assert event1.value == event2.value, (event1, event2)
AssertionError: see below
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(ScalarEvent(anchor=None, tag='!foo', implicit=(False, False), value='No directives'),
 ScalarEvent(anchor=None, tag='!foo', implicit=(False, False), value='No directives %TAG ! %21foo'))
---------------------------------------------------------------------------
tests/data/spec-07-13.data:
! "First document"
---
!foo "No directives"
%TAG ! !foo
---
!bar "With directives"
%YAML 1.1
---
!baz "Reset settings"
---------------------------------------------------------------------------
tests/data/spec-07-13.canonical:
%YAML 1.1
---
!!str "First document"
---
!<!foo> "No directives"
---
!<!foobar> "With directives"
---
!<!baz> "Reset settings"
===========================================================================
test_emitter_styles_ext(tests/data/spec-08-08.data, tests/data/spec-08-08.canonical): FAILURE
Traceback (most recent call last):
  File "tests/lib3/test_appliance.py", line 59, in execute
    function(verbose=verbose, *filenames)
  File "tests/lib3/test_yaml_ext.py", line 240, in wrapper
    function(*args, **kwds)
  File "tests/lib3/test_emitter.py", line 62, in test_emitter_styles
    _compare_events(events, new_events)
  File "tests/lib3/test_emitter.py", line 15, in _compare_events
    assert event1.value == event2.value, (event1, event2)
AssertionError: see below
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(ScalarEvent(anchor=None, tag='tag:yaml.org,2002:str', implicit=(False, False), value='foo bar'),
 ScalarEvent(anchor=None, tag='tag:yaml.org,2002:str', implicit=(False, False), value='foo bar %YAML 1.1'))
---------------------------------------------------------------------------
tests/data/spec-08-08.data:
---
foo:
 "bar
 baz"
---
"foo
 bar"
---
foo
 bar
--- |
 foo
...
---------------------------------------------------------------------------
tests/data/spec-08-08.canonical:
%YAML 1.1
---
!!map {
  ? !!str "foo"
  : !!str "bar baz"
}
%YAML 1.1
---
!!str "foo bar"
%YAML 1.1
---
!!str "foo bar"
%YAML 1.1
---
!!str "foo\n"
===========================================================================
TESTS: 2602
FAILURES: 4
error: Tests failed
builder for '/nix/store/dm5kjkylawq31ag4v289s2p1danf5n5m-python3.7-PyYAML-5.1.drv' failed with exit code 1
@vcunat
Copy link

vcunat commented Jul 15, 2019

I expect the libyaml tarball is bad, though I'm not sure how much that's really related. http://pyyaml.org/download/libyaml/yaml-0.2.2.tar.gz (sha256 = "1karpcfgacgppa82wm2drcfn2kb6q2wqfykf5nrhy20sci2i2a3q") contains a single directory called yaml-0.2.1 and inside configure there's VERSION='0.2.1'.

@perlpunk
Copy link
Member

@vcunat That's weird.
I get:

% wget http://pyyaml.org/download/libyaml/yaml-0.2.2.tar.gz
...
% sha256sum yaml-0.2.2.tar.gz
4a9100ab61047fd9bd395bcef3ce5403365cafd55c1e0d0299cde14958e47be9
% tar -tvf yaml-0.2.2.tar.gz
yaml-0.2.2/
...

And looking into configure, I find VERSION='0.2.2'

@vcunat
Copy link

vcunat commented Jul 15, 2019

OK, for me as well, if I re-fetch the file. When we were adding that file into distribution cache (10 days ago or a bit less), it had that hash I posted, but that's no longer true.

@vcunat
Copy link

vcunat commented Jul 15, 2019

The tests work with this "new" tarball, so I suppose this pyyaml issue should be closed anyway.

When I compare the "new" tarball contents to a git checkout at tag 0.2.2, I still see some stuff missing in the tarball, e.g. the whole examples folder, which doesn't inspire much general confidence in the process (in me at least), but the differences no longer seem important.

@FRidh
Copy link
Author

FRidh commented Jul 16, 2019

The tarball that was uploaded as 0.2.2 was indeed incorrect, and it appears to have been resolved now. @vcunat I will fetch instead from GitHub in order to prevent issues like these in the future. With the correct 0.2.2 we also don't get the failing tests with pyyaml so closing.

@FRidh FRidh closed this as completed Jul 16, 2019
FRidh added a commit to NixOS/nixpkgs that referenced this issue Jul 16, 2019
The archive that was used turned out to be incorrect.
yaml/pyyaml#320

By now a correct tarball has been uploaded but in order
to prevent issues like these we fetch now instead from GitHub.
@perlpunk
Copy link
Member

@FRidh Ok, thanks, good to know that it's working now.
When I first added the tarball to pyyaml.org, I made some mistakes, but I fixed this on April 4, so it's really weird that this was still an issue recently.

@perlpunk
Copy link
Member

When I compare the "new" tarball contents to a git checkout at tag 0.2.2, I still see some stuff missing in the tarball

The tarball is generated by make dist, and it is supposed to be different from the git sources.
When you checkout from git, you have to bootstrap.
The generated tarball doesn't need to be bootstrapped.
When downloading the tarball from pyyaml.org or downloading the dist-0.2.2 tarball from github https://github.com/yaml/libyaml/archive/dist-0.2.2.tar.gz , you should get the same contents.

@FRidh
Copy link
Author

FRidh commented Jul 16, 2019

Further checking shows it was a mistake at our side. In NixOS/nixpkgs#64293 the contributor did not update the hash, and I did not notice that.

@vcunat
Copy link

vcunat commented Jul 16, 2019

Oh, I'd swear I had checked for exactly that error, but incorrectly... apparently. I'm sorry.

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