[rush] Build cache does not support symbolic links with relative paths
Summary
When the output folder contains a symbolic link, Rush throws an error.
Details
I think this is a good default behavior in most cases, since it helps prevent people from making mistakes.
However, in some cases the symbolic link is a relative path that points to another file within the same repo. Would it make sense to make the symbolic-link check (code linked below) more precise, so that it ignores cases where the relative target resolves to a path inside the repo?
https://github.com/microsoft/rushstack/blob/98d7c1af0768507c1e49c5224dc97f34305ac8ce/libraries/rush-lib/src/logic/buildCache/OperationBuildCache.ts#L349
Standard questions
Please answer these questions to help us investigate your issue more quickly:
| Question | Answer |
|---|---|
@microsoft/rush globally installed version? |
- |
rushVersion from rush.json? |
- |
useWorkspaces from rush.json? |
No |
| Operating system? | All |
| Would you consider contributing a PR? | Yes |
Node.js version (node -v)? |
- |
We categorically don't support putting symbolic links in the build cache because the vast majority of security issues related to unpacking of archives are related to symbolic link handling. It's a difficult thing to get right and we'd need an extremely convincing reason to support them.
Closing for now, as this behavior is intentional.