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

The jpl:prolog_in_java test stopped working for 9.2.7 #103

Open
xyproto opened this issue Sep 6, 2024 · 7 comments
Open

The jpl:prolog_in_java test stopped working for 9.2.7 #103

xyproto opened this issue Sep 6, 2024 · 7 comments

Comments

@xyproto
Copy link

xyproto commented Sep 6, 2024

Hi, maintainer of the swi-prolog Arch Linux package here.

When upgrading the package from 9.2.4 to 9.2.7, one of the tests stopped working:

ctest --test-dir build --output-on-failure
Internal ctest changing into directory: /build/swi-prolog/src/build
Test project /build/swi-prolog/src/build
Start  1: swipl:abi-version
1/87 Test  SWI-Prolog/issues#1: swipl:abi-version ................   Passed    0.00 sec
Start  2: swipl:basic
2/87 Test  SWI-Prolog/issues#2: swipl:basic ......................   Passed    0.27 sec
Start  3: swipl:unprotected
3/87 Test  SWI-Prolog/issues#3: swipl:unprotected ................   Passed    0.22 sec
Start  4: swipl:core
4/87 Test  SWI-Prolog/issues#4: swipl:core .......................   Passed    3.51 sec
Start  5: swipl:db
5/87 Test  SWI-Prolog/issues#5: swipl:db .........................   Passed    0.67 sec
Start  6: swipl:attvar
6/87 Test  SWI-Prolog/issues#6: swipl:attvar .....................   Passed    0.22 sec
Start  7: swipl:debug
7/87 Test  SWI-Prolog/issues#7: swipl:debug ......................   Passed    0.42 sec
Start  8: swipl:tabling
8/87 Test  SWI-Prolog/issues#8: swipl:tabling ....................   Passed    4.74 sec
Start  9: swipl:library
9/87 Test  SWI-Prolog/issues#9: swipl:library ....................   Passed    1.12 sec
Start 10: swipl:compile
10/87 Test SWI-Prolog/issues#10: swipl:compile ....................   Passed    0.14 sec
Start 11: swipl:charset
11/87 Test SWI-Prolog/issues#11: swipl:charset ....................   Passed    0.14 sec
Start 12: swipl:eclipse
12/87 Test SWI-Prolog/issues#12: swipl:eclipse ....................   Passed    0.13 sec
Start 13: swipl:clp
13/87 Test SWI-Prolog/issues#13: swipl:clp ........................   Passed    0.21 sec
Start 14: swipl:GC
14/87 Test SWI-Prolog/issues#14: swipl:GC .........................   Passed    1.20 sec
Start 15: swipl:save
15/87 Test SWI-Prolog/issues#15: swipl:save .......................   Passed    1.06 sec
Start 16: swipl:files
16/87 Test SWI-Prolog/issues#16: swipl:files ......................   Passed    1.26 sec
Start 17: swipl:transaction
17/87 Test SWI-Prolog/issues#17: swipl:transaction ................   Passed    0.20 sec
Start 18: swipl:xsb/basic_tests
18/87 Test SWI-Prolog/issues#18: swipl:xsb/basic_tests ............   Passed    0.43 sec
Start 19: swipl:xsb/ai_tests
19/87 Test SWI-Prolog/issues#19: swipl:xsb/ai_tests ...............   Passed    0.41 sec
Start 20: swipl:xsb/ptq
20/87 Test SWI-Prolog/issues#20: swipl:xsb/ptq ....................   Passed    0.32 sec
Start 21: swipl:xsb/neg_tests
21/87 Test SWI-Prolog/issues#21: swipl:xsb/neg_tests ..............   Passed    0.36 sec
Start 22: swipl:xsb/delay_tests
22/87 Test SWI-Prolog/issues#22: swipl:xsb/delay_tests ............   Passed    0.52 sec
Start 23: swipl:xsb/wfs_tests
23/87 Test SWI-Prolog/issues#23: swipl:xsb/wfs_tests ..............   Passed    0.37 sec
Start 24: swipl:xsb/table_tests
24/87 Test SWI-Prolog/issues#24: swipl:xsb/table_tests ............   Passed    0.78 sec
Start 25: swipl:xsb/incremental_tests
25/87 Test SWI-Prolog/issues#25: swipl:xsb/incremental_tests ......   Passed    0.22 sec
Start 26: swipl:xsb/nonmt_tests
26/87 Test SWI-Prolog/issues#26: swipl:xsb/nonmt_tests ............   Passed    0.25 sec
Start 27: swipl:xsb/sub_tests
27/87 Test SWI-Prolog/issues#27: swipl:xsb/sub_tests ..............   Passed    0.31 sec
Start 28: swipl:thread
28/87 Test SWI-Prolog/issues#28: swipl:thread .....................   Passed    4.51 sec
Start 29: swipl:thread_wait
29/87 Test SWI-Prolog/issues#29: swipl:thread_wait ................   Passed    0.41 sec
Start 30: swipl:signals
30/87 Test SWI-Prolog/issues#30: swipl:signals ....................   Passed    0.61 sec
Start 31: swipl:rational
31/87 Test SWI-Prolog/issues#31: swipl:rational ...................   Passed    0.19 sec
Start 32: chr:chr
32/87 Test SWI-Prolog/issues#32: chr:chr ..........................   Passed    0.79 sec
Start 33: clib:crypt
33/87 Test SWI-Prolog/issues#33: clib:crypt .......................   Passed    0.10 sec
Start 34: clib:memfile
34/87 Test SWI-Prolog/issues#34: clib:memfile .....................   Passed    0.11 sec
Start 35: clib:readutil
35/87 Test SWI-Prolog/issues#35: clib:readutil ....................   Passed    0.10 sec
Start 36: clib:stream
36/87 Test SWI-Prolog/issues#36: clib:stream ......................   Passed    0.10 sec
Start 37: clib:uri
37/87 Test SWI-Prolog/issues#37: clib:uri .........................   Passed    0.12 sec
Start 38: clib:filesex
38/87 Test SWI-Prolog/issues#38: clib:filesex .....................   Passed    0.11 sec
Start 39: clib:cgi
39/87 Test SWI-Prolog/issues#39: clib:cgi .........................   Passed    0.11 sec
Start 40: clib:time
40/87 Test SWI-Prolog/issues#40: clib:time ........................   Passed    0.86 sec
Start 41: clib:process
41/87 Test SWI-Prolog/issues#41: clib:process .....................   Passed    0.25 sec
Start 42: clib:socket
42/87 Test SWI-Prolog/issues#42: clib:socket ......................   Passed    4.25 sec
Start 43: clib:af_unix
43/87 Test SWI-Prolog/issues#43: clib:af_unix .....................   Passed    0.05 sec
Start 44: clib:udp_sockets
44/87 Test SWI-Prolog/issues#44: clib:udp_sockets .................   Passed    0.11 sec
Start 45: clib:uuid
45/87 Test SWI-Prolog/issues#45: clib:uuid ........................   Passed    0.10 sec
Start 46: cpp:ffi
46/87 Test SWI-Prolog/issues#46: cpp:ffi ..........................   Passed    0.12 sec
Start 47: cpp:cpp
47/87 Test SWI-Prolog/issues#47: cpp:cpp ..........................   Passed    0.18 sec
Start 48: http:json
48/87 Test SWI-Prolog/issues#48: http:json ........................   Passed    0.25 sec
Start 49: http:term_html
49/87 Test SWI-Prolog/issues#49: http:term_html ...................   Passed    0.20 sec
Start 50: http:cgi_stream
50/87 Test SWI-Prolog/issues#50: http:cgi_stream ..................   Passed    0.18 sec
Start 51: http:http
51/87 Test SWI-Prolog/issues#51: http:http ........................   Passed    0.34 sec
Start 52: http:multipart
52/87 Test SWI-Prolog/issues#52: http:multipart ...................   Passed    0.22 sec
Start 53: http:proxy
53/87 Test SWI-Prolog/issues#53: http:proxy .......................   Passed    0.32 sec
Start 54: http:websocket
54/87 Test SWI-Prolog/issues#54: http:websocket ...................   Passed    0.27 sec
Start 55: http:graphql
55/87 Test SWI-Prolog/issues#55: http:graphql .....................   Passed    0.20 sec
Start 56: mqi:mqi
56/87 Test SWI-Prolog/issues#56: mqi:mqi ..........................   Passed    1.83 sec
Start 57: nlp:nlp
57/87 Test SWI-Prolog/issues#57: nlp:nlp ..........................   Passed    0.11 sec
Start 58: redis:redis
58/87 Test SWI-Prolog/issues#58: redis:redis ......................   Passed    0.13 sec
Start 59: pengines:pengines
59/87 Test SWI-Prolog/issues#59: pengines:pengines ................   Passed    0.54 sec
Start 60: protobufs:protobufs
60/87 Test SWI-Prolog/issues#60: protobufs:protobufs ..............   Passed    0.17 sec
Start 61: RDF:rdf
61/87 Test SWI-Prolog/issues#61: RDF:rdf ..........................   Passed    0.13 sec
Start 62: RDF:write
62/87 Test SWI-Prolog/issues#62: RDF:write ........................   Passed    0.21 sec
Start 63: semweb:turtle
63/87 Test SWI-Prolog/issues#63: semweb:turtle ....................   Passed    0.90 sec
Start 64: semweb:ntriples
64/87 Test SWI-Prolog/issues#64: semweb:ntriples ..................   Passed    0.16 sec
Start 65: semweb:turtle2
65/87 Test SWI-Prolog/issues#65: semweb:turtle2 ...................   Passed    0.15 sec
Start 66: semweb:con
66/87 Test SWI-Prolog/issues#66: semweb:con .......................   Passed    0.09 sec
Start 67: semweb:litmap
67/87 Test SWI-Prolog/issues#67: semweb:litmap ....................   Passed    0.13 sec
Start 68: semweb:load
68/87 Test SWI-Prolog/issues#68: semweb:load ......................   Passed    0.20 sec
Start 69: semweb:rdf11
69/87 Test SWI-Prolog/issues#69: semweb:rdf11 .....................   Passed    0.21 sec
Start 70: semweb:rdf_db
70/87 Test SWI-Prolog/issues#70: semweb:rdf_db ....................   Passed    0.25 sec
Start 71: semweb:subprop
71/87 Test SWI-Prolog/issues#71: semweb:subprop ...................   Passed    0.80 sec
Start 72: sgml:sgml
72/87 Test SWI-Prolog/issues#72: sgml:sgml ........................   Passed    0.08 sec
Start 73: sgml:sgml_write
73/87 Test SWI-Prolog/issues#73: sgml:sgml_write ..................   Passed    0.08 sec
Start 74: sgml:xsd
74/87 Test SWI-Prolog/issues#74: sgml:xsd .........................   Passed    0.12 sec
Start 75: sgml:c14n
75/87 Test SWI-Prolog/issues#75: sgml:c14n ........................   Passed    0.16 sec
Start 76: zlib:zlib
76/87 Test SWI-Prolog/issues#76: zlib:zlib ........................   Passed    0.23 sec
Start 77: archive:archive
77/87 Test SWI-Prolog/issues#77: archive:archive ..................   Passed    0.20 sec
Start 78: odbc:odbc
78/87 Test SWI-Prolog/issues#78: odbc:odbc ........................   Passed    0.07 sec
Start 79: bdb:bdb
79/87 Test SWI-Prolog/issues#79: bdb:bdb ..........................   Passed    0.16 sec
Start 80: pcre:pcre
80/87 Test SWI-Prolog/issues#80: pcre:pcre ........................   Passed    0.17 sec
Start 81: yaml:yaml
81/87 Test SWI-Prolog/issues#81: yaml:yaml ........................   Passed    0.13 sec
Start 82: jpl:prolog_in_java
82/87 Test SWI-Prolog/issues#82: jpl:prolog_in_java ...............***Failed    0.05 sec
Error: Could not find or load main class .usr.share.java.junit.jar:.usr.share.java.hamcrest-core.jar:src.main.java.jplr
Caused by: java.lang.ClassNotFoundException: /usr/share/java/junit/jar:/usr/share/java/hamcrest-core/jar:src/main/javar

