Add back cabal files for jni, jvm, and inline-java#201
Merged
facundominguez merged 13 commits intomasterfrom Jul 12, 2025
Merged
Add back cabal files for jni, jvm, and inline-java#201facundominguez merged 13 commits intomasterfrom
facundominguez merged 13 commits intomasterfrom
Conversation
There was a problem hiding this comment.
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.cabalwith library, executable, and test-suite configurations - Replace the sed-based genrule with a Haskell
cat-tokenspreprocessor 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 tojni/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 thecat-tokens/Main.hstool location for clarity.
-- a portable way. See note cat-tokens in jni/cat-tokens/Main.hs.
jni/jni.cabal:72
- In the
test-suite specstanza, thetypefield 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:
4f11463 to
9806b24
Compare
4c17f2d to
47526f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #198
This PR configures gazelle_cabal to generate build rules from cabal files.
I had to make
cat-tokens.sha Haskell binary so gazelle_cabal can generate bazel rules that expose it to ghc.