bazelbuild / bazelbuild/bazel

File generated by `sync --experimental_repository_resolved_file` contains absolute paths

Open
#11,067 4 comments 1 reaction 0 assignees View on GitHub
not stale P4 team-ExternalDeps type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the problem / feature request:

resolved.bzl file generation is not hermetic as the produced file contains absolute paths to Bazel's output directory. See for instance https://github.com/fenollp/bazel_lock/blob/bc5f8edeb5523502552c2f11221e2b8b38e92c1a/example_http_archive_resolved/resolved.bzl#L92

Thus it is much more difficult than just having to review a diff of the file as is intended in https://blog.bazel.build/2018/07/09/bazel-sync-and-resolved-file.html
Especially so when there is more than one entity generating the file.
More on that link: the generated file is not pretty printed (it is missing trailing commas).

### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

```
git clone https://github.com/fenollp/bazel_lock.git
cd bazel_lock/example_http_archive_resolved
bazel sync
git diff resolved.bzl
```

### What operating system are you running Bazel on?

Ubuntu 19.10

### What's the output of `bazel info release`?

release 2.2.0

### Have you found anything relevant by searching the web?

https://github.com/bazelbuild/bazel/issues/6261 mentions non-reproducible file generation, since fixed.

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

It seems the absolute paths only appear in values of `definition_information`.
See some of these paths at https://github.com/fenollp/bazel_lock/blob/bc5f8edeb5523502552c2f11221e2b8b38e92c1a/example_http_archive_resolved/resolved.bzl#L92

Contributor guide

Open the contributing guide

Research direction

Clone fenollp/bazel_lock, enter example_http_archive_resolved, run bazel sync, and inspect the diff of resolved.bzl. Focus on the generated definition_information values and the missing trailing commas; done means the resolved file contains no output-directory absolute paths and is pretty printed consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.