Skip to content

Commit 3d0ffd8

Browse files
committed
[NO TESTS] WIP
1 parent 68db2ba commit 3d0ffd8

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

py/tests/py_venv_image_layer/my_app_amd64_layers_listing.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,13 +2510,13 @@ files:
25102510
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/
25112511
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/
25122512
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/
2513-
- -rwxr-xr-x 0 0 0 2856 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/activate
2513+
- -rwxr-xr-x 0 0 0 2853 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/activate
25142514
- -rwxr-xr-x 0 0 0 850184 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/python
25152515
- -rwxr-xr-x 0 0 0 850184 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/python3
25162516
- -rwxr-xr-x 0 0 0 850184 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/python3.9
25172517
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/
25182518
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/
2519-
- -rwxr-xr-x 0 0 0 301 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/pyvenv.cfg
2519+
- -rwxr-xr-x 0 0 0 344 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/pyvenv.cfg
25202520
- -rwxr-xr-x 0 0 0 299 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/__main__.py
25212521
- -rwxr-xr-x 0 0 0 1275 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/my_app_bin
25222522
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/bazel_tools/

py/tests/py_venv_image_layer/my_app_arm64_layers_listing.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,13 +2491,13 @@ files:
24912491
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/
24922492
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/
24932493
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/
2494-
- -rwxr-xr-x 0 0 0 2856 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/activate
2494+
- -rwxr-xr-x 0 0 0 2853 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/activate
24952495
- -rwxr-xr-x 0 0 0 726736 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/python
24962496
- -rwxr-xr-x 0 0 0 726736 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/python3
24972497
- -rwxr-xr-x 0 0 0 726736 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/bin/python3.9
24982498
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/
24992499
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/
2500-
- -rwxr-xr-x 0 0 0 302 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/pyvenv.cfg
2500+
- -rwxr-xr-x 0 0 0 345 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/pyvenv.cfg
25012501
- -rwxr-xr-x 0 0 0 299 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/__main__.py
25022502
- -rwxr-xr-x 0 0 0 1275 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/my_app_bin
25032503
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/bazel_tools/

py/tools/runfiles/src/lib.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ impl Runfiles {
155155
/// RUNFILES_MANIFEST_FILE environment variable is present,
156156
/// or a directory based Runfiles object otherwise.
157157
pub fn create() -> Result<Self> {
158+
// Note that the MANIFEST_FILE_ENV_VAR may be set but also blank.
158159
let mode = match std::env::var_os(MANIFEST_FILE_ENV_VAR) {
159160
Some(manifest_file) if (!manifest_file.is_empty()) => {
160161
Self::create_manifest_based(Path::new(&manifest_file))?
@@ -270,11 +271,20 @@ fn parse_repo_mapping(path: PathBuf) -> Result<RepoMapping> {
270271

271272
/// Returns the .runfiles directory for the currently executing binary.
272273
pub fn find_runfiles_dir() -> Result<PathBuf> {
273-
// assert!(
274-
// std::env::var_os(MANIFEST_FILE_ENV_VAR).is_none(),
275-
// "Unexpected call when {} exists",
276-
// MANIFEST_FILE_ENV_VAR
277-
// );
274+
// Note that the MANIFEST_FILE_ENV_VAR may be set but also blank.
275+
assert!(
276+
match std::env::var_os(MANIFEST_FILE_ENV_VAR) {
277+
Some(it) if it.is_empty() => true,
278+
None => true,
279+
_ => false,
280+
},
281+
"Unexpected call when {} exists ({})",
282+
MANIFEST_FILE_ENV_VAR,
283+
std::env::var_os(MANIFEST_FILE_ENV_VAR)
284+
.unwrap()
285+
.to_str()
286+
.unwrap()
287+
);
278288

279289
// If Bazel told us about the runfiles dir, use that without looking further.
280290
if let Some(runfiles_dir) = std::env::var_os(RUNFILES_DIR_ENV_VAR).map(PathBuf::from) {

0 commit comments

Comments
 (0)