WIP: Update vendored Skylib to 0.8.0 with some edits#2081
Closed
laszlocsomor wants to merge 1 commit intobazel-contrib:masterfrom
Closed
WIP: Update vendored Skylib to 0.8.0 with some edits#2081laszlocsomor wants to merge 1 commit intobazel-contrib:masterfrom
laszlocsomor wants to merge 1 commit intobazel-contrib:masterfrom
Conversation
Motivation: lib/unittest.bzl works with Bazel's native test wrapper on Windows, which will replace the current Bash-script-based test wrapper. The "some edits" in the header refer to: - rewriting labels in `load()` statements - omitting 'tests' and 'docs' directories from Skylib 0.8.0 See bazelbuild/bazel#6622
Contributor
Author
|
I believe the tests failed because the Bazel version is too old for Skylib 0.8.0 |
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
…ntrib#2201) This value has been hardcoded for a long time, so let's add the `patch_strip` attribute to the `WORKSPACE` setups now so that we add less tech debt in the `bzlmod` world later and need to migrate `bzlmod` users from the hard coded value to something that can be configured. This should be backwards compatible because of the default `int` value of `1` for the `patch_strip` attribute. Summary: - feat: add `patch_strip` to `python_repository`. - feat: add the default value of patch_strip to get_release_info. - refactor: handle patch_strip key in `TOOL_VERSIONS`. Work towards bazel-contrib#2081. --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
With this PR we get rudimentary unit tests for the `python` bzlmod extension which allows us to unit test the override behaviour that will become more complex soon. Summary: - refactor: inline the python_register_toolchains - refactor: use toolchain_info to call python_register_toolchains - refactor: move the registration out of the main loop - refactor: split the parsing of the modules to a separate function - test(bzlmod): add python.toolchain module parsing tests Work towards bazel-contrib#2081 --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
… in full_version (bazel-contrib#2219) This PR just makes the `MINOR_MAPPING` overridable and explicit in many macros/rules that we own. Even though technically new API is exposed, I am not sure if it is possible to use it and I am not sure if we should advertise it. Explicit minor_mapping results in easier wiring of `python.override` `bzlmod` extension tag class planned for bazel-contrib#2081.
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
…rib#2218) This `semver` function may turn out to be useful in validating the input for the `python.*override` tag classes to be added in a followup PR. Because this is a refactor of an existing code and adding tests, I decided to split it out. For a POC see bazel-contrib#2151, work towards bazel-contrib#2081.
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
…-contrib#2217) This is a different take on bazel-contrib#2205. Summary: - Remove version constraints from the `//python/config_settings:python_version`. - Remove `is_python_config_setting` macro and use a different implementation to retain the same functionality. This in general will improve the situation on how the toolchains are registered and hopefully is a step towards resolving issues for bazel-contrib#2081.
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
…separate files (bazel-contrib#2232) This makes the dependency management in WORKSPACE much easier to do. Summary: - refactor: split out the py_repositories call to a separate file - refactor: split out the python_repository rule to a separate file - refactor: split out the standalone interpreter utility function - refactor: split out the python_register_toolchains function - refactor: rename the remaining file Work towards bazel-contrib#2081.
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
Before this PR the users could not override how the hermetic toolchain is downloaded when in `bzlmod`. However, the same APIs would be available to users using `WORKSPACE`. With this we also allow root modules to restrict which toolchain versions the non-root modules, which may be helpful when optimizing the CI runtimes so that we don't waste time downloading multiple `micro` versions of the same `3.X` python version, which most of the times have identical behavior. Whilst at it, tweak the `semver` implementation to allow for testing of absence of values in the original input. Work towards bazel-contrib#2081 and this should be one of the last items that are blocking bazel-contrib#1361 from the API point of view. Replaces bazel-contrib#2151. --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
yushan26
pushed a commit
to yushan26/rules_go
that referenced
this pull request
Jun 16, 2025
…l-contrib#2253) With this change we set the default value of `--python_version` when the `python.toolchain` is used in `bzlmod` and we generate the appropriate config settings based on the registered toolchains and given overrides by the root module. This means that we expect the `--python_version` to be always set to a non-empty value under `bzlmod` and we can cleanup code which was handling `//conditions:default` case. This also means that we can in theory drop the requirement for `python_version` in `pip.parse` and just setup dependencies for all packages that we find in the `requirements.txt` file and move on. This is left as future work by myself or anyone willing to contribute. We can also start reusing the same `whl_library` instance for multi-platform packages because the python version flag is always set - this will simplify the layout and makes the feature non-experimental anymore under bzlmod. Summary: * Add `@pythons_hub` to the `WORKSPACE` with dummy data to make pythons_hub work. * Add `MINOR_MAPPING` and `PYTHON_VERSIONS` to pythons_hub to generate the config settings. * Remove handling of the default version in `pypi` code under bzlmod. Work towards bazel-contrib#2081, bazel-contrib#260, bazel-contrib#1708 --------- Co-authored-by: Richard Levasseur <rlevasseur@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation: lib/unittest.bzl now works with Bazel's
native test wrapper on Windows, which will replace
the current Bash-script-based test wrapper.
The "some edits" are described in
"go/private/skylib/README.rst".
See bazelbuild/bazel#6622