Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: Make local runtime repo work on Windows #2862

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

EthanSteinberg
Copy link

fix: Make local runtime repo work on windows

In particular, this fixes two problems:

First, windows requires interface libraries to be linked in.
Second, windows requires an alternative search path (LIBDEST) since LIBDIR is not filled in.

In particular, this fixes two problems:

First, windows requires interface libraries to be linked in.
Second, windows requires an alternative search path since LIBDIR is not filled in.
@EthanSteinberg
Copy link
Author

Hi @rickeylev. Thanks for adding local_runtime_repo, but it doesn't seem to work on windows. Here is a fix that seems to work both locally on my machine and in github actions (https://github.com/som-shahlab/meds_reader is my repository using the fixed rules to enable Windows builds).

Can you take a look at this PR and help me get this merged? I'm not sure why it's failing the rules_python build checks.

Thanks!

@aignas
Copy link
Collaborator

aignas commented May 7, 2025

Thanks for the PR! PRs improving support on Windows are always welcome.

Could you please:

  • Run pre-commit run buildifier -a to fix the buildifier failure in the CI.
  • Add a CHANGELOG.md item in Fixed noting your contribution.

EDIT: since the local runtime repo should be now supported by all the platforms that the CI runs on, would it be possible to add a test so that this does not regress in the future?

Copy link
Collaborator

@rickeylev rickeylev left a comment

Choose a reason for hiding this comment

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

Yeah, I didn't try any of this with Windows, so thanks for this, @EthanSteinberg.

Mostly LGTM, but a few small changes requested.

re: adding a test: Yeah, a basic test for this would be good.

The place for the test would be in tests/integration/local_toolchains

Oddly, I don't see any windows exclusions for that? But, I would expect the windows CI to fail if it was running. So there must be a tag or something I'm missing.

In any case -- modifying tests/integration/local_toolchains/MODULE.bazel to have a windows section is the thing to do. You can cd into that directory and run bazel to improve your edit/run loop.

@EthanSteinberg
Copy link
Author

EthanSteinberg commented May 7, 2025

@aignas @rickeylev Thanks for the suggestions. It's a good call to add a test and it should be added before this is merged. I would be a bit worried about having this fragile functionality without a good CI test.

I have figured out why the current tests aren't working:

  1. All integration tests are currently disabled on windows. See https://github.com/bazel-contrib/rules_python/blob/main/.bazelci/presubmit.yml#L149

  2. The current local_runtime test does not verify that you can build a C++ Python extension and then load that extension.

Let me look into both of the above this weekend.

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.

3 participants