Skip to content

Conversation

@peakschris
Copy link

@peakschris peakschris commented Aug 6, 2025

Most features are working

Adds:

  • Windows support
  • Use tar from tar.bzl directly instead of via aspect_lib
  • All rules upgraded to use runfiles libs; so --enable_runfiles not required on Windows
  • Bump tar aspect_lib and crane (for required windows fixes)
  • Bump container_structure_test (for windows; bump to latest)
  • Windows tests pass and are enabled in CI

Limitations

  • oci_load rules don't work - RUNFILES_DIR doesn't seem to be set - e.g. case11_test
  • have not validated that this works to build native windows containers

Fixes:

Other relevant PRs

Test results:
bazel test //... --action_env=PATH - 36 pass and 14 skipped
bazel test //... --action_env=PATH --enable_runfiles - 36 pass and 14 skipped

@peakschris
Copy link
Author

peakschris commented Aug 6, 2025

edit: no .bazelrc.user required

@aspect-workflows
Copy link

aspect-workflows bot commented Aug 6, 2025

Test

All tests were cache hits

49 tests (100.0%) were fully cached saving 25s.

@peakschris peakschris marked this pull request as ready for review August 8, 2025 19:43
Copy link
Collaborator

@thesayyn thesayyn left a comment

Choose a reason for hiding this comment

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

This looks great, i am okay with landing this as is, if you could selectively disable tests that doesn't work windows.

@peakschris peakschris changed the title windows support (partial) windows support Aug 8, 2025
@peakschris peakschris requested a review from thesayyn August 13, 2025 22:24
@peakschris
Copy link
Author

@thesayyn I now have bsdtar fixed on Windows; thanks to @alexeagle for pushing the patch through all the repos. rules_oci now looks like it is working pretty well.

  • There is the docs update to do; I can't do this as the docs update tooling doesn't work on Windows. Would you be able to push a commit to fix the docs?
  • Would it be possible to enable Windows CI?

Thanks!

@peakschris
Copy link
Author

@thesayyn ping

@peakschris
Copy link
Author

@thesayyn This is ready to go - except the docs update which I can't run from windows. Please would you do this and advise on next steps? Thank you!

cc @alexeagle @fmeum

@peakschris
Copy link
Author

@thesayyn I fixed the bazel-lib docs macros whilst I was waiting :-) so these docs files are now updated and this is ready to go.

@peakschris peakschris force-pushed the cb_windows branch 4 times, most recently from 83252d5 to 2d955fd Compare August 22, 2025 19:06
@peakschris
Copy link
Author

@fmeum I made some fixes; could you please trigger CI again?

@kcking
Copy link

kcking commented Sep 14, 2025

@thesayyn any chance you can take another look at this PR? :)

Copy link
Collaborator

@thesayyn thesayyn left a comment

Choose a reason for hiding this comment

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

This is looking closer. There seems to be some bad diff from formatters and feature additions which i'd like to address in a separate PR.

@peakschris peakschris requested a review from thesayyn October 16, 2025 00:08
@peakschris
Copy link
Author

@thesayyn Thanks for your review; I've addressed all your comments; moved unrelated features out; rebased to latest

Copy link
Collaborator

@thesayyn thesayyn left a comment

Choose a reason for hiding this comment

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

Looking great, a few small changes.

@thesayyn
Copy link
Collaborator

I'll merge this once the windows cfg selection is fixed.

@thesayyn
Copy link
Collaborator

@peakschris it would be nice to get windows CI back. do you mind adding that to the matrix? Also bcr presubmit will need to change to test for windows there.

@peakschris
Copy link
Author

@peakschris it would be nice to get windows CI back. do you mind adding that to the matrix? Also bcr presubmit will need to change to test for windows there.

I've added to bcr presubmit; happy to make a change to github workflows if you can guide me - I'm not familiar with this and superficially it looks like windows is already configured

@peakschris peakschris requested a review from thesayyn October 16, 2025 19:34
@peakschris peakschris requested a review from thesayyn October 16, 2025 20:03
@peakschris
Copy link
Author

@thesayyn trying to get windows CI added & not hanging by following pattern from bazel-lib; can you give me rights to trigger/retrigger the workflow?

@peakschris
Copy link
Author

@thesayyn I could use some advice. Building case4_transition with Bazel 8.3.1 or 8.4.1:

# Case 4: Transition an oci_image and feed to oci_tarball
oci_image(
    name = "case4",
    architecture = "arm64",
    os = "linux",
)

platform_transition_filegroup(
    name = "case4_transition",
    srcs = [":case4"],
    target_platform = "//examples:linux_arm64",
)

results in ctx.toolchains["@bazel_tools//tools/sh:toolchain_type"].path returning /bin/bash instead of C:\msys64\usr\bin\bash.exe as set in BAZEL_SH envvar. This results in the bat wrappers generated for windows failing with invalid path.

Is there any way to get the @bazel_tools//tools/sh:toolchain_type without it being interfered by the transition?

This is only an issue with bazel 8; bazel 7.6.1 returns the windows bash.exe

Thanks! Chris

@peakschris
Copy link
Author

bazelbuild/bazel#27310

@peakschris
Copy link
Author

@thesayyn @mostynb I'm going to give up on this for now; I'm unable to get all the tests green for the same reasons that this PR struggled: #842

Upgrading to a version of bazel_lib that contains a tar that works on Windows requires us to drop support for modules under bazel 6; as @mostynb argues we could consider dropping bazel 6 completely.

If you can get #842 merged then I can have another go with this.

@thesayyn
Copy link
Collaborator

Thanks, I'll see how i can help.


# Create the host platform repository transitively required by bazel-lib

maybe(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, why this is needed? i thought we simply dropped this requirement with some release of bazel_lib.

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure if it was needed; I was seeing strange errors relate to resolving zstd toolchain so I pasted it in from bazel_lib release notes.

@peakschris
Copy link
Author

Thanks, I'll see how i can help.

Thank you!

@mostynb
Copy link

mostynb commented Oct 17, 2025

Here's an attempt to upgrade CI to test bazel 7 and 8: #854

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.

4 participants