Skip to content

Publish version_utils@0.1.0#5205

Merged
meteorcloudy merged 1 commit intobazelbuild:mainfrom
jjmaestro:version_utils-v0.1.0
Aug 14, 2025
Merged

Publish version_utils@0.1.0#5205
meteorcloudy merged 1 commit intobazelbuild:mainfrom
jjmaestro:version_utils-v0.1.0

Conversation

@jjmaestro
Copy link
Contributor

@bazel-io
Copy link
Member

Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (version_utils) have been updated in this PR.
Please review the changes. You can view a diff against the previous version in the "Generate module diff" check.

@jjmaestro
Copy link
Contributor Author

@bazel-io skip_check compatibility_level

@bazel-io bazel-io added the skip-compatibility-level-check Skip the compatibility_level check for MODULE.bazel label Jul 17, 2025
@jjmaestro jjmaestro marked this pull request as ready for review July 17, 2025 08:52
@meteorcloudy meteorcloudy added the presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval label Jul 17, 2025
@jjmaestro
Copy link
Contributor Author

I'll check the failures, all of them are in Windows, where I hadn't tested it I think! :S

@jjmaestro
Copy link
Contributor Author

Actually, I did test it across all platforms! And it worked on Windows! So I'm a bit surprised...

I think the error could be because I'm using a symlink, examples/suite.bzl --> ../tests/suite.bzl (a common helper file that I have for tests) and somehow, the CI Windows job in Buildkite doesn't like symlinks :-?

@meteorcloudy is this expected? :-?

@meteorcloudy
Copy link
Member

@jjmaestro
Copy link
Contributor Author

Just a small update, I've been trying to get a Windows VM working, and then, get Bazel to run. I've now got it to run, but I'm getting a Python failure 😅 TL;DR I'll continue trying to get this up-and-running to repro and investigate what's going on, but... is there a better / simpler way to test this failure in e.g. a Windows docker image with everything setup or something along those lines? :-?

@meteorcloudy
Copy link
Member

Sorry, we are not using any Windows docker image, but I would expect the bazel build to be hermetic.

@jjmaestro
Copy link
Contributor Author

(...) but I would expect the bazel build to be hermetic

Yeah, I was expecting it too, but somehow, I'm getting this failure:

