remote-apis icon indicating copy to clipboard operation
remote-apis copied to clipboard

Directory canonicalization does not require non-empty names

Open stuhood opened this issue 5 years ago • 2 comments

Hey folks! The definition of "canonical" for a Directory does not currently (https://github.com/bazelbuild/remote-apis/blob/f54876595da9f2c2d66c98c318d00b60fd64900b/build/bazel/remote/execution/v2/remote_execution.proto#L634-L653) require that the names of children are non-empty, but in practice this seems like a useful constraint.

As an example, the violation of one constraint on inputs lead to a server implementation returning a non-sensical output with an empty directory name (roughly: components like ["out", "", "etc", "file.txt"]). Including "non-empty" in the definition of canonical would have caught this earlier: immediately after the server's response.

Thoughts?

stuhood avatar Sep 23 '20 23:09 stuhood

FYI: These are the restrictions that Buildbarn applies: https://github.com/buildbarn/bb-storage/blob/d02061266d4c2f1bb7ecb52efad56e0a7f28c397/pkg/filesystem/path/component.go#L17

EdSchouten avatar Feb 07 '21 12:02 EdSchouten

It does say "Every child in the directory must have a path of exactly one segment", and you could argue that "" is zero segments rather than one. But either way, I'm fine with it being made more explicit that the empty string is not valid.

On Sun, Feb 7, 2021 at 7:43 AM Ed Schouten [email protected] wrote:

FYI: These are the restrictions that Buildbarn applies: https://github.com/buildbarn/bb-storage/blob/d02061266d4c2f1bb7ecb52efad56e0a7f28c397/pkg/filesystem/path/component.go#L17

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bazelbuild/remote-apis/issues/175#issuecomment-774668273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABREW23F3VPUBXYO67ZUXDS52DGNANCNFSM4RXUC67Q .

EricBurnett avatar Feb 08 '21 15:02 EricBurnett