Start 83: jpl:java_in_prolog
83/87 Test SWI-Prolog/issues#83: jpl:java_in_prolog ...............   Passed    0.82 sec
Start 84: swipy:janus
84/87 Test SWI-Prolog/issues#84: swipy:janus ......................   Passed    0.45 sec
Start 85: swipy:xsb_janus
85/87 Test SWI-Prolog/issues#85: swipy:xsb_janus ..................   Passed    0.18 sec
Start 86: ssl:ssl
86/87 Test SWI-Prolog/issues#86: ssl:ssl ..........................   Passed    3.82 sec
Start 87: xpce:xpce
87/87 Test SWI-Prolog/issues#87: xpce:xpce ........................   Passed    0.09 sec

99% tests passed, 1 tests failed out of 87

Total Test time (real) =  47.47 sec

The following tests FAILED:
82 - jpl:prolog_in_java (Failed)
Errors while running CTest

Here is the current PKGBUILD:

pkgname=swi-prolog
pkgver=9.2.7 # using the stable version
pkgrel=1
pkgdesc='Prolog environment'
arch=(x86_64)
url='https://www.swi-prolog.org'
license=(BSD-2-Clause)
depends=(db5.3 gperftools libarchive libxcrypt libyaml qt5-base util-linux-libs)
makedepends=(cmake jdk-openjdk junit libjpeg libxft libxinerama libxpm ninja python-protobuf unixodbc)
optdepends=('java-runtime: for using Prolog from Java'
            'jdk-openjdk: for using Prolog from Java'
            'libjpeg: for using the pl2xpce library'
            'libxft: for using the pl2xpce library'
            'libxinerama: for using the pl2xpce library'
            'libxpm: for using the pl2xpce library'
            'python: for using Prolog from Python'
            'unixodbc: for using the odbc4pl library')