> bazel run //tools:setup_presubmit_repos -- --module version_utils@0.1.0
Starting local Bazel server (8.3.1) and connecting to it...
ERROR: C:/users/javier/_bazel_javier/pqprrnwe/external/rules_python+/python/private/pypi/extension.bzl:124:17: Traceback (most recent call last):
        File "C:/users/javier/_bazel_javier/pqprrnwe/external/rules_python+/python/private/pypi/extension.bzl", line 625, column 25, in _pip_impl
                mods = parse_modules(module_ctx, enable_pipstar = rp_config.enable_pipstar)
        File "C:/users/javier/_bazel_javier/pqprrnwe/external/rules_python+/python/private/pypi/extension.bzl", line 501, column 36, in parse_modules
                out = _create_whl_repos(
        File "C:/users/javier/_bazel_javier/pqprrnwe/external/rules_python+/python/private/pypi/extension.bzl", line 124, column 17, in _create_whl_repos
                fail((
Error in fail: Unable to find interpreter for pip hub 'pip' for python_version=3.11: Make sure a corresponding `python.toolchain(python_version="3.11")` call exists.Expected to find python_3_11_host among registered versions:

ERROR: error evaluating module extension @@rules_python+//python/extensions:pip.bzl%pip
INFO: Elapsed time: 7.139s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED:
    Fetching repository @@aspect_rules_js+; starting
    Fetching module extension @@rules_python+//python/extensions:pip.bzl%pip; starting
    Fetching C:/users/javier/_bazel_javier/pqprrnwe/external/aspect_rules_js+; Extracting rules_js-v2.4.0.tar.gz

I'll continue working on this later today, maybe it's something silly and easy to work around, or maybe I'm doing something wrong :) I'll keep you posted!

@jjmaestro
Copy link
Contributor Author

@meteorcloudy I've managed to install Python 3.11 and both python and pip are available but I'm getting the same failure (this is on a clean clone of the repo and checkout the PR branch):

> python --version
Python 3.11.9

> pip --version
pip 24.0 from C:\Program Files\Python311-arm64\Lib\site-packages\pip (python 3.11)

> bazel run //tools:setup_presubmit_repos -- --module version_utils@0.1.0
Starting local Bazel server (8.3.1) and connecting to it...
ERROR: C:/users/javier/_bazel_javier/pqprrnwe/external/rules_python+/python/private/pypi/extension.bzl:124:17: Traceback (most recent call last):
        File "C:/users/javier/_bazel_javier/pqprrnwe/external/rules_python+/python/private/pypi/extension.bzl", line 625, column 25, in _pip_impl
                mods = parse_modules(module_ctx, enable_pipstar = rp_config.enable_pipstar)
        File "C:/users/javier/_bazel_javier/pqprrnwe/external/rules_python+/python/private/pypi/extension.bzl", line 501, column 36, in parse_modules
                out = _create_whl_repos(
        File "C:/users/javier/_bazel_javier/pqprrnwe/external/rules_python+/python/private/pypi/extension.bzl", line 124, column 17, in _create_whl_repos
                fail((
Error in fail: Unable to find interpreter for pip hub 'pip' for python_version=3.11: Make sure a corresponding `python.toolchain(python_version="3.11")` call exists.Expected to find python_3_11_host among registered versions:

ERROR: error evaluating module extension @@rules_python+//python/extensions:pip.bzl%pip
INFO: Elapsed time: 16.471s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED:
    Fetching repository @@aspect_rules_js+; starting
    Fetching module extension @@rules_python+//python/extensions:pip.bzl%pip; starting
    Fetching C:/users/javier/_bazel_javier/pqprrnwe/external/aspect_rules_js+; Extracting rules_js-v2.4.0.tar.gz

@jjmaestro
Copy link
Contributor Author

@meteorcloudy I got a reply in Slack, the issue is the architecture, arm64: bazel-contrib/rules_python#2276

I'll try to get an x86 VM working, but that will take me a while :S

@jjmaestro
Copy link
Contributor Author

jjmaestro commented Jul 18, 2025

I've tried with a local VM but it's dog-slog in my mac :-/ So, I decided to try with a GCP Windows VM and that has worked... up to a new error:

(...)
ERROR: C:/users/jjmaestro/work/bazel-central-registry/tools/BUILD:129:8: Executing genrule //tools:bcr_presubmit_py failed: (Exit -1): bash.exe failed: error executing Genrule command (from target //tools:bcr_presubmit_py) c:\msys64\usr\bin\bash.exe -c ... (remaining 1 argument skipped)
(...)

I managed to get past that error installing MSYS2 with Chocolatey, then had another error where I needed patch, which I installed with choco but that was a "too old" version (2.5?) and there was another error, failed to patch files due to (probably?) EOF characters or something like that... sooo then, I installed another patch with MSYS2 pacman...

Bazel ̶H̶e̶r̶m̶e̶t̶i̶s̶m̶ for the win!? 🤣😅

Anyway, I've now managed to repro the issue, I get the same error as buildkite:

examples> bazel --nosystem_rc --nohome_rc test --announce_rc --verbose_failures -- //...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=196
INFO: Reading rc options for 'test' from c:\users\jjmaestro\work\bazel-central-registry\temp_test_repos\version_utils\0.1.0\test_module\output\bazel_version_utils-0.1.0\examples\.bazelrc:
  Inherited 'common' options: --enable_bzlmod --registry=file:///C:/users/jjmaestro/work/bazel-central-registry
ERROR: error loading package under directory '': error loading package 'spec': at C:/users/jjmaestro/work/bazel-central-registry/temp_test_repos/version_utils/0.1.0/test_module/output/bazel_version_utils-0.1.0/examples/spec/spec.bzl:5:6: Encountered error while reading extension file 'suite.bzl': C:\users\jjmaestro\work\bazel-central-registry\temp_test_repos\version_utils\0.1.0\test_module\output\bazel_version_utils-0.1.0\examples\suite.bzl (The filename, directory name, or volume label syntax is incorrect)
INFO: Elapsed time: 3.933s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Couldn't start the build. Unable to run tests

Checking the contents of the directory:

examples> dir

(...)

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         7/17/2025   8:41 AM                spec
d-----         7/17/2025   8:41 AM                tools
d-----         7/17/2025   8:41 AM                version
-a----         7/18/2025   9:32 PM            102 .bazelrc
-a---l         7/18/2025   9:32 PM              0 .bazelrc.ci
-a---l         7/18/2025   9:32 PM              0 .bazelversion
-a----         7/17/2025   8:41 AM              0 BUILD.bazel
-a----         7/17/2025   8:41 AM            295 MODULE.bazel
-a----         7/17/2025   8:41 AM            416 README.md
-a---l         7/18/2025   9:32 PM              0 suite.bzl

So, suite.bzl is a symlink, as expected, pointing to the right place

examples> Get-Item .\suite.bzl | Format-List *

PSPath            : Microsoft.PowerShell.Core\FileSystem::C:\users\jjmaestro\work\bazel-central-registry\temp_test_repos\version_utils\0.1.0\test_module\output\bazel_version_utils-0.1.0\examples\
                    suite.bzl
PSParentPath      : Microsoft.PowerShell.Core\FileSystem::C:\users\jjmaestro\work\bazel-central-registry\temp_test_repos\version_utils\0.1.0\test_module\output\bazel_version_utils-0.1.0\examples
PSChildName       : suite.bzl
PSDrive           : C
PSProvider        : Microsoft.PowerShell.Core\FileSystem
PSIsContainer     : False
Mode              : -a---l
VersionInfo       : File:             C:\users\jjmaestro\work\bazel-central-registry\temp_test_repos\version_utils\0.1.0\test_module\output\bazel_version_utils-0.1.0\examples\suite.bzl
                    InternalName:
                    OriginalFilename:
                    FileVersion:
                    FileDescription:
                    Product:
                    ProductVersion:
                    Debug:            False
                    Patched:          False
                    PreRelease:       False
                    PrivateBuild:     False
                    SpecialBuild:     False
                    Language:

BaseName          : suite
Target            : {../tests/suite.bzl}
LinkType          : SymbolicLink
Name              : suite.bzl
Length            : 0
DirectoryName     : C:\users\jjmaestro\work\bazel-central-registry\temp_test_repos\version_utils\0.1.0\test_module\output\bazel_version_utils-0.1.0\examples
Directory         : C:\users\jjmaestro\work\bazel-central-registry\temp_test_repos\version_utils\0.1.0\test_module\output\bazel_version_utils-0.1.0\examples
IsReadOnly        : False
Exists            : True
FullName          : C:\users\jjmaestro\work\bazel-central-registry\temp_test_repos\version_utils\0.1.0\test_module\output\bazel_version_utils-0.1.0\examples\suite.bzl
Extension         : .bzl
CreationTime      : 7/18/2025 9:32:55 PM
CreationTimeUtc   : 7/18/2025 9:32:55 PM
LastAccessTime    : 7/18/2025 9:32:55 PM
LastAccessTimeUtc : 7/18/2025 9:32:55 PM
LastWriteTime     : 7/18/2025 9:32:55 PM
LastWriteTimeUtc  : 7/18/2025 9:32:55 PM
Attributes        : Archive, ReparsePoint

But, somehow, I can't read it either in PowerShell:

examples> Get-Content .\suite.bzl
Get-Content : The filename, directory name, or volume label syntax is incorrect.
At line:1 char:1
+ Get-Content .\suite.bzl
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ReadError: (C:\users\jjmaes...mples\suite.bzl:String) [Get-Content], IOException
    + FullyQualifiedErrorId : GetContentReaderIOError,Microsoft.PowerShell.Commands.GetContentCommand

However, I can read the target file:

examples> Get-Content ..\tests\suite.bzl
"""suite.bzl"""

def test_suite(name, tests):
    for test_name, test in tests.items():
        test(name = "%s/%s" % (name, test_name))

    native.test_suite(
        name = name,
        tests = [
            ":%s/%s" % (name, test_name)
            for test_name in tests
        ],
    )

@jjmaestro
Copy link
Contributor Author

But, I've now tried launching C:\msys64\usr\bin\bash.exe and I can see the symlink and cat it... 😅

@jjmaestro
Copy link
Contributor Author

I've managed to get it to work by removing the symlink by hand and making another symlink with the absolute path to tests/suite.bzl instead of the relative path.

I'll try to debug / go through bcr_presubmit.py and see if I can find anything, but meanwhile, if this rings a bell, let me know and point me at it, I'll be happy to try and help fix it! :)

jjmaestro added a commit to jjmaestro/continuous-integration that referenced this pull request Jul 19, 2025
Although relative links are valid in Windows, it seems that they fail
under some circumstances. For example, see
bazelbuild/bazel-central-registry#5205
@jjmaestro
Copy link
Contributor Author

@meteorcloudy I've made a fix to make all symlinks in the test repo absolute, let me know if that fix looks ok!

jjmaestro added a commit to jjmaestro/continuous-integration that referenced this pull request Aug 12, 2025
Although relative links are valid in Windows, it seems that they fail
under some circumstances. For example, see
bazelbuild/bazel-central-registry#5205
jjmaestro added a commit to jjmaestro/continuous-integration that referenced this pull request Aug 12, 2025
Although relative links are valid in Windows, it seems that they fail
under some circumstances. For example, see
bazelbuild/bazel-central-registry#5205
meteorcloudy pushed a commit to bazelbuild/continuous-integration that referenced this pull request Aug 14, 2025
Although relative links are valid in Windows, it seems that they fail
under some circumstances. For example, see
bazelbuild/bazel-central-registry#5205
Copy link
Member

@meteorcloudy meteorcloudy left a comment

Choose a reason for hiding this comment

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

Thanks for contributing and fixing the presubmit!

@meteorcloudy meteorcloudy merged commit bab4f8e into bazelbuild:main Aug 14, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval skip-compatibility-level-check Skip the compatibility_level check for MODULE.bazel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants