Skip to content

Commit

Permalink
Update rules_haskell and don't use nixpkgs c2hs (digital-asset#525)
Browse files Browse the repository at this point in the history
* Update rules_haskell

In order to have kernel32 flagged as a system library.

* Don't use nixpkgs c2hs

* Apply linter suggestions
  • Loading branch information
nmattia-da authored Apr 16, 2019
1 parent 8655a79 commit 3b9a2f5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 33 deletions.
14 changes: 11 additions & 3 deletions 3rdparty/haskell/BUILD.c2hs
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# vim: ft=python

load("@ai_formation_hazel//third_party/cabal2bazel:bzl/cabal_package.bzl",
"cabal_haskell_package",
"hazel_symlink")
load("@hazel_base_repository//:extra-libs.bzl",
"extra_libs",
)

load("@os_info//:os_info.bzl", "is_windows")

load("@com_github_digital_asset_daml//3rdparty/haskell:c2hs-package.bzl", "package")
# Make a buildable target for easier debugging of the package.bzl file
hazel_symlink(
name = "bzl",
src = "@com_github_digital_asset_daml//3rdparty/haskell:c2hs-package.bzl",
out = "package-bzl",
)


ghc_workspace = "@io_tweag_rules_haskell_ghc_windows_amd64" if is_windows else "@io_tweag_rules_haskell_ghc-nixpkgs"

cabal_haskell_package(
package,
"8.6.4
",
"@io_tweag_rules_haskell_ghc_windows_amd64",
"8.6.4",
ghc_workspace,
extra_libs,
)
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ load(

c2hs_toolchain(
name = "c2hs-toolchain",
c2hs = "@c2hs//:bin",
c2hs = "@haskell_c2hs//:c2hs_bin",
)

filegroup(
Expand Down
26 changes: 0 additions & 26 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -169,32 +169,6 @@ dev_env_tool(
win_tool = "msys2-20180531",
)

# c2hs
nixpkgs_package(
name = "c2hs",
attribute_path = "ghcWithC2hs",
build_file_content = '''
package(default_visibility = [ "//visibility:public" ])
filegroup(
name = "bin",
srcs = ["bin/c2hs"],
)
exports_files(["bin/ghc-pkg"])
''',
nix_file = "//nix:bazel.nix",
nix_file_deps = common_nix_file_deps + [
"//nix:ghc.nix",
"//nix:with-packages-wrapper.nix",
"//nix:overrides/ghc-8.6.4.nix",
"//nix:overrides/c2hs-0.28.6.nix",
"//nix:overrides/ghc-8.6.3-binary.nix",
"//nix:overrides/language-c-0.8.2.nix",
],
repositories = dev_env_nix_repos,
)

load(
"@io_tweag_rules_haskell//haskell:haskell.bzl",
"haskell_register_ghc_bindists",
Expand Down
3 changes: 2 additions & 1 deletion daml-foundations/daml-tools/da-hs-damlc-app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

load("//bazel_tools:haskell.bzl", "da_haskell_binary")
load("//bazel_tools:packaging/packaging.bzl", "package_app")
load("@os_info//:os_info.bzl", "is_windows")

da_haskell_binary(
name = "da-hs-damlc-app",
Expand Down Expand Up @@ -60,7 +61,7 @@ package_app(
"//compiler/scenario-service/server:scenario_service_jar",
"//daml-foundations/daml-ghc/package-database:gen-daml-prim.dar",
"//daml-foundations/daml-ghc/package-database:package-db",
"@c2hs//:bin/ghc-pkg",
"@io_tweag_rules_haskell_ghc_windows_amd64//:bin/ghc-pkg.exe" if is_windows else "@io_tweag_rules_haskell_ghc-nixpkgs//:bin/ghc-pkg",
],
tags = ["no-cache"],
visibility = ["//visibility:public"],
Expand Down
4 changes: 2 additions & 2 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
# be resolvable from external workspaces otherwise.

rules_scala_version = "6f8ee3d951d2ac6154356314600f6edb4eb5df8b"
rules_haskell_version = "4bebd7a72daf56a0f2859599741050d80bf179dc"
rules_haskell_sha256 = "c62d44c2d78125ac972b50811b1c21096c37399efb75d31ea454ad52d76830a2"
rules_haskell_version = "ac1d2c17d873d48dde9d307b7b8913cd1d2970ec"
rules_haskell_sha256 = "e2a9315a46f5edd099880c804e13dd8a743e02495eada02a885b2817f4d9ed8d"
rules_nixpkgs_version = "40b5a9f23abca57f364c93245c7451206ef1a855"

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand Down

0 comments on commit 3b9a2f5

Please sign in to comment.