-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runfiles: support space in file paths #9351
Conversation
Support space in paths of data-dependencies. The runfiles manifest remains the same for files without space in their runfiles-relative path. For files with space in their runfiles-relative path: the delimiter between runfile path and link target is now '|' instead of space. Tools and rules that consume runfiles manifests should test for a '|' delimiter, and if missing, fall back to space. This design ensures that manifest consumers keep working without having to handle '|', as long as all data-dependencies are space-free. Otherwise they break, but they would break today anyway. Fixes bazelbuild#4327 Change-Id: I37ce3b3ef2a9e92691e987588b0e6d67969a78c5
Change-Id: I1072b65ee546d37dfe969c73c76980e43234a3fe
Change-Id: I611454ea7d6001b97d6f3417b7331c978070fc3f
Change-Id: I636118c40f2c1ef6e2792e1d0ceb07aff9e30880
Sorry, had to move the test to another directory and now it fails on Windows. Will ping the thread again when it's ready for review. |
Ready again :) |
Is this waiting on a review from @michajlo? |
No, it's waiting input from me. Let's close it for now, I see PRs are getting cleaned up and I don't want to hinder that. |
(As in: there were some concerns about it by reviewers, and I haven't decided whether the PR carries its weight.) |
@laszlocsomor, do you have any insight about the status of this fix? I am still facing #4327 because I need to run some Chromium-related tools on OSX, which have paths that contain spaces. Will this ever land? Is there another fix coming? |
The problem is that the file is now a public interface, which means changing the format is a breaking change. It's going to be very difficult to roll anything like this out. |
@marmos91 : I don't have any insight. But with The runfiles manifest is still broken (still uses space to separate link name and link target), so data-deps require using symlinks. Luckily, on macOS that is enabled by default. Demo:
|
The runfiles manifest remains the same for files
without space in their runfiles-relative path.
For files with space in their runfiles-relative
path, the link path's spaces are replaced by the
ASCII 0x01 character (U+0001). This character is
very unlikely to appear in paths (so it's a safe
bet as an escape character) and it has a
single-byte UTF-8 encoding, so when looking up
paths from the runfiles manifest (which itself is
UTF-8 encoded) tools like 'sed' can easily
transform '\x01' to space and back.
Thus the first space on a line is always the
delimiter, but runfiles libraries must replace the
requested path's spaces with '\x01' upon every
manifest-based lookup.
This design ensures that manifest consumers keep
working without having to handle '\x01', as long
as all data-dependencies are space-free. Otherwise
they break, but they would break today anyway.
RELNOTES[NEW]: Runfiles: data-dependencies (runfiles) may now contain spaces.
Fixes #4327
Change-Id: I37ce3b3ef2a9e92691e987588b0e6d67969a78c5