source=("$pkgname-$pkgver.tar.gz::$url/download/stable/src/swipl-$pkgver.tar.gz"
        bdb_5.3.patch)
b2sums=('c81e83ec62a48127e46248ef0a1cc518a7c3358158207a1402bc93d14e8f51b87dd260d67fb3cc8fdf19fe2b0fa88dc4eb0e1fd6ff99183d06362ae7f86c32a5'
        '37e14768ec59f9aee4363c5ffd63be8c50c04eecf269e52e8aadd5cadbc99f6286aa676b1145b1391490ab49072039d896eed588e934ba769d09c6bdb2d2222d')

prepare() {
  cd swipl-$pkgver
  patch -Np1 -i ../bdb_5.3.patch
}

build() {
  cmake \
    -B build \
    -D BDB_INCLUDE_DIR=/usr/include/db5.3 \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_C_FLAGS="$CFLAGS -fPIC -ffile-prefix-map=$PWD= -w" \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D LIBEDIT_INCLUDE_DIR=/usr/include \
    -D LIBEDIT_LIBRARIES=/usr/lib/libedit.so.0 \
    -G Ninja \
    -S swipl-$pkgver
  ninja -C build
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}

Any advice for how to make the tests pass is welcome.

@JanWielemaker
Copy link
Member

