From e0b4811fc83113c57123bb41187b9395624d0e6c Mon Sep 17 00:00:00 2001 From: kczulko Date: Wed, 9 Feb 2022 18:23:36 +0100 Subject: [PATCH 1/6] Update: - nixpkgs so now it is using bazel 4.2.1: https://lazamar.co.uk/nix-versions/?channel=nixos-unstable&package=bazel - rules_haskell to latest release - rules_go to 0.30.0 - ghc to 8.10.7 --- WORKSPACE | 16 ++++++++-------- example/WORKSPACE | 17 ++++++++--------- nixpkgs.nix | 2 +- shell.nix | 1 + tests/alternative-deps/WORKSPACE | 12 ++++++------ 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index b95f153..d547df8 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,9 +8,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_haskell", - sha256 = "427f7363d4b6addafaae1a371d60da6eb0a236b6fb7884d5a087e47e92f55403", - strip_prefix = "rules_haskell-f929776456ee3814991c6dcc4d67d15088cb148e", - url = "https://github.com/tweag/rules_haskell/archive/f929776456ee3814991c6dcc4d67d15088cb148e.zip", + sha256 = "851e16edc7c33b977649d66f2f587071dde178a6e5bcfeca5fe9ebbe81924334", + strip_prefix = "rules_haskell-0.14", + url = "https://github.com/tweag/rules_haskell/archive/refs/tags/v0.14.tar.gz", ) load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") @@ -64,7 +64,7 @@ stack_snapshot( load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs") haskell_register_ghc_nixpkgs( - attribute_path = "haskell.compiler.ghc8104", + attribute_path = "haskell.compiler.ghc8107", compiler_flags = [ "-Werror", "-Wall", @@ -73,7 +73,7 @@ haskell_register_ghc_nixpkgs( "-Wredundant-constraints", ], repositories = {"nixpkgs": "@nixpkgs"}, - version = "8.10.4", + version = "8.10.7", ) ############### @@ -82,10 +82,10 @@ haskell_register_ghc_nixpkgs( http_archive( name = "io_bazel_rules_go", - sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b", + sha256 = "d6b2513456fe2229811da7eb67a444be7785f5323c6708b38d851d2b51e54d83", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz", - "https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip", ], ) diff --git a/example/WORKSPACE b/example/WORKSPACE index 198250d..75e3e82 100644 --- a/example/WORKSPACE +++ b/example/WORKSPACE @@ -10,12 +10,11 @@ local_repository( ########################## # rules_haskell preamble ########################## - http_archive( name = "rules_haskell", - sha256 = "427f7363d4b6addafaae1a371d60da6eb0a236b6fb7884d5a087e47e92f55403", - strip_prefix = "rules_haskell-f929776456ee3814991c6dcc4d67d15088cb148e", - url = "https://github.com/tweag/rules_haskell/archive/f929776456ee3814991c6dcc4d67d15088cb148e.zip", + sha256 = "851e16edc7c33b977649d66f2f587071dde178a6e5bcfeca5fe9ebbe81924334", + strip_prefix = "rules_haskell-0.14", + url = "https://github.com/tweag/rules_haskell/archive/refs/tags/v0.14.tar.gz", ) load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") @@ -60,7 +59,7 @@ stack_snapshot( load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs") haskell_register_ghc_nixpkgs( - attribute_path = "haskell.compiler.ghc8104", + attribute_path = "haskell.compiler.ghc8107", compiler_flags = [ "-Werror", "-Wall", @@ -69,7 +68,7 @@ haskell_register_ghc_nixpkgs( "-Wredundant-constraints", ], repositories = {"nixpkgs": "@nixpkgs"}, - version = "8.10.4", + version = "8.10.7", ) ############### @@ -78,10 +77,10 @@ haskell_register_ghc_nixpkgs( http_archive( name = "io_bazel_rules_go", - sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b", + sha256 = "d6b2513456fe2229811da7eb67a444be7785f5323c6708b38d851d2b51e54d83", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz", - "https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip", ], ) diff --git a/nixpkgs.nix b/nixpkgs.nix index afb1223..25f3774 100644 --- a/nixpkgs.nix +++ b/nixpkgs.nix @@ -1 +1 @@ -import (fetchTarball "https://github.com/nixos/nixpkgs/archive/46113713d4f25579e07b78116a61ab6f178f4153.tar.gz") +import (fetchTarball "https://github.com/nixos/nixpkgs/archive/89f196fe781c53cb50fef61d3063fa5e8d61b6e5.tar.gz") diff --git a/shell.nix b/shell.nix index 7fa3499..d81fcca 100644 --- a/shell.nix +++ b/shell.nix @@ -13,6 +13,7 @@ mkShell { binutils cacert nix + git openjdk11 python3 # convenience dependencies diff --git a/tests/alternative-deps/WORKSPACE b/tests/alternative-deps/WORKSPACE index d071f08..0a49be4 100644 --- a/tests/alternative-deps/WORKSPACE +++ b/tests/alternative-deps/WORKSPACE @@ -13,9 +13,9 @@ local_repository( http_archive( name = "rules_haskell", - sha256 = "427f7363d4b6addafaae1a371d60da6eb0a236b6fb7884d5a087e47e92f55403", - strip_prefix = "rules_haskell-f929776456ee3814991c6dcc4d67d15088cb148e", - url = "https://github.com/tweag/rules_haskell/archive/f929776456ee3814991c6dcc4d67d15088cb148e.zip", + sha256 = "851e16edc7c33b977649d66f2f587071dde178a6e5bcfeca5fe9ebbe81924334", + strip_prefix = "rules_haskell-0.14", + url = "https://github.com/tweag/rules_haskell/archive/refs/tags/v0.14.tar.gz", ) load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") @@ -83,10 +83,10 @@ haskell_register_ghc_nixpkgs( http_archive( name = "io_bazel_rules_go", - sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b", + sha256 = "d6b2513456fe2229811da7eb67a444be7785f5323c6708b38d851d2b51e54d83", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz", - "https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip", ], ) From 5fee4f392d5f8041950ba8b1d28b3a274c6d1d8b Mon Sep 17 00:00:00 2001 From: kczulko Date: Thu, 10 Feb 2022 14:26:28 +0100 Subject: [PATCH 2/6] Fix ghc version for alternative-deps test. --- tests/alternative-deps/WORKSPACE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/alternative-deps/WORKSPACE b/tests/alternative-deps/WORKSPACE index 0a49be4..742cc65 100644 --- a/tests/alternative-deps/WORKSPACE +++ b/tests/alternative-deps/WORKSPACE @@ -65,7 +65,7 @@ stack_snapshot( load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs") haskell_register_ghc_nixpkgs( - attribute_path = "haskell.compiler.ghc8104", + attribute_path = "haskell.compiler.ghc8107", compiler_flags = [ "-Werror", "-Wall", From 7fdbdd8907190c383a7249beae23dcfc93a9396c Mon Sep 17 00:00:00 2001 From: kczulko Date: Thu, 10 Feb 2022 18:19:50 +0100 Subject: [PATCH 3/6] Set ghc version to 8.10.7 for tests/alternative-deps --- tests/alternative-deps/WORKSPACE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/alternative-deps/WORKSPACE b/tests/alternative-deps/WORKSPACE index 742cc65..b0fc023 100644 --- a/tests/alternative-deps/WORKSPACE +++ b/tests/alternative-deps/WORKSPACE @@ -74,7 +74,7 @@ haskell_register_ghc_nixpkgs( "-Wredundant-constraints", ], repositories = {"nixpkgs": "@nixpkgs"}, - version = "8.10.4", + version = "8.10.7", ) ############### From b57f99b769e4d68922c9fcdede8f719b67973c36 Mon Sep 17 00:00:00 2001 From: kczulko Date: Thu, 10 Feb 2022 19:28:08 +0100 Subject: [PATCH 4/6] Add main_file attribute for bench-b target. --- example/package-a/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/example/package-a/BUILD.bazel b/example/package-a/BUILD.bazel index 36c98f1..e219861 100644 --- a/example/package-a/BUILD.bazel +++ b/example/package-a/BUILD.bazel @@ -48,6 +48,7 @@ haskell_binary( # rule generated from package-a/package-a.cabal by gazelle_cabal haskell_binary( name = "bench-b", + main_file = "src/MainB.hs", compiler_flags = [ "-DSOME_VALUE=1", # keep ], From 0de919fa7de13a3b9057ffe157679646ff95304f Mon Sep 17 00:00:00 2001 From: kczulko Date: Thu, 10 Feb 2022 19:55:41 +0100 Subject: [PATCH 5/6] Fix main_file entry. --- example/package-a/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/package-a/BUILD.bazel b/example/package-a/BUILD.bazel index e219861..9f363ac 100644 --- a/example/package-a/BUILD.bazel +++ b/example/package-a/BUILD.bazel @@ -48,7 +48,7 @@ haskell_binary( # rule generated from package-a/package-a.cabal by gazelle_cabal haskell_binary( name = "bench-b", - main_file = "src/MainB.hs", + main_file = "app/MainB.hs", compiler_flags = [ "-DSOME_VALUE=1", # keep ], From 1366f5af25dbbcee444fed59c503fa7ff4eb6d6a Mon Sep 17 00:00:00 2001 From: kczulko Date: Thu, 10 Feb 2022 20:12:31 +0100 Subject: [PATCH 6/6] Fix buldifier linting error. --- example/package-a/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/package-a/BUILD.bazel b/example/package-a/BUILD.bazel index 9f363ac..099b615 100644 --- a/example/package-a/BUILD.bazel +++ b/example/package-a/BUILD.bazel @@ -48,10 +48,10 @@ haskell_binary( # rule generated from package-a/package-a.cabal by gazelle_cabal haskell_binary( name = "bench-b", - main_file = "app/MainB.hs", compiler_flags = [ "-DSOME_VALUE=1", # keep ], + main_file = "app/MainB.hs", # base is left out of the dependencies in the cabal file but it # is needed for building. # We keep it here to check that we can keep dependencies.