From 60b6095ed70e075a3a9817a6757800c807cea472 Mon Sep 17 00:00:00 2001 From: iphydf Date: Tue, 9 Jan 2024 00:12:32 +0000 Subject: [PATCH] feat: Add happy-arbitrary to the stack. --- .gitmodules | 3 +++ .hie-bios | 9 ++++++++- dockerfiles | 2 +- ghc.nix | 1 + hs-apigen | 2 +- hs-github-tools | 2 +- hs-happy-arbitrary | 1 + py_toxcore_c | 2 +- stack.yaml | 1 + third_party/haskell/BUILD.bazel | 1 + tools/.github | 2 +- tools/BUILD.bazel | 1 + tools/built/src/Dockerfile.haskell | 1 + tools/built/src/home/.config/home-manager/home.nix | 1 + tools/git-remotes | 4 ++++ tools/haskell/haskell_targets.bzl | 2 ++ 16 files changed, 29 insertions(+), 6 deletions(-) create mode 160000 hs-happy-arbitrary diff --git a/.gitmodules b/.gitmodules index 69073d3a..6c57d59a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,6 +28,9 @@ [submodule "hs-github-tools"] path = hs-github-tools url = https://github.com/TokTok/hs-github-tools +[submodule "hs-happy-arbitrary"] + path = hs-happy-arbitrary + url = https://github.com/TokTok/hs-happy-arbitrary [submodule "hs-msgpack-arbitrary"] path = hs-msgpack-arbitrary url = https://github.com/TokTok/hs-msgpack-arbitrary diff --git a/.hie-bios b/.hie-bios index 1f039b3f..cef8dc34 100755 --- a/.hie-bios +++ b/.hie-bios @@ -4,6 +4,13 @@ import re import subprocess import sys + +def skip(line: str) -> bool: + # Ignore linker flags (don't need them for HLS). + # Ignore preprocessor defines (they can differ per project). + return line.startswith("-l") or line.startswith("-D") + + if "--regenerate" in sys.argv: subprocess.run(["tools/haskell/gen_haskell_targets"], check=True) subprocess.run(["bazel", "build", "//tools/haskell:hie-bios@bios"], check=True) @@ -28,7 +35,7 @@ with open(os.environ["HIE_BIOS_OUTPUT"], "w") as fh: "/src/workspace/", line, ) - if line != prev and not line.startswith("-l"): + if line != prev and not skip(line): fh.write(line) prev = line # Make warnings non-fatal diff --git a/dockerfiles b/dockerfiles index 8a93fd21..50bb82f2 160000 --- a/dockerfiles +++ b/dockerfiles @@ -1 +1 @@ -Subproject commit 8a93fd21a7bad5fbd3b0438984abccccec9ab790 +Subproject commit 50bb82f2536911a4da5d4045a71b20efd5976658 diff --git a/ghc.nix b/ghc.nix index 5cf47d05..1c264ef5 100644 --- a/ghc.nix +++ b/ghc.nix @@ -32,6 +32,7 @@ with (import { }); exceptions expiring-cache-map extra + file-embed filepath generic-arbitrary github diff --git a/hs-apigen b/hs-apigen index 90fb2600..3678e8f4 160000 --- a/hs-apigen +++ b/hs-apigen @@ -1 +1 @@ -Subproject commit 90fb2600362b56c6c7a3b5228e67153057403006 +Subproject commit 3678e8f4bcc2744b56932aa498ce8e6a0f832e92 diff --git a/hs-github-tools b/hs-github-tools index 04031b76..7b47f133 160000 --- a/hs-github-tools +++ b/hs-github-tools @@ -1 +1 @@ -Subproject commit 04031b76c2311093201331067818a82cd5629909 +Subproject commit 7b47f133dc7061ea9cd00afff75777aec7681882 diff --git a/hs-happy-arbitrary b/hs-happy-arbitrary new file mode 160000 index 00000000..f5e40acb --- /dev/null +++ b/hs-happy-arbitrary @@ -0,0 +1 @@ +Subproject commit f5e40acbf451404d8dc586ea4ece806c7767b620 diff --git a/py_toxcore_c b/py_toxcore_c index 7cf088ba..632415cf 160000 --- a/py_toxcore_c +++ b/py_toxcore_c @@ -1 +1 @@ -Subproject commit 7cf088bad959d564f1b8956aac1184500e82bd26 +Subproject commit 632415cfa5675dbd445b3bf67c34a5371277db24 diff --git a/stack.yaml b/stack.yaml index 184c5456..68bcb272 100644 --- a/stack.yaml +++ b/stack.yaml @@ -3,6 +3,7 @@ packages: - hs-apigen/ - hs-cimple/ - hs-github-tools/ + - hs-happy-arbitrary/ - hs-msgpack-arbitrary/ - hs-msgpack-binary/ - hs-msgpack-rpc-conduit/ diff --git a/third_party/haskell/BUILD.bazel b/third_party/haskell/BUILD.bazel index e476c3ab..2aca90ac 100644 --- a/third_party/haskell/BUILD.bazel +++ b/third_party/haskell/BUILD.bazel @@ -40,6 +40,7 @@ licenses(["notice"]) "exceptions", "expiring-cache-map", "extra", + "file-embed", "filepath", "generic-arbitrary", "github", diff --git a/tools/.github b/tools/.github index 06671c08..6f12b035 160000 --- a/tools/.github +++ b/tools/.github @@ -1 +1 @@ -Subproject commit 06671c080edec4b480b512ecdd296d37cc24f78a +Subproject commit 6f12b03527b85e1838562ca015e0416939017986 diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index 1116afc0..2e8110cc 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -11,6 +11,7 @@ workspace(projects = [ "hs-apigen", "hs-cimple", "hs-github-tools", + "hs-happy-arbitrary", "hs-msgpack-arbitrary", "hs-msgpack-binary", "hs-msgpack-rpc-conduit", diff --git a/tools/built/src/Dockerfile.haskell b/tools/built/src/Dockerfile.haskell index 7dc4acec..8681385b 100644 --- a/tools/built/src/Dockerfile.haskell +++ b/tools/built/src/Dockerfile.haskell @@ -11,6 +11,7 @@ RUN cmake -Bc-toxcore/_build -Hc-toxcore -GNinja -DBOOTSTRAP_DAEMON=OFF -DCMAKE_ COPY --chown=builder:users hs-apigen/ /work/hs-apigen/ COPY --chown=builder:users hs-cimple/ /work/hs-cimple/ COPY --chown=builder:users hs-github-tools/ /work/hs-github-tools/ +COPY --chown=builder:users hs-happy-arbitrary/ /work/hs-happy-arbitrary/ COPY --chown=builder:users hs-msgpack-arbitrary/ /work/hs-msgpack-arbitrary/ COPY --chown=builder:users hs-msgpack-binary/ /work/hs-msgpack-binary/ COPY --chown=builder:users hs-msgpack-rpc-conduit/ /work/hs-msgpack-rpc-conduit/ diff --git a/tools/built/src/home/.config/home-manager/home.nix b/tools/built/src/home/.config/home-manager/home.nix index 5f546e31..97581a40 100644 --- a/tools/built/src/home/.config/home-manager/home.nix +++ b/tools/built/src/home/.config/home-manager/home.nix @@ -94,6 +94,7 @@ nnoremap :noh map Q gqap + au BufEnter *.x,*.y set ts=8 sw=8 noexpandtab au BufEnter BUILD.* set ft=bzl au FileType sh,javascript set ts=2 sw=2 au FileType go set noexpandtab diff --git a/tools/git-remotes b/tools/git-remotes index c2c6898a..0dbc3ce3 100755 --- a/tools/git-remotes +++ b/tools/git-remotes @@ -86,6 +86,10 @@ our %REPOS = ( upstream => 'toktok', repo 'iphydf', }], + 'hs-happy-arbitrary' => ['hs-happy-arbitrary', { + upstream => 'toktok', + repo 'iphydf', + }], 'hs-msgpack-arbitrary' => ['hs-msgpack-arbitrary', { upstream => 'toktok', repo 'iphydf', diff --git a/tools/haskell/haskell_targets.bzl b/tools/haskell/haskell_targets.bzl index df0d7df8..3890044b 100644 --- a/tools/haskell/haskell_targets.bzl +++ b/tools/haskell/haskell_targets.bzl @@ -15,6 +15,8 @@ HASKELL_TARGETS = [ "//hs-github-tools:github-events", "//hs-github-tools:hs-github-tools", "//hs-github-tools:testsuite", + "//hs-happy-arbitrary:hs-happy-arbitrary", + "//hs-happy-arbitrary:testsuite", "//hs-msgpack-arbitrary:hs-msgpack-arbitrary", "//hs-msgpack-arbitrary:testsuite", "//hs-msgpack-binary:hs-msgpack-binary",