I'm not much of a Java expert, but I suspect that the "hamcrest" Java library is missing. It probably just skipped the test before and, as the rules for detecting junit have been extended it now tries to execute this test. You need junit 4 and hamcrest for this test to work.

@xyproto
Copy link
Author

xyproto commented Sep 7, 2024

@JanWielemaker Thanks for the tip!

Hamcrest seems to be an abandoned project, though?

This package is orphaned:

https://archlinux.org/packages/extra/any/java-hamcrest/

Probably because the upstream project is archived:

https://code.google.com/archive/p/hamcrest/source

Do you happen to know if there are any plans to move away from hamcrest in connection with the tests?

@JanWielemaker JanWielemaker transferred this issue from SWI-Prolog/issues Sep 8, 2024
@JanWielemaker
Copy link
Member

(Un)fortunately I know very little about Java. Including @anionic. Paul, do you know how to resolve this?

I do not really understand this though. If I read packages/jpl/CMakeLists.txt and packages/jpl/cmake/JUnit.cmake correctly it tries to find HAMCREST and if that fails it skips the prolog_in_java test.

Do you have the log of the cmake run to see what it says about junit and hamcrest?

@xyproto
Copy link
Author

xyproto commented Sep 17, 2024

Depending on junit and Hamcrest when testing solved the issue. Thanks!

I guess a feature request for not depending on the discontinued Hamcrest project belongs in a separate issue.

@xyproto xyproto closed this as completed Sep 17, 2024
@xyproto
Copy link
Author

xyproto commented Sep 17, 2024

I celebrated too early. It did not work after all, because I forgot to remove the -E flag that skipped the jpl:prolog_in_java test.

@JanWielemaker
Copy link
Member

Thanks for trying. The issue is still open, no?

@xyproto
Copy link
Author

xyproto commented Sep 17, 2024

Yes, I believe so.

@JanWielemaker JanWielemaker reopened this Sep 17, 2024
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

2 participants