Skip to content
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

Make build without bytes take into account http_file #22366

Open
ismell opened this issue May 14, 2024 · 4 comments
Open

Make build without bytes take into account http_file #22366

ismell opened this issue May 14, 2024 · 4 comments
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team type: feature request

Comments

@ismell
Copy link

ismell commented May 14, 2024

Description of the feature request:

The http_file repository rule takes in a URL, a SHA256 and the name of the output file. Since we "sometimes" have the SHA256 of the file, in theory it should be possible to use this information in the build without bytes computation. This would allow users/CI bots to skip downloading these files and directly download the output artifacts if they are in the CAS.

A work around for this is to write our own http_file bazel rule that performs the network access. The disadvantage to this is that it doesn't interact with the local repos CAS. i.e., .cache/bazel/_bazel_$USER/cache/repos/v1/content_addressable/sha256

Which category does this issue belong to?

Core

What underlying problem are you trying to solve with this feature?

Prevent unnecessarily downloading action inputs if they outputs are already in the CAS.

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

No response

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added the team-Core Skyframe, bazel query, BEP, options parsing, bazelrc label May 14, 2024
@haxorz haxorz added team-Remote-Exec Issues and PRs for the Execution (Remote) team and removed team-Core Skyframe, bazel query, BEP, options parsing, bazelrc labels May 15, 2024
@haxorz
Copy link
Contributor

haxorz commented May 15, 2024

team-Core doesn't own "build without bytes"

@wilwell wilwell removed the untriaged label May 28, 2024
@wilwell wilwell assigned tjgq and unassigned coeuvre May 28, 2024
@tjgq
Copy link
Contributor

tjgq commented May 28, 2024

"Building without the bytes" as currently implemented only applies to output artifacts (as opposed to source artifacts). If I understand it correctly, you're asking to extend it to cover source artifacts, so that we can avoid materializing "intermediate sources" (e.g. the result of decompressing a source archive into the source tree) in the same way BwoB avoids downloading "intermediate outputs" today. Is this an accurate restatement?

I think this is a reasonable feature request, but it would be a fairly large change; because Bazel fundamentally treats source/output artifacts and the rules that produce them differently, it's not a simple matter of plumbing repository rules into the existing BwoB infrastructure. If we decide to work on this, we should probably look at the broader applicability of "lazy source artifacts" (e.g. #16380, while describing a different use case, would likely boil down to the same feature request).

@tjgq tjgq removed their assignment May 28, 2024
@ismell
Copy link
Author

ismell commented May 29, 2024

Yep, exactly. I think one way of tackling this would be to implement an http_file bazel rule (instead of a repo rule). That's our current plan to deal with this, but it would be nice if bazel provided this at some point.

@Wyverald
Copy link
Member

See previous design proposal: https://docs.google.com/document/d/1OsEHpsJXXMC9SFAmAh20S42Dbmgdj4cNyYAsFOHMibo/edit

And discussion: #20464

(tl;dr: the principled solution to this would take a lot of design work and potentially years to yield a usable result)

copybara-service bot pushed a commit to bazelbuild/rules_java that referenced this issue Jul 2, 2024
Copybara Import from #195

BEGIN_PUBLIC
Fix path mapping logic in `bootclasspath` for generated files (#195)

If the files comprising the Java runtime are not source files, the path to the Java home needs to be path mapped.

Work towards bazelbuild/bazel#22366

Closes #195
END_PUBLIC

COPYBARA_INTEGRATE_REVIEW=#195 from fmeum:java-home-path-map 43323b7
PiperOrigin-RevId: 648662342
Change-Id: Idba93798982878d3f542b54d69c9536efd721db2
copybara-service bot pushed a commit that referenced this issue Jul 26, 2024
In `CommandLines`, the very first argument of the first command line is always a path to an executable. As such, it should be path mapped, even when it is a string. This wasn't the case for `SpawnAction`'s created via `ctx.actions.run(executable = <some string>)`.

Work towards #6526
Work towards #22366

Closes #22844.

PiperOrigin-RevId: 656258007
Change-Id: Ia046a7cc66aae51aec764e2f1c49e1d4f69e4b37
fmeum added a commit to fmeum/bazel that referenced this issue Jul 26, 2024
In `CommandLines`, the very first argument of the first command line is always a path to an executable. As such, it should be path mapped, even when it is a string. This wasn't the case for `SpawnAction`'s created via `ctx.actions.run(executable = <some string>)`.

Work towards bazelbuild#6526
Work towards bazelbuild#22366

Closes bazelbuild#22844.

PiperOrigin-RevId: 656258007
Change-Id: Ia046a7cc66aae51aec764e2f1c49e1d4f69e4b37

Closes bazelbuild#23040
fmeum added a commit to fmeum/bazel that referenced this issue Jul 26, 2024
In `CommandLines`, the very first argument of the first command line is always a path to an executable. As such, it should be path mapped, even when it is a string. This wasn't the case for `SpawnAction`'s created via `ctx.actions.run(executable = <some string>)`.

Work towards bazelbuild#6526
Work towards bazelbuild#22366

Closes bazelbuild#22844.

PiperOrigin-RevId: 656258007
Change-Id: Ia046a7cc66aae51aec764e2f1c49e1d4f69e4b37

Closes bazelbuild#23040
github-merge-queue bot pushed a commit that referenced this issue Jul 29, 2024
In `CommandLines`, the very first argument of the first command line is
always a path to an executable. As such, it should be path mapped, even
when it is a string. This wasn't the case for `SpawnAction`'s created
via `ctx.actions.run(executable = <some string>)`.

Work towards #6526
Work towards #22366

Closes #22844.

PiperOrigin-RevId: 656258007
Change-Id: Ia046a7cc66aae51aec764e2f1c49e1d4f69e4b37

Closes #23040
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team type: feature request
Projects
None yet
Development

No branches or pull requests

9 participants