bazelbuild / bazelbuild/bazel

Bazel corrupt installation false positive on when output_user_root on a REFS partion

Open
#19,006 1 comment 0 reactions 0 assignees View on GitHub
help wanted P4 platform: windows team-OSS type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

When you run bazel with an output_user_root on a ReFS partition on windows you get the following error the second time you run bazel info:
`FATAL: corrupt installation: file 'd:\bzl\install\514d6bd1346ca30a25ef0dae1a54ba5f\embedded_tools\jdk\bin\java.exe' is missing or modified. Please remove 'd:\bzl/install/514d6bd1346ca30a25ef0dae1a54ba5f' and try again.`

Using process monitor you can see the last modified time of java.exe you can see have been changed by something. We tried implementing flush on windows, and we no-longer have a flush which may have caused the issue, however we still see the modified time set back.

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

On windows 11
Run "Disk Management":
action -> Create VHD - select a new location and give it say 10Gb and a Fixed Size
Format Mount the VHD to a drive letter and you will need to use NTFS initially

In File explorer take the new driver you have created and format it ReFS
I assume the drive is D: for this reproduction
```
cd D:
mkdir test
cd test
echo foo > WORKSPACE
bazel --output_user_root=D:/bzl
bazel --output_user_root=D:/bzl
```

On the first run it extracts and runs bazel
On the second run you get the error

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

Windows 11

### What is the output of `bazel info release`?

release 6.2.1

### 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 master; git rev-parse HEAD` ?

_No response_

### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

_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_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with Bazel 6.2.1 on Windows 11 using an output_user_root on a ReFS VHD, then inspect the installation validation involved in the second `bazel info` run. Done means repeated `bazel info` commands no longer report the extracted `java.exe` as missing or modified on ReFS.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.