google / jsonnet

Jsonnet - The data templating language
http://jsonnet.org
Apache License 2.0
6.92k stars 437 forks source link

Test error if compiled with gcc-9 #676

Closed cdluminate closed 5 years ago

cdluminate commented 5 years ago
gcc-9 -DNDEBUG -g -fwrapv -O2 -Wall -g -O2 -fdebug-prefix-map=/root/Debian/jsonnet=. -fstack-protector-strong -Wformat -Werror=format-security -Ithird_party/md5 -Ithird_party/json -Iinclude -fPIC -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -Ithird_party/md5 -Ithird_party/json -I/usr/include/python3.7m -c python/_jsonnet.c -o build/temp.linux-x86_64-3.7/python/_jsonnet.o             
creating build/lib.linux-x86_64-3.7
g++-9 -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -Wl,-z,now -g -O2 -fdebug-prefix-map=/root/Debian/jsonnet=. -fstack-protector-strong -Wformat -Werror=format-security -Ithird_party/md5 -Ithird_party/json -Iinclude -fPIC -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.7/python/_jsonnet.o core/desugarer.o core/formatter.o core/libjsonnet.o core/lexer.o core/parser.o core/pass.o core/static_analysis.o core/string_utils.o core/vm.o third_party/md5/md5.o -o build/lib.linux-x86_64-3.7/_jsonnet.cpython-37m-x86_64-linux-gnu.so                 
make[1]: Leaving directory '/root/Debian/jsonnet'
   dh_auto_test -O-Scmake
        cd obj-x86_64-linux-gnu && make -j8 test ARGS\+=-j8
make[1]: Entering directory '/root/Debian/jsonnet/obj-x86_64-linux-gnu'
Running tests...
/usr/bin/ctest --force-new-ctest-process -j8
Test project /root/Debian/jsonnet/obj-x86_64-linux-gnu
    Start 1: lexer_test
    Start 2: parser_test
    Start 3: libjsonnet_test
    Start 4: libjsonnet_test_file
    Start 5: libjsonnet_test_snippet
    Start 6: jsonnet_test_snippet
    Start 7: regression_test
1/7 Test #1: lexer_test .......................   Passed    0.01 sec
2/7 Test #2: parser_test ......................   Passed    0.01 sec
3/7 Test #3: libjsonnet_test ..................   Passed    0.03 sec
4/7 Test #6: jsonnet_test_snippet .............   Passed    0.02 sec
5/7 Test #5: libjsonnet_test_snippet ..........   Passed    0.03 sec
6/7 Test #4: libjsonnet_test_file .............   Passed    0.05 sec
7/7 Test #7: regression_test ..................***Failed    4.98 sec
FAIL (regex mismatch):  /root/Debian/jsonnet/obj-x86_64-linux-gnu/jsonnet  --ext-str var1=test --ext-code var2='{x:1,y:2}'  error.import_folder.jsonnet                                           
This run's output:
RUNTIME ERROR: couldn't open import "lib": basic_filebuf::underflow error reading the file: Is a directory                                                                                        
        error.import_folder.jsonnet:17:1-13

-----------------------------

/root/Debian/jsonnet/test_suite/run_tests.sh: FAILED: 1 / 142

Also see buildlogs here: https://launchpad.net/ubuntu/+source/jsonnet/0.13.0+ds-1

sbarzowski commented 5 years ago

Thanks a lot for reporting.

We should fix it, but fortunately it's not dangerous in any way - it's just that the error message is slightly different when compiled with GCC 9. Perhaps we should check explicitly for importing a directory rather than leak the implementation detail about basic_filebuf etc. Anyway this shouldn't cause any problems for the users.

sparkprime commented 5 years ago

Given that it's not possible to implement this portably in C++ we could just delete the test.