pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/bazelbuild/bazel/pull/28921

sets/global-a469e846088cc1bf.css" /> Fix --workspace_status_command empty value handling by wade-arista · Pull Request #28921 · bazelbuild/bazel · GitHub
Skip to content

Fix --workspace_status_command empty value handling#28921

Open
wade-arista wants to merge 1 commit intobazelbuild:masterfrom
wade-arista:master
Open

Fix --workspace_status_command empty value handling#28921
wade-arista wants to merge 1 commit intobazelbuild:masterfrom
wade-arista:master

Conversation

@wade-arista
Copy link
Contributor

@wade-arista wade-arista commented Mar 6, 2026

Description

parseWorkspaceStatus() was silently discarding lines without a space due to input.trim() mangling trailing-space-at-EOF combined with the key-only check skipping them. parseValues() had the same key-only discard behavior.

Both now store an empty string for keys with no value, and skip genuinely empty lines. Unit tests added for both parsers covering key-only, trailing-space, and EOF edge cases.

Motivation

Specific cases of interest:

  1. Key only with no trailing space:

    echo "KEY_ONLY"
    echo "KEY_WITH_VALUE value"

  2. Key only entry at EOF (trailing space optional):

    echo "KEY_WITH_VALUE value"
    echo "KEY_ONLY "

Fixes #16037

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: None

parseWorkspaceStatus() was silently discarding lines without a space
due to input.trim() mangling trailing-space-at-EOF combined with the
key-only check skipping them. parseValues() had the same key-only
discard behavior.

Both now store an empty string for keys with no value, and skip
genuinely empty lines. Unit tests added for both parsers covering
key-only, trailing-space, and EOF edge cases.

Specific cases of interest:

1. Key only with no trailing space:

    echo "KEY_ONLY"
    echo "KEY_WITH_VALUE value"

2. Key only entry at EOF (trailing space optional):

    echo "KEY_WITH_VALUE value"
    echo "KEY_ONLY "

Fixes bazelbuild#16037
@wade-arista wade-arista requested a review from a team as a code owner March 6, 2026 23:49
@wade-arista wade-arista requested review from dabanki and removed request for a team March 6, 2026 23:49
@github-actions github-actions bot added team-Configurability platforms, toolchains, cquery, select(), config transitions awaiting-review PR is awaiting review from an assigned reviewer labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--workspace_status_command: handling of empty values is surprising and inconsistent

1 participant

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy