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

WIP: hydra: enable darwin build on 2017-11-21 #33985

Closed
wants to merge 1 commit into from

Conversation

periklis
Copy link
Contributor

Motivation for this change

Enable hydra builds on macOS to support darwin-based ecosystem. Currently WIP, because of:

/nix/store/hgsbnqhg7zr5vbjazb250ac4wnj3cfhy-bash-4.4-p12/bin/bash ../../libtool  --tag=CXX   --mode=link clang++ -I/nix/store/x2r5fphb4gh7jp7brkfd92va40yp9hy0-boehm-gc-7.6.0-dev/include -I/nix/store/j72w
hnasj6hx49ipnjpc844ndr1b13mz-nix-unstable-1.12pre5849_74f75c85-dev/include/nix -Wall -I ../libhydra -g -O2 -std=c++17 -include nix/config.h   -o hydra-queue-runner hydra_queue_runner-hydra-queue-runner.o
 hydra_queue_runner-queue-monitor.o hydra_queue_runner-dispatcher.o hydra_queue_runner-builder.o hydra_queue_runner-build-result.o hydra_queue_runner-build-remote.o -L/nix/store/5a8601rl5434yaffvs6vlrvzf
z7qi730-boehm-gc-7.6.0/lib -L/nix/store/d7x3mh58yr5x913d172jl45zqw6ah19z-nix-unstable-1.12pre5849_74f75c85/lib -lnixmain -lnixexpr -lgc -lnixstore -lnixutil -lnixformat -lpqxx                           
libtool: link: clang++ -I/nix/store/x2r5fphb4gh7jp7brkfd92va40yp9hy0-boehm-gc-7.6.0-dev/include -I/nix/store/j72whnasj6hx49ipnjpc844ndr1b13mz-nix-unstable-1.12pre5849_74f75c85-dev/include/nix -Wall -I ..
/libhydra -g -O2 -std=c++17 -include nix/config.h -o hydra-queue-runner hydra_queue_runner-hydra-queue-runner.o hydra_queue_runner-queue-monitor.o hydra_queue_runner-dispatcher.o hydra_queue_runner-build
er.o hydra_queue_runner-build-result.o hydra_queue_runner-build-remote.o  -L/nix/store/5a8601rl5434yaffvs6vlrvzfz7qi730-boehm-gc-7.6.0/lib -L/nix/store/d7x3mh58yr5x913d172jl45zqw6ah19z-nix-unstable-1.12p
re5849_74f75c85/lib -lnixmain -lnixexpr /nix/store/5a8601rl5434yaffvs6vlrvzfz7qi730-boehm-gc-7.6.0/lib/libgc.dylib -L/nix/store/3v14j0vgq7iiwvwx8zllzzw9fx2ykasx-libatomic_ops-7.6.0/lib -lpthread -lnixsto
re -lnixutil -lnixformat -lpqxx                                                                                                                                                                           
Undefined symbols for architecture x86_64:
  "void nix::toJSON<std::__1::atomic<unsigned long long> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::atomic<unsigned long long> const&)", referenced from:
      State::dumpStatus(Connection&, bool) in hydra_queue_runner-hydra-queue-runner.o
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@LnL7
Copy link
Member

LnL7 commented Jan 18, 2018

This fixes the the linker issue and gets me to the tests, not sure what the failure there is.

diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc
index 85635823..2d1cda88 100644
--- a/src/hydra-queue-runner/hydra-queue-runner.cc
+++ b/src/hydra-queue-runner/hydra-queue-runner.cc
@@ -22,6 +22,7 @@ namespace nix {
 
 template<> void toJSON<std::atomic<long>>(std::ostream & str, const std::atomic<long> & n) { str << n; }
 template<> void toJSON<std::atomic<unsigned long>>(std::ostream & str, const std::atomic<unsigned long> & n) { str << n; }
+template<> void toJSON<std::atomic<unsigned long long>>(std::ostream & str, const std::atomic<unsigned long long> & n) { str << n; }
 template<> void toJSON<double>(std::ostream & str, const double & n) { str << n; }
 
 }

@periklis
Copy link
Contributor Author

Oh man, i should be damned to have overlooked them missing atomic template instantiations for unsigned long long instead of the provided unsigned long. However, i am really curious why gcc is more forgiveful.

@periklis
Copy link
Contributor Author

Status update. Currently hydra check phase fails, due to following test cases:

not ok 4 - Build 'succeed_with_failed' from jobs/basic.nix should have buildstatus 6 but has 1
not ok 8 - Build 'empty_dir' from jobs/basic.nix should have buildstatus 0 but has 1
not ok 12 - Build 'build1' from jobs/basic.nix should have buildstatus 0 but has 1
not ok 14 - Evaluating jobs/build-output-as-input.nix for second time after building build1 should result in 1 build in queue
not ok 70 - Build 'with_spaces' from jobs/build-products.nix should have buildstatus 0 but has 1

which translates to hydra-queue-runner runs into 1 = regular Nix failure (derivation returned non-zero exit code) issues on macOS.

@periklis periklis force-pushed the holidaycheck/hydra-darwin branch 6 times, most recently from 5d48799 to e47bea6 Compare January 25, 2018 07:27
@periklis periklis force-pushed the holidaycheck/hydra-darwin branch 5 times, most recently from cedcde4 to aac82a3 Compare February 1, 2018 16:49
@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Feb 19, 2018
@periklis
Copy link
Contributor Author

I have to close this PR, since it's not going to happen anytime soon. However, i've updated the branch to pass the nix evaluation, but currently it fails because the perl package DevelCheckCompiler fails to find a C99 compiler. DevelCheckCompiler is a transitive dependency of Mouse which is used by the Catalyst MVC Framework. It's kind of a desperate work in Perl-Land :(
Feel free to pick this up.

@periklis periklis closed this May 10, 2018
@periklis periklis deleted the holidaycheck/hydra-darwin branch July 25, 2018 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants