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

Preliminary bzlmod support #60

Merged
merged 15 commits into from
Sep 29, 2023
Merged

Preliminary bzlmod support #60

merged 15 commits into from
Sep 29, 2023

Conversation

aherrmann
Copy link
Member

@aherrmann aherrmann commented Sep 26, 2023

This configures the gazelle_cabal workspace to be compatible with bzlmod as a dependency module. Meaning another module can depend on it via bzlmod, however gazelle_cabal cannot itself be tested or built with bzlmod enabled, yet.

This also configures the example workspace to be compatible with bzlmod as a root module. Meaning the example can be built and tested with bzlmod enabled.

Enables bzlmod tests on CI, for now only for GHC version 9.4.5.

limitations / future work

  • The root module cannot itself be tested or built with bzlmod, yet.
  • The tests are not built with bzlmod, yet.
    The alternative-deps test requires renaming the stack snapshot workspace names to stackage-b and stackage-b-exe. This is currently not possible. One path would be a name attribute to stack_snapshot. However, this is not desirable as discussed in Allow using multiple stack snapshots in a MODULE.bazel rules_haskell#1962. Another approach is to use isolated extensions (requires Bazel 6.3) and remapping on use_repo. But, use_repo uses keyword argument syntax for the remapping target, and stackage-b or stackage-b-exe do (AFAIK) not form valid identifiers in Starlark.
  • The GHC version is hard-coded in the MODULE.bazel file and fixed to 9.4.5.
    The version number is factored out into a variable. A simple future improvement would be to simply change that variable in place in the CI pipeline to test other versions.
  • The Gazelle extension does not itself support bzlmod, yet. In particular, update-repos does assume a WORKSPACE setup.

closes #63 #66

@aherrmann
Copy link
Member Author

This will require an update of the required CI checks on GitHub.

use_repo(stack_snapshot, "stackage")
stack_snapshot.package(name = "directory")
stack_snapshot.package(name = "filepath")
stack_snapshot.package(name = "json")
Copy link
Member

Choose a reason for hiding this comment

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

That's nicer 👍

Copy link
Member

@avdv avdv left a comment

Choose a reason for hiding this comment

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

Thank you!

@aherrmann
Copy link
Member Author

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Sep 29, 2023

rebase

🛑 Unable to rebase the branch because the pull request is queued

It's not possible to rebase this pull request because it is queued for merge

@mergify mergify bot merged commit 37370de into main Sep 29, 2023
9 checks passed
@mergify mergify bot deleted the bzlmod branch September 29, 2023 14:23
@mergify mergify bot removed the merge-queue label Sep 29, 2023
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.

Be able to depend on Gazelle Cabal via bzlmod.
2 participants