Skip to content

Conversation

@facundominguez
Copy link
Member

@facundominguez facundominguez commented Jul 12, 2025

Addresses #198

This PR configures gazelle_cabal to generate build rules from cabal files.

I had to make cat-tokens.sh a Haskell binary so gazelle_cabal can generate bazel rules that expose it to ghc.

@facundominguez facundominguez requested a review from Copilot July 12, 2025 00:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a standalone Cabal manifest for the JNI bindings and syncs Bazel rules via gazelle_cabal to restore jni.cabal support.

  • Introduce jni.cabal with library, executable, and test-suite configurations
  • Replace the sed-based genrule with a Haskell cat-tokens preprocessor tool
  • Update BUILD rules across tests, jvm, jvm-types, and top-level projects to wire in the new plugin and tool paths

Reviewed Changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/BUILD.bazel Adjust haskell_test to include size, plugin, tools, deps
shell.nix Refine host_platform instruction message
shell-stack.nix Add Nix shell definition for Stack-based development
nixpkgs.nix Update fetchTarball invocation to use sha256 record
jvm/tests/BUILD.bazel Reorder haskell_test fields for consistency
jvm/benchmarks/BUILD.bazel Reorder haskell_binary fields for consistency
jvm/BUILD.bazel Normalize glob quoting and move visibility earlier
jvm-types/src/test/haskell/BUILD.bazel Update test rule with size and extra_srcs
jvm-types/BUILD.bazel Reorder deps, plugins, and visibility
jni/tests/Spec.hs Adjust HSPEC_DISCOVER preprocessor invocation
jni/tests/BUILD.bazel Remove legacy jni tests BUILD file
jni/src/linear-types/Foreign/JNI/Safe.hs Add GHC OPTIONS for cat-tokens preprocessor
jni/src/common/Foreign/JNI/Unsafe/Internal.hs Add GHC OPTIONS for cat-tokens preprocessor
jni/jni.cabal New Cabal file declaring library, tool, and test-suite
jni/cat-tokens/Main.hs Implement Haskell-based token concatenator
jni/cat-tokens Remove old shell-based concatenator
jni/Setup.hs Add minimal Setup.hs for Cabal support
jni/BUILD.bazel Regenerate Bazel rules for jni.cabal via gazelle_cabal
WORKSPACE Add gazelle_cabal, stackage-exe, and related deps
BUILD.bazel Configure Gazelle integration and update inline-java rule
.github/workflows/build.yml Run bazel gazelle in CI and update job naming
Comments suppressed due to low confidence (3)

jni/src/linear-types/Foreign/JNI/Safe.hs:66

  • [nitpick] This comment references cat-tokens/Main.hs, but other modules refer to jni/cat-tokens/Main.hs. Please standardize the path so readers can locate the script consistently.
-- a portable way. See cat-tokens/Main.hs.

jni/src/common/Foreign/JNI/Unsafe/Internal.hs:16

  • [nitpick] The path in this comment differs from the one in Safe.hs. Consider unifying the reference to the cat-tokens/Main.hs tool location for clarity.
-- a portable way. See note cat-tokens in jni/cat-tokens/Main.hs.

jni/jni.cabal:72

  • In the test-suite spec stanza, the type field is split across two lines. Cabal expects a single-line scalar (type: exitcode-stdio-1.0), so this should be collapsed to one line.
  type:

@facundominguez facundominguez changed the title Add back jni.cabal Add back cabal files for jni, jvm, and inline-java Jul 12, 2025
@facundominguez facundominguez merged commit 4055ed9 into master Jul 12, 2025
3 of 4 checks passed
@facundominguez facundominguez deleted the fd/cabal-the-return branch July 12, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants