mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
52076f801f
Summary: A user ran into an issue where some buck/build related automation had added a redirection named `../../../Users/username/reponame/.lsp-buck-out`. The valid name for this is `.lsp-buck-out` because redirections must always be repo-root-relative. This commit adds missing validation for this, and makes it slightly more convenient for consuming tools to work with by allowing an absolute path to the redirection to be specified. Why not simply resolve the path from the cwd and use that? The command has always been defined in terms of repo-root-relative paths, and there are a number of cases where CI and other build tools can start in unexpected subdirectories and that means that paths like `../buck-out` can have an ambiguous or surprising resolution. There are tools that follow the documentation and correctly specify repo-root-relative paths that would either be broken outright or left with newly ambiguous behavior if we suddenly started to accept and resolve relative paths for ourselves. I'm not opposed to changing the behavior in that way in the future, but it requires a bit more of a coordinated effort than I have time to wrangle right now, so this diff is aimed at surfacing breakage rather than magically resolving it. This commit fixes up the behavior so that paths like `../foo` are explicitly checked for and generate an error, but absolute paths like `/Users/username/reponame/foo` (which are unambiguous) are now resolved to the appropriate repo-root-relative path automatically. That makes it a bit easier for consuming tools to swing through a behavior change; they can now simply pass the absolute path rather than messing around with trying relativize the paths to the repo root. Reviewed By: kmancini Differential Revision: D25261490 fbshipit-source-id: 1706b54fc15c2dad334cdf6c75cca5e6e44ed97a |
||
---|---|---|
.. | ||
fs | ||
integration | ||
locale | ||
mononoke | ||
scm | ||
test_support | ||
test-data | ||
.gitignore | ||
Eden.project.toml |