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

chore: Update to new third_party method for haskell deps. #168

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/...
4 changes: 2 additions & 2 deletions .github/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/ /
73 changes: 36 additions & 37 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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",
],
)

Expand All @@ -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",
],
)

Expand All @@ -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",
],
)

Expand All @@ -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",
],
)
9 changes: 4 additions & 5 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library")
load("@rules_haskell//haskell:defs.bzl", "haskell_binary")

[haskell_binary(
Expand All @@ -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"])]
2 changes: 1 addition & 1 deletion tools/git-submit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eu

Expand Down
12 changes: 6 additions & 6 deletions tools/git-sync
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash

REMOTE=""
BRANCH="${1-master}"

if (echo "$BRANCH" | grep ':' > /dev/null); then
if (echo "$BRANCH" | grep ':' >/dev/null); then
REMOTE="$(echo "$BRANCH" | grep -o '^[^:]*')"
BRANCH="$(echo "$BRANCH" | grep -o '[^:]*$')"
REMOTE="$(git remote -v | grep ":$REMOTE/.* (push)" | grep -o '^\S*')"
Expand All @@ -14,7 +14,7 @@ set -eux
case "$BRANCH" in
--continue)
git rebase --continue
BRANCH=`git rev-parse --abbrev-ref HEAD`
BRANCH=$(git rev-parse --abbrev-ref HEAD)
;;

master)
Expand All @@ -26,15 +26,15 @@ case "$BRANCH" in
;;

*)
if [ -n "$REMOTE" ] && ! (git branch | grep "^..$BRANCH\$" > /dev/null); then
if [ -n "$REMOTE" ] && ! (git branch | grep "^..$BRANCH\$" >/dev/null); then
git checkout --track "$REMOTE/$BRANCH"
else
git checkout $BRANCH
git checkout "$BRANCH"
fi
git rebase upstream/master
;;
esac

git push --force
git checkout master
git branch -d $BRANCH
git branch -d "$BRANCH"
47 changes: 23 additions & 24 deletions web/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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"])
Expand All @@ -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",
],
)
Loading