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

Add Haskell rules to the CI #235

Closed
laurentlb opened this issue Mar 1, 2018 · 11 comments · Fixed by #827
Closed

Add Haskell rules to the CI #235

laurentlb opened this issue Mar 1, 2018 · 11 comments · Fixed by #827
Assignees
Labels
new-project For requests to add a new project to Bazel CI P1

Comments

@laurentlb
Copy link
Contributor

I think this should be added to the CI: https://github.com/tweag/rules_haskell

@laurentlb
Copy link
Contributor Author

According to @mboes, Haskell rules should be easier to integrate to the CI
(tweag/rules_haskell#489 (comment))

@philwo, how do we add the rules to the CI?

@philwo
Copy link
Member

philwo commented May 28, 2019

I'll add them to CI in the next days.

@philwo philwo added new-project For requests to add a new project to Bazel CI P1 labels May 28, 2019
@philwo philwo self-assigned this May 28, 2019
@laurentlb
Copy link
Contributor Author

Thanks!
See also this comment by @Profpatsch: tweag/rules_haskell#754 (comment)

@Profpatsch
Copy link

@philwo Any success? If you want we can pair on this.

@philwo
Copy link
Member

philwo commented Jun 13, 2019

Thanks for the reminder.

I created a pipeline now: https://buildkite.com/bazel/rules-haskell-haskell
It's pulling from a personal fork of rules_haskell where I added a basic configuration file: https://github.com/philwo/rules_haskell/commit/8fb6c6c28a676686d5f8ae1817c09ed4c8e7cb4f
The first build failed with: "can't load .so/.DLL for: libgmp.so (libgmp.so: cannot open shared object file: No such file or directory)" (https://buildkite.com/bazel/rules-haskell-haskell/builds/2#29f8db4f-40dd-49e9-8193-fdb6790a1f64)

This is probably due to a missing package. I'll add it to our Docker container and will try again, but I'm about to go on vacation for a week, so I probably won't get to this before June 24th. I setup a reminder to pop-up in my inbox on that day.

@Profpatsch Once I get the basics working, we can iterate together to make it all work. :) One question already: It seems like you're running tests not by simply running "bazel test ..." but via a shell script. That's not really supported on our CI. However, we can run a shell script (or: any shell commands) before running the "bazel build" and "bazel test" commands. Maybe we can get it working using that mechanism.

@Profpatsch
Copy link

The first build failed with: "can't load .so/.DLL for: libgmp.so (libgmp.so: cannot open shared object file: No such file or directory)"

These are the dependencies needed by dynamically linked GHC:

$ ldd /nix/store/6mhw5wfnmncfbgghvbavhxadr9wq62i6-ghc-8.6.4/lib/ghc-8.6.4/bin/ghc | grep -v libHS
	linux-vdso.so.1 (0x00007fff395c4000)
	libm.so.6 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libm.so.6 (0x00007fe3a06b7000)
	libncursesw.so.6 => /nix/store/9yn8h9fvpfvrz9a3bqzjzz291mz08mqp-ncurses-6.1-20190112/lib/libncursesw.so.6 (0x00007fe399b7a000)
	librt.so.1 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/librt.so.1 (0x00007fe399b70000)
	libutil.so.1 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libutil.so.1 (0x00007fe399b69000)
	libdl.so.2 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libdl.so.2 (0x00007fe399b64000)
	libpthread.so.0 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libpthread.so.0 (0x00007fe399b43000)
	libgmp.so.10 => /nix/store/l0svq68vy8zx8i0fiffyqchng6xhx0an-gmp-6.1.2/lib/libgmp.so.10 (0x00007fe399aad000)
	libffi.so.6 => /nix/store/djzkfv5r10b19vyhnqxzwijjhhxq6i22-libffi-3.2.1/lib/libffi.so.6 (0x00007fe399aa0000)
	libc.so.6 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libc.so.6 (0x00007fe3998ea000)
	/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/ld-linux-x86-64.so.2 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007fe3a0851000)

One question already: It seems like you're running tests not by simply running "bazel test ..." but via a shell script. That's not really supported on our CI.

Yes, we are using this to chain multiple calls to bazel and get a nice test suite output. Can you run multiple different bazel calls in your setup?
Ideally, all of these would be moved into bazel rules/targets/genrules of course.

@mboes
Copy link

mboes commented Jun 17, 2019

These are the dependencies needed by dynamically linked GHC:

This list is not informative. @philwo here are the dependencies of ghc on Ubuntu:

  Depends: gcc
  Depends: libgmp-dev
  Depends: libffi-dev
  Depends: libbsd-dev
  Depends: libc6-dev
  Depends: libncurses5-dev
  Depends: libc6
  Depends: libffi6
  Depends: libgmp10
  Depends: libtinfo5

@guibou
Copy link

guibou commented Jun 25, 2019

Yes, we are using this to chain multiple calls to bazel and get a nice test suite output. Can you run multiple different bazel calls in your setup?
Ideally, all of these would be moved into bazel rules/targets/genrules of course.

In a perfect world, yes. But just running bazel test //... is better than nothing. I recently migrated rules_haskell from bazel 0.24 to bazel 0.27 and bazel test //... shows me most of the issues.

So I highly encourage starting with bazel test //... at first.

@laurentlb
Copy link
Contributor Author

@philwo Is there still any blocker?

mergify bot pushed a commit to tweag/rules_haskell that referenced this issue Sep 8, 2019
The configuration will be used by the Bazel CI pipeline at https://buildkite.com/bazel/rules-haskell-haskell
This commit is only a first step towards testing rules_haskell on CI. The configuration will likely require several more iterations until the build actually passes.

Progress towards bazelbuild/continuous-integration#235
@Profpatsch
Copy link

@laurentlb We have a successful build on the CI now: tweag/rules_haskell#1099 (CI log: https://buildkite.com/bazel/rules-haskell-haskell/builds/109)

I think we’re ready to be added to your list of downstream projects.

cc @philwo @fweikert @mboes

@fweikert
Copy link
Member

Done! Let me know if you have any further questions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-project For requests to add a new project to Bazel CI P1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants