Comments (4)
Feel free to send a PR to remove that restriction!
from bazel.
Prior to Bazel v7,
.download
and.download_and_extract
were beholden to the flag--experimental_repository_cache_urls_as_default_canonical_id
...
This is correct. As of Bazel 7, the flag is now a no-op and the repo rules you listed have been updated to use this logic by default.
... which in Bazel v6 (and possibly earlier) was enabled by default.
This is not correct, the flag wasn't enabled by default in previous versions of Bazel:
https://cs.opensource.google/bazel/bazel/+/release-6.5.0:src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java;l=243
If you are using rctx.download
or rctx.download_and_extract
in a custom repo rule and were previously using the --experimental_repository_cache_urls_as_default_canonical_id
flag to set a default canonical ID, you would have to update the logic to manually pass URLs into the canonical ID field. You can use the new public helper function get_default_canonical_id
in @bazel_tools//tools/build_defs/repo:cache.bzl
if you want to match the behavior of the special-cased rules.
from bazel.
Ah, my mistake. Perhaps the flag had been in use in our repo, or perhaps I had simply made a bad assumption.
In this case I have some suggestions;
rctx.download*
documentation should be updated to include what the defaultcanonical_id
is.rctx.download*
documentation should include examples for common patterns (such as usingget_default_canonical_id
).- Co-ordinate with ruleset authors so API usage uses an appropriate
canonical_id
(not having it set is probably a good signal that the behaviour hasn't been considered).
Some extra context for my request which I neglected to include in the OP. Due to the default behaviour, a TypeScript version upgrade was merged in a broken state due to an overlooked integrity hash.
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
rules_ts_dependencies(
ts_version_from = "//:package.json", # 5.4.2 -> 5.4.5
- ts_integrity = "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==",
+ ts_integrity = "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
)
This specific instance of the issue should not reoccur as we've updated usage to automatically pick up the hash.
rules_ts_dependencies(
ts_version_from = "@pnpm//:typescript/resolved.json",
)
from bazel.
I looked into using @bazel_tools//tools/build_defs/repo:cache.bzl
in an internal repo rule, without success. The helper has visibility("private")
preventing usage, it is not currently part of the public API.
from bazel.
Related Issues (20)
- [7.4.0] Skyframe invalidation with disk or remote cache HOT 1
- [7.4.0] Avoid unnecessary copying in `getDirectoryEntries` implementations HOT 1
- [7.4.0] Cherrypick b17552bfba80e69a4d86d5566c0237e6b8438fcf HOT 1
- [7.4.0] Force synchronous upload and reuse of possibly modified spawn outputs HOT 2
- Status of Bazel 8.0.0-pre.20240821.2
- [7.4.0] Crash when using subrules in aspects that uses to a bool_flag HOT 1
- [7.4.0] "expires" field from credential helper causes re-invocation of helper too often HOT 1
- [7.4.0] Bazel does not honor `umask` anymore HOT 2
- [7.4.0] Use Bazel 7.3.1 and flip `--incompatible_use_plus_in_repo_names` HOT 3
- [7.4.0] Add back path mapping test deleted in conflict resolution HOT 2
- 'unknown repo' error when using bzlmod, multiple modules and 'platforms' transitions HOT 4
- [7.4.0] Add support for in-memory outputs to output reuse HOT 2
- Bazel parse_headers feature is incompatible with C copts HOT 2
- Host release candidates in the BCR to address release candence mismatch HOT 2
- "I/O exception during sandboxed execution" with tree artifacts and `--remote_download_toplevel`
- [FeatureRequest] Support ZSTD encoding for HTTP remote cache server
- ArrayIndexOutOfBoundsException raised with --target_pattern_file
- [remote][windows]tries to create temp folder in C:\Windows HOT 4
- [7.4.0] Update `remote_execution.proto` HOT 1
- Performance issues on macos-14-arm with bazel prereleases HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bazel.