Skip to content

Add mercurial_repository repository rule#29247

Closed
willstranton wants to merge 2 commits intobazelbuild:masterfrom
willstranton:mercurial
Closed

Add mercurial_repository repository rule#29247
willstranton wants to merge 2 commits intobazelbuild:masterfrom
willstranton:mercurial

Conversation

@willstranton
Copy link
Copy Markdown
Contributor

@willstranton willstranton commented Apr 8, 2026

RELNOTES[NEW]: Adds support for mercurial with repository rule mercurial_repository

Progress towards #26065

Description

Adds the repository rule mercurial_repository to allow external repositories which use mercurial

Motivation

See #26065

Build API Changes

  1. Has this been discussed in a design doc or issue? (Please link it)

See #26065

  1. Is the change backward compatible?

Yes

  1. If it's a breaking change, what is the migration plan?

Not a breaking change.

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES[NEW]: Adds support for mercurial with repository rule mercurial_repository

@willstranton
Copy link
Copy Markdown
Contributor Author

I disabled the tests written since they required mercurial to be installed on the CI machines. If this change is ok to merge - can someone help me with the CI changes?

I think it's just adding apt install mercurial to all the Dockerfiles here: https://github.com/bazelbuild/continuous-integration/tree/master/buildkite/docker

But for Windows, I think it's https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/setup-windows.ps1 but I don't have a Windows machine or knowledge on how to install Mercurial in that environment.

@willstranton willstranton marked this pull request as ready for review April 8, 2026 01:46
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Apr 8, 2026
RELNOTES[NEW]: Adds support for mercurial with repository rule `mercurial_repository`

Progress towards bazelbuild#26065
@meisterT meisterT added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Apr 8, 2026
@meteorcloudy
Copy link
Copy Markdown
Member

This should probably live this in its own module, unless you want this to back bazel module one day, is that what you want?

@willstranton
Copy link
Copy Markdown
Contributor Author

unless you want this to back bazel module one day, is that what you want?

See #26065 - the original issue was asking for this to support BCR modules.

This would allow us to create BCR modules for repositories that are hosted on Mercurial, such as gmp

@meteorcloudy
Copy link
Copy Markdown
Member

I'm hesitant to accept this due to future maintenance cost, but I'm open to reconsider if enough users are requesting this.

such as gmp

Does http_archive work for this project?

@fmeum
Copy link
Copy Markdown
Collaborator

fmeum commented Apr 10, 2026

If we add BCR modules backed by this, wouldn't we have to hermetically provide mercurial as most users won't have it installed? That would definitely increase the maintenance burden.

@willstranton
Copy link
Copy Markdown
Contributor Author

such as gmp

Does http_archive work for this project?

http_archive does work for gmp. That's how a BCR module ended up being made for it, but I'll note that the last http archive release was in 2023-07-30. So any more recent changes would need access to the mercurial repository. There are some mirrors on github I found, but they're outdated.

wouldn't we have to hermetically provide mercurial as most users won't have it installed?

I wouldn't say that's a "have to". I'd imagine the an error would show, telling them they need to install mercurial to proceed.

I'm hesitant to accept this due to future maintenance cost, but I'm open to reconsider if enough users are requesting this.

Understood. I'll circle back on the original issue and see if there's more traction in the Bazel community.

@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants