From a869a3c56ba73a08ffa14cfcece5033abf3fc970 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sat, 14 Oct 2023 21:53:10 +0000 Subject: [PATCH] chore: Update to new third_party method for haskell deps. --- .cirrus.yml | 2 +- .github/docker/Dockerfile | 4 +-- BUILD.bazel | 73 +++++++++++++++++++-------------------- tools/BUILD.bazel | 9 +++-- tools/git-submit | 2 +- tools/git-sync | 2 +- web/BUILD.bazel | 47 ++++++++++++------------- 7 files changed, 68 insertions(+), 71 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index d3bae53..eefea5c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,5 +8,5 @@ bazel-opt_task: - /src/workspace/tools/inject-repo hs-github-tools test_all_script: - cd /src/workspace && bazel test -k - --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST + --config=ci //hs-github-tools/... diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile index 651b4ad..c6f6625 100644 --- a/.github/docker/Dockerfile +++ b/.github/docker/Dockerfile @@ -1,8 +1,8 @@ FROM toxchat/toktok-stack:haskell AS build RUN ["rm", "-rf", "/work/hs-github-tools"] -COPY --chown=builder:users . /work/hs-github-tools/ -RUN ["stack", "install", "github-tools", "--fast", "--ghc-options", "-j8"] +COPY --chown=builder:users . /work/hs-github-tools +RUN ["stack", "install", "github-tools"] FROM scratch COPY --from=build /home/builder/.local/ / diff --git a/BUILD.bazel b/BUILD.bazel index 4800295..2dc226c 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,3 @@ -load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library") load("@rules_haskell//haskell:defs.bzl", "haskell_library") load("//third_party/haskell/hspec-discover:build_defs.bzl", "hspec_test") load("//tools/project:build_defs.bzl", "project") @@ -17,11 +16,11 @@ haskell_library( src_strip_prefix = "src", visibility = ["//visibility:public"], deps = [ - hazel_library("QuickCheck"), - hazel_library("aeson"), - hazel_library("base"), - hazel_library("quickcheck-text"), - hazel_library("text"), + "//third_party/haskell:QuickCheck", + "//third_party/haskell:aeson", + "//third_party/haskell:base", + "//third_party/haskell:quickcheck-text", + "//third_party/haskell:text", ], ) @@ -36,10 +35,10 @@ haskell_library( visibility = ["//visibility:public"], deps = [ ":github-base", - hazel_library("QuickCheck"), - hazel_library("aeson"), - hazel_library("base"), - hazel_library("text"), + "//third_party/haskell:QuickCheck", + "//third_party/haskell:aeson", + "//third_party/haskell:base", + "//third_party/haskell:text", ], ) @@ -60,29 +59,29 @@ haskell_library( deps = [ ":github-base", ":github-events", - hazel_library("QuickCheck"), - hazel_library("aeson"), - hazel_library("base"), - hazel_library("bytestring"), - hazel_library("containers"), - hazel_library("cryptohash"), - hazel_library("directory"), - hazel_library("exceptions"), - hazel_library("github"), - hazel_library("html"), - hazel_library("http-client"), - hazel_library("http-client-tls"), - hazel_library("monad-parallel"), - hazel_library("process"), - hazel_library("quickcheck-text"), - hazel_library("split"), - hazel_library("tabular"), - hazel_library("text"), - hazel_library("time"), - hazel_library("unordered-containers"), - hazel_library("uuid"), - hazel_library("vector"), - hazel_library("unix"), + "//third_party/haskell:QuickCheck", + "//third_party/haskell:aeson", + "//third_party/haskell:base", + "//third_party/haskell:bytestring", + "//third_party/haskell:containers", + "//third_party/haskell:cryptohash", + "//third_party/haskell:directory", + "//third_party/haskell:exceptions", + "//third_party/haskell:github", + "//third_party/haskell:html", + "//third_party/haskell:http-client", + "//third_party/haskell:http-client-tls", + "//third_party/haskell:monad-parallel", + "//third_party/haskell:process", + "//third_party/haskell:quickcheck-text", + "//third_party/haskell:split", + "//third_party/haskell:tabular", + "//third_party/haskell:text", + "//third_party/haskell:time", + "//third_party/haskell:unix", + "//third_party/haskell:unordered-containers", + "//third_party/haskell:uuid", + "//third_party/haskell:vector", ], ) @@ -102,9 +101,9 @@ hspec_test( ":github-base", ":github-events", ":hs-github-tools", - hazel_library("QuickCheck"), - hazel_library("aeson"), - hazel_library("base"), - hazel_library("hspec"), + "//third_party/haskell:QuickCheck", + "//third_party/haskell:aeson", + "//third_party/haskell:base", + "//third_party/haskell:hspec", ], ) diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index 34fe876..c9f410c 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -1,4 +1,3 @@ -load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library") load("@rules_haskell//haskell:defs.bzl", "haskell_binary") [haskell_binary( @@ -7,9 +6,9 @@ load("@rules_haskell//haskell:defs.bzl", "haskell_binary") visibility = ["//visibility:public"], deps = [ "//hs-github-tools", - hazel_library("base"), - hazel_library("bytestring"), - hazel_library("github"), - hazel_library("text"), + "//third_party/haskell:base", + "//third_party/haskell:bytestring", + "//third_party/haskell:github", + "//third_party/haskell:text", ], ) for file in glob(["*.hs"])] diff --git a/tools/git-submit b/tools/git-submit index a99296a..02defee 100755 --- a/tools/git-submit +++ b/tools/git-submit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu diff --git a/tools/git-sync b/tools/git-sync index e215219..6a60528 100755 --- a/tools/git-sync +++ b/tools/git-sync @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash REMOTE="" BRANCH="${1-master}" diff --git a/web/BUILD.bazel b/web/BUILD.bazel index d5eb338..091b762 100644 --- a/web/BUILD.bazel +++ b/web/BUILD.bazel @@ -1,4 +1,3 @@ -load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library") load("@rules_haskell//haskell:defs.bzl", "haskell_binary") package(features = ["-layering_check"]) @@ -9,28 +8,28 @@ haskell_binary( visibility = ["//visibility:public"], deps = [ "//hs-github-tools", - hazel_library("Diff"), - hazel_library("aeson-pretty"), - hazel_library("base"), - hazel_library("bytestring"), - hazel_library("case-insensitive"), - hazel_library("containers"), - hazel_library("expiring-cache-map"), - hazel_library("github"), - hazel_library("http-media"), - hazel_library("http-types"), - hazel_library("pretty"), - hazel_library("servant"), - hazel_library("servant-server"), - hazel_library("suspend"), - hazel_library("text"), - hazel_library("time"), - hazel_library("timers"), - hazel_library("unordered-containers"), - hazel_library("uuid"), - hazel_library("wai"), - hazel_library("wai-cors"), - hazel_library("wai-extra"), - hazel_library("warp"), + "//third_party/haskell:Diff", + "//third_party/haskell:aeson-pretty", + "//third_party/haskell:base", + "//third_party/haskell:bytestring", + "//third_party/haskell:case-insensitive", + "//third_party/haskell:containers", + "//third_party/haskell:expiring-cache-map", + "//third_party/haskell:github", + "//third_party/haskell:http-media", + "//third_party/haskell:http-types", + "//third_party/haskell:pretty", + "//third_party/haskell:servant", + "//third_party/haskell:servant-server", + "//third_party/haskell:suspend", + "//third_party/haskell:text", + "//third_party/haskell:time", + "//third_party/haskell:timers", + "//third_party/haskell:unordered-containers", + "//third_party/haskell:uuid", + "//third_party/haskell:wai", + "//third_party/haskell:wai-cors", + "//third_party/haskell:wai-extra", + "//third_party/haskell:warp", ], )