summaryrefslogtreecommitdiff
path: root/gnu/packages/potassco.scm
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2024-06-29 08:53:54 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2024-07-07 08:04:47 +0200
commit3ed077e92cebe4286eeecf372722690eb5c9a8aa (patch)
treee40b319d6d6c47c0f5e1c1e275e766dcb7bb403c /gnu/packages/potassco.scm
parent8546ca946e617c32ef3bb60947e368f7d038090c (diff)
gnu: clasp: Prevent ID clashes in dependent packages.
Clasp uses an interesting CRTP pattern to insert statically (i.e. compile-time) generated numeric IDs into global fields. However, these templates are instantiated once per shared library---thus, whenever a library is linked, new IDs are generated, and the original intent (safely type-casting objects across libraries) is lost. To help the linker out, we make sure that these IDs are only instantiated in clasp and not when building other libraries. * gnu/packages/patches/clasp-hide-event-ids.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. * gnu/packages/clasp.scm (source)[patches]: Add it here. (clingo)[#:phases]: Drop ‘skip-failing-tests’. (python-clorm)[#:phases]<fix-breaking-tests>: Adjust accordingly. (python-clintest): Drop arguments.
Diffstat (limited to 'gnu/packages/potassco.scm')
-rw-r--r--gnu/packages/potassco.scm31
1 files changed, 3 insertions, 28 deletions
diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index b7cfca2eecf..5432fc10c36 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -112,6 +112,7 @@ between aspif and smodels format or to a human-readable text format.")
112 (url "https://github.com/potassco/clasp") 112 (url "https://github.com/potassco/clasp")
113 (commit (string-append "v" version)))) 113 (commit (string-append "v" version))))
114 (file-name (git-file-name name version)) 114 (file-name (git-file-name name version))
115 (patches (search-patches "clasp-hide-event-ids.patch"))
115 (sha256 116 (sha256
116 (base32 117 (base32
117 "0qap7rar8a5mkqz28n2hnvr4cfv5x0rh4zs3wdp919dw4d034chr")))) 118 "0qap7rar8a5mkqz28n2hnvr4cfv5x0rh4zs3wdp919dw4d034chr"))))
@@ -200,22 +201,7 @@ satisfiability checking (SAT).")
200 (substitute* "cmake/ClingoConfig.cmake.in" 201 (substitute* "cmake/ClingoConfig.cmake.in"
201 (("find_package\\(Clasp") "find_package(clasp")) 202 (("find_package\\(Clasp") "find_package(clasp"))
202 (rename-file "cmake/ClingoConfig.cmake.in" 203 (rename-file "cmake/ClingoConfig.cmake.in"
203 "cmake/clingo-config.cmake.in"))) 204 "cmake/clingo-config.cmake.in"))))))
204 (add-after 'unpack 'skip-failing-tests
205 (lambda _
206 (with-directory-excursion "libclingo/tests"
207 (substitute* "CMakeLists.txt"
208 (("COMMAND test_clingo" all)
209 (string-append all
210 " -f "
211 "\"${CMAKE_CURRENT_SOURCE_DIR}/good.txt\"")))
212 (call-with-output-file "good.txt"
213 (lambda (port)
214 (for-each (lambda (test) (format port "~s~%" test))
215 '("parse-ast-v2" "add-ast-v2" "build-ast-v2"
216 "unpool-ast-v2" "parse_term"
217 "propagator" "propgator-sequence-mining"
218 "symbol" "visitor"))))))))))
219 (inputs (list catch2-3 clasp libpotassco)) 205 (inputs (list catch2-3 clasp libpotassco))
220 (native-inputs (list bison re2c 206 (native-inputs (list bison re2c
221 mpark-variant 207 mpark-variant
@@ -465,10 +451,7 @@ directly from the python command line.")))
465 (lambda _ 451 (lambda _
466 ;; noclingo tests rely on this being set 452 ;; noclingo tests rely on this being set
467 (setenv "CLORM_NOCLINGO" "1") 453 (setenv "CLORM_NOCLINGO" "1")
468 (delete-file "tests/test_mypy_query.py") 454 (delete-file "tests/test_mypy_query.py"))))))
469 (substitute* "tests/test_clingo.py"
470 (("self\\.assertTrue\\(os_called\\)" all)
471 (string-append "# " all))))))))
472 (propagated-inputs (list python-clingo)) 455 (propagated-inputs (list python-clingo))
473 (native-inputs (list python-typing-extensions)) 456 (native-inputs (list python-typing-extensions))
474 (home-page "https://potassco.org") 457 (home-page "https://potassco.org")
@@ -627,14 +610,6 @@ which allows user interfaces to be specified entirely as a logic program.")
627 (base32 610 (base32
628 "0xzbby9ram55h87ykm652kgm45b8rlhbjc8gjkz308h1jnjllmmy")))) 611 "0xzbby9ram55h87ykm652kgm45b8rlhbjc8gjkz308h1jnjllmmy"))))
629 (build-system pyproject-build-system) 612 (build-system pyproject-build-system)
630 (arguments
631 (list #:phases
632 #~(modify-phases %standard-phases
633 (add-after 'unpack 'delete-failing-tests
634 (lambda _
635 ;; XXX: Clingo statistics are broken in dependencies already.
636 (for-each delete-file '("tests/test_solver.py"
637 "tests/test_test.py")))))))
638 (inputs (list python-clingo)) 613 (inputs (list python-clingo))
639 (native-inputs (list python-pytest)) 614 (native-inputs (list python-pytest))
640 (home-page "https://potassco.org/clintest/") 615 (home-page "https://potassco.org/clintest/")