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

Some tests failing on pp64el, arm64 and s390x #117

Closed
frediz opened this issue Jan 13, 2016 · 9 comments · Fixed by sass/libsass#1914
Closed

Some tests failing on pp64el, arm64 and s390x #117

frediz opened this issue Jan 13, 2016 · 9 comments · Fixed by sass/libsass#1914

Comments

@frediz
Copy link

frediz commented Jan 13, 2016

Here is the log and the tests failing :

F..../build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py:866: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/tmptzyxh74w/output/f1.css' mode='r' encoding='UTF-8'>
  contentsf1 = open(os.path.join(output_dir, 'f1.css')).read()
/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py:867: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/tmptzyxh74w/output/foo/f2.css' mode='r' encoding='UTF-8'>
  contentsf2 = open(os.path.join(output_dir, 'foo/f2.css')).read()
...F.....F.............F............F...........F.running build_sass
building 'testpkg' sass
.running build_sass
building 'testpkg' sass
.F......................F.....F............F...........F.
======================================================================
FAIL: test_builder_build_directory (sasstests.BuilderTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 531, in test_builder_build_directory
    self.assertEqual(D_EXPECTED_CSS, css)
AssertionError: '@charset "UTF-8";\nbody {\n  background-[60 chars] }\n' != "body {\n  background-color: green; }\n  [39 chars] }\n"
- @charset "UTF-8";
  body {
    background-color: green; }
    body a {
      font: '나눔고딕', sans-serif; }


======================================================================
FAIL: test_compile_filename (sasstests.CompileTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 430, in test_compile_filename
    self.assertEqual(D_EXPECTED_CSS, actual)
AssertionError: '@charset "UTF-8";\nbody {\n  background-[60 chars] }\n' != "body {\n  background-color: green; }\n  [39 chars] }\n"
- @charset "UTF-8";
  body {
    background-color: green; }
    body a {
      font: '나눔고딕', sans-serif; }


======================================================================
FAIL: test_compile_string (sasstests.CompileTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 262, in test_compile_string
    actual
AssertionError: '@charset "UTF-8";\na {\n  color: blue; }\n\n/* 유니코드 */\n' != 'a {\n  color: blue; }\n\n/* 유니코드 */\n'
- @charset "UTF-8";
  a {
    color: blue; }

  /* 유니코드 */


======================================================================
FAIL: test_bytes (sasstests.CustomFunctionsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 1293, in test_bytes
    u'\ufeffa{content:☃}\n',
AssertionError: 'a{content:☃}\n' != '\ufeffa{content:☃}\n'
- a{content:☃}
+ a{content:☃}
? +


======================================================================
FAIL: test_identity_strings (sasstests.CustomFunctionsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 1359, in test_identity_strings
    u'\ufeffa{content:☃}\n',
AssertionError: 'a{content:☃}\n' != '\ufeffa{content:☃}\n'
- a{content:☃}
+ a{content:☃}
? +


======================================================================
FAIL: test_unicode (sasstests.CustomFunctionsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 1287, in test_unicode
    u'\ufeffa{content:☃}\n',
AssertionError: 'a{content:☃}\n' != '\ufeffa{content:☃}\n'
- a{content:☃}
+ a{content:☃}
? +


======================================================================
FAIL: test_build_one (sasstests.ManifestTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 623, in test_build_one
    f.read()
AssertionError: '@charset "UTF-8";\n/* line 6, /tmp/tmp8h[197 chars]p */' != "/* line 6, /tmp/tmp8hy68vci/test/d.scss [176 chars]p */"
- @charset "UTF-8";
  /* line 6, /tmp/tmp8hy68vci/test/d.scss */
  body {
    background-color: green; }
    /* line 8, /tmp/tmp8hy68vci/test/d.scss */
    body a {
      font: '나눔고딕', sans-serif; }

  /*# sourceMappingURL=../css/d.scss.css.map */

======================================================================
FAIL: test_sassc_output_unicode (sasstests.SasscTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 786, in test_sassc_output_unicode
    f.read().strip()
AssertionError: '@charset "UTF-8";\nbody {\n  background-[58 chars]f; }' != "body {\n  background-color: green; }\n  [37 chars]f; }"
- @charset "UTF-8";
  body {
    background-color: green; }
    body a {
      font: '나눔고딕', sans-serif; }

======================================================================
FAIL: test_bytes (sasstests.CustomFunctionsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 1293, in test_bytes
    u'\ufeffa{content:☃}\n',
AssertionError: 'a{content:☃}\n' != '\ufeffa{content:☃}\n'
- a{content:☃}
+ a{content:☃}
? +


======================================================================
FAIL: test_identity_strings (sasstests.CustomFunctionsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 1359, in test_identity_strings
    u'\ufeffa{content:☃}\n',
AssertionError: 'a{content:☃}\n' != '\ufeffa{content:☃}\n'
- a{content:☃}
+ a{content:☃}
? +


======================================================================
FAIL: test_unicode (sasstests.CustomFunctionsTest)
    try:
        yield tmpdir
    finally:
        shutil.rmtree(tmpdir)


def write_file(filename, contents):
    with open(filename, 'w') as f:
        f.write(contents)

----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-libsass-test2/libsass-python-0.10.0/.pybuild/pythonX.Y_3.4/build/sasstests.py", line 1287, in test_unicode
    u'\ufeffa{content:☃}\n',
AssertionError: 'a{content:☃}\n' != '\ufeffa{content:☃}\n'
- a{content:☃}
+ a{content:☃}
? +


----------------------------------------------------------------------
Ran 113 tests in 0.852s

FAILED (failures=11)

I think those are all related to the same thing (utf8, Byte-Order Mark) and I'm opening a single bug.

Here are the full logs for those just in case :
https://buildd.debian.org/status/fetch.php?pkg=libsass-python&arch=ppc64el&ver=0.9.3-1&stamp=1452689309
https://buildd.debian.org/status/fetch.php?pkg=libsass-python&arch=s390x&ver=0.9.3-1&stamp=1452693199
https://buildd.debian.org/status/fetch.php?pkg=libsass-python&arch=arm64&ver=0.9.3-1&stamp=1452688793

@asottile
Copy link
Member

Is there somewhere we can view the patches made? The tests are pretty intimately tied to the exact version of libsass we link against. This looks similar to what the tests looked like against an older version of libsass

@frediz
Copy link
Author

frediz commented Jan 13, 2016

The build of the package is done using libsass 3.3.2 installed from the system :
$ dpkg -l|grep libsass
ii libsass-dev:ppc64el 3.3.2-1 ppc64el C/C++ port of the Sass CSS precompiler - development headers
ii libsass0:ppc64el 3.3.2-1 ppc64el C/C++ port of the Sass CSS precompiler

Also, in the packaging I did 2 patches :

$ cat debian/patches/fix-compilation 
Taking into account CPPFLAGS for hardening.
Also, this package more or less expects libsass locally (when downloading
from pypi, source of libsass is included. So fixing some path and linking.
--- a/setup.py
+++ b/setup.py
@@ -128,18 +128,20 @@
                 with open(cencode_path, 'w') as f:
                     f.write(cencode_body)

+    #flags = ['-c', '-O3', os.getenv('CFLAGS')] + flags
     flags = ['-c', '-O3'] + flags

     if platform.system() == 'FreeBSD':
         link_flags = ['-fPIC', '-lc++']
     else:
         link_flags = ['-fPIC', '-lstdc++']
+    link_flags.append('-lsass')

 sass_extension = Extension(
     '_sass',
     sources,
-    library_dirs=[os.path.join('.', 'libsass', 'src')],
-    include_dirs=[os.path.join('.', 'libsass', 'include')],
+    #library_dirs=[os.path.join('.', 'libsass', 'src')],
+    #include_dirs=[os.path.join('.', 'libsass', 'include')],
     depends=headers,
     extra_compile_args=flags,
     extra_link_args=link_flags,

because we must use the libsass coming from the distro instead of using the one downloaded
by setuputils. So no download is done and we link against the libsass from the system.

$ cat debian/patches/sassc-man 
This patch intends to create a separate man page for the sassc command line
utility, instead of having all the manual in the library's man page.
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -217,8 +217,8 @@
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    ('index', 'libsass', u'libsass Documentation',
-     [u'Hong Minhee'], 1)
+    ('index', 'libsass', u'libsass Documentation', [u'Hong Minhee'], 1),
+    ('sassc', 'sassc', u'sassc Documentation', [u'Hong Minhee'], 1)
 ]

 # If true, show URL addresses after external links.

This second patch is the last one and it shouldn't harm (I generate a separate man page for the command line utility)

@asottile
Copy link
Member

Is there a box I can ssh to that has one of these architectures? I imagine the test failures are because libsass itself is returning different values on those platforms (our code doesn't do much other than make a thin wrapper around sass/libsass)

@frediz
Copy link
Author

frediz commented Jan 13, 2016

I thought of the possibility of libsass being buggy indeed.
I've requested a ppc64el vm so that I setup the environment and will share it to you.
In the meantime, I checked at last libsass 3.3.2 build logs and I see not test being run strangely :

============================================================================
Testsuite summary for libsass 3.3.2
============================================================================
# TOTAL: 0
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

from : https://buildd.debian.org/status/fetch.php?pkg=libsass&arch=ppc64el&ver=3.3.2-1&stamp=1448920243

I'm going to check about libsass's test for the time being.
I keep you updated as soon as I have a VM or more libsass's test results.
Thanks!

@asottile
Copy link
Member

asottile commented Feb 4, 2016

@frediz any updates on this? I tried spinning up an emulator running arm64 to try and debug this, but it was too slow to even start.

@frediz
Copy link
Author

frediz commented Feb 8, 2016

@asottile Yes, sorry. I've just got the VM yesterday.
Can you send me a mail so that I can send you the info to connect to it ?
frediz@linux.vnet.ibm.com
Thanks

@asottile
Copy link
Member

Closing given sass/libsass#1914, this'll make it into their next release and end up here :)

@asottile
Copy link
Member

@frediz we've upgraded to 3.3.4 which contains my fix. Our version for that is 0.11.0

@frediz
Copy link
Author

frediz commented Mar 24, 2016

@asottile I saw libsass upgraded a few days ago, I asked it to be pulled in debian and I could build libsass-python 0.10.1 without error. For some reason I couldn't pushed it yesterday to Debian, so that's nice, I'll push 0.11.0. Thanks a lot!

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

Successfully merging a pull request may close this issue.

2 participants