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

souffle: add darwin support #208373

Merged
merged 2 commits into from
Jan 19, 2023
Merged

Conversation

bcardiff
Copy link
Contributor

@bcardiff bcardiff commented Dec 30, 2022

Description of changes

This PR fixes compilation error of souffle package for darwin. Currently is marked as broken.

Things done

After building the package in aarch64-darwin I was able to do a smoke test of the binary.

% ./result/bin/souffle --version
----------------------------------------------------------------------------
Version: 
----------------------------------------------------------------------------
Copyright (c) 2016-22 The Souffle Developers.
Copyright (c) 2013-16 Oracle and/or its affiliates.
All rights reserved.
============================================================================

I also run the https://souffle-lang.github.io/simple example successfully

% ./result/bin/souffle -F. -D. example.dl

I am surprised that the changes introduced by missing-override.patch and hardeningDisable = lib.optionals stdenv.isDarwin [ "strictoverflow" ]; were not needed in linux already.

The missing override patch is already present in upstream (See souffle-lang/souffle#2279) but is not released in 2.3. So I am applying it on linux also.

The other patches were done by consulting alicevision/geogram#2 (comment) and #39687 (comment)

Without threads.patch I was getting:

-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
CMake Error at /nix/store/4lqag9hdrzfcpsrb79ny90jlwnn5gckz-cmake-3.24.3/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /nix/store/4lqag9hdrzfcpsrb79ny90jlwnn5gckz-cmake-3.24.3/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /nix/store/4lqag9hdrzfcpsrb79ny90jlwnn5gckz-cmake-3.24.3/share/cmake-3.24/Modules/FindThreads.cmake:230 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:251 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/nix-build-souffle-2.3.drv-0/source/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/nix-build-souffle-2.3.drv-0/source/build/CMakeFiles/CMakeError.log".

Without disabling strictoverflow I was getting

make: *** [Makefile:136: all] Error 2
error: builder for '/nix/store/im01by48y5dlzj0asjljcy6b5qahx4xs-souffle-2.3.drv' failed with exit code 2;
       last 10 log lines:
       > clang-11: error: argument unused during compilation: '-fno-strict-overflow' [-Werror,-Wunused-command-line-argument]
       > clang-11: error: argument unused during compilation: '-fno-strict-overflow' [-Werror,-Wunused-command-line-argument]
       > make[2]: *** [src/CMakeFiles/libsouffle.dir/build.make:199: src/CMakeFiles/libsouffle.dir/ast/BooleanConstraint.cpp.o] Error 1
       > make[2]: *** [src/CMakeFiles/libsouffle.dir/build.make:171: src/CMakeFiles/libsouffle.dir/ast/Attribute.cpp.o] Error 1
       > make[2]: *** [src/CMakeFiles/libsouffle.dir/build.make:143: src/CMakeFiles/libsouffle.dir/ast/AliasType.cpp.o] Error 1
       > make[1]: *** [CMakeFiles/Makefile2:104: src/CMakeFiles/libsouffle.dir/all] Error 2
       > make[1]: *** Waiting for unfinished jobs....
       > [ 10%] Linking CXX executable souffleprof
       > [ 10%] Built target souffleprof
       > make: *** [Makefile:136: all] Error 2
       For full logs, run 'nix log /nix/store/im01by48y5dlzj0asjljcy6b5qahx4xs-souffle-2.3.drv'.

Without missing-override.patch I was getting

error: builder for '/nix/store/2f1d014pnlw9d4m204ay8gh5dnz0415g-souffle-2.3.drv' failed with exit code 2;
       last 10 log lines:
       > /tmp/nix-build-souffle-2.3.drv-0/source/src/main.cpp:306:10: error: 'endInput' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
       >     bool endInput() {
       >          ^
       > /tmp/nix-build-souffle-2.3.drv-0/source/src/main.cpp:213:18: note: overridden virtual function is here
       >     virtual bool endInput() = 0;
       >                  ^
       > 1 error generated.
       > make[2]: *** [src/CMakeFiles/souffle.dir/build.make:76: src/CMakeFiles/souffle.dir/main.cpp.o] Error 1
       > make[1]: *** [CMakeFiles/Makefile2:156: src/CMakeFiles/souffle.dir/all] Error 2
       > make: *** [Makefile:136: all] Error 2
       For full logs, run 'nix log /nix/store/2f1d014pnlw9d4m204ay8gh5dnz0415g-souffle-2.3.drv'.
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/787

Comment on lines 22 to 23
patches = lib.optionals stdenv.isDarwin [ ./threads.patch ] ++ [
(fetchpatch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply the patch unconditional

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also rebased and squashed.

@SuperSandro2000 SuperSandro2000 merged commit 4141729 into NixOS:master Jan 19, 2023
@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants