fs: allow backslashes in paths via buckconfig - #1364
Open
daandemeyer wants to merge 1 commit into
Open
Conversation
daandemeyer
force-pushed
the
push-koqlxrtkktnt
branch
from
July 7, 2026 18:16
d178412 to
b7eaff6
Compare
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D110922815. (Because this pull request was imported automatically, there will not be any future comments.) |
daandemeyer
force-pushed
the
push-koqlxrtkktnt
branch
2 times, most recently
from
July 18, 2026 20:17
fa09fef to
0c5873d
Compare
Collaborator
|
I feel vaguely like this should be a buckconfig setting instead; the ergonomics of passing in an env-var are not ideal. |
daandemeyer
force-pushed
the
push-koqlxrtkktnt
branch
3 times, most recently
from
July 21, 2026 19:17
36facc0 to
444995a
Compare
Contributor
Author
|
@lf- Reworked to a buck config option |
daandemeyer
force-pushed
the
push-koqlxrtkktnt
branch
4 times, most recently
from
July 24, 2026 10:43
b38d229 to
d1388ab
Compare
daandemeyer
force-pushed
the
push-koqlxrtkktnt
branch
from
July 24, 2026 16:07
d1388ab to
8f0db23
Compare
File names and relative paths reject backslashes on every platform. On Windows a backslash is a path separator, but on other platforms it is a valid path character that occurs in practice. Building OS images, for example, can produce systemd-escaped names such as `system-systemd\x2dfoo.slice`, which Buck2 currently rejects. Keep rejecting backslashes by default, but add `[buck2] allow_backslashes_in_paths = true` to permit them on platforms where they are not path separators. Treat the setting as daemon startup configuration so changing it restarts buckd and one daemon cannot mix path invariants. Windows continues to reject literal backslashes. Initialize the low-level path policy from the startup configuration in both the client and daemon. Same-value initialization is idempotent for `--no-buckd`, while conflicting values are rejected. This also preserves the original concrete error type of `from_system_path`, since validation no longer performs a fallible environment lookup. Cover policy initialization, platform behavior, and all affected path validators in buck2_fs tests. Cover buckconfig parsing in buck2_common, and document the opt-in in the buckconfig reference. Signed-off-by: Daan De Meyer <daan@amutable.com>
daandemeyer
force-pushed
the
push-koqlxrtkktnt
branch
from
July 29, 2026 18:23
8f0db23 to
cb3ce77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
File names and relative paths reject backslashes on every platform. On
Windows a backslash is a path separator, but on other platforms it is a
valid path character that occurs in practice. Building OS images, for
example, can produce systemd-escaped names such as
system-systemd\x2dfoo.slice, which Buck2 currently rejects.Keep rejecting backslashes by default, but add
[buck2] allow_backslashes_in_paths = trueto permit them on platformswhere they are not path separators. Treat the setting as daemon startup
configuration so changing it restarts buckd and one daemon cannot mix
path invariants. Windows continues to reject literal backslashes.
Initialize the low-level path policy from the startup configuration in
both the client and daemon. Same-value initialization is idempotent for
--no-buckd, while conflicting values are rejected. This also preservesthe original concrete error type of
from_system_path, since validationno longer performs a fallible environment lookup.
Cover policy initialization, platform behavior, and all affected path
validators in buck2_fs tests. Cover buckconfig parsing in buck2_common,
and document the opt-in in the buckconfig reference.
Signed-off-by: Daan De Meyer daan@amutable.com