Skip to content
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

[rush] Add support for specifying a system-wide build cache location. #2405

Merged
merged 4 commits into from
Dec 29, 2020

Conversation

iclanton
Copy link
Member

This is one of the TODO items listed in #2393 (comment)

This change introduces an ~/.rushrc.json file that allows a "buildCacheFolder" to be specified. If this is provided, the cache is stored in this location instead of in each repo's /common/temp/build-cache folder.

@octogonz
Copy link
Collaborator

octogonz commented Dec 25, 2020

This change introduces an ~/.rushrc.json file that allows

Ideally this file should be called ~/.rush/rush-user.json so that we have a nice folder where we can later add other files as needed. Similar to how ~/.vscode has multiple files for VS Code.

However I think we made a mistake by designing ~/.rush to be a temporary folder that gets deleted by rush purge --unsafe. We could rename it to ~/.rush-temp (or ideally ~/.rush/temp) that would carry a small risk that an old release of Rush might delete the ~/.rush folder.

🤔 @iclanton What if we call the file ~/.rush-user/settings.json? (Maybe we should also deprecate ~/.rush and rename it to ~/.rush-temp?)

@iclanton iclanton force-pushed the ianc/user-config-file branch from 7370116 to 9d6af55 Compare December 25, 2020 06:50
@iclanton iclanton merged commit 4d89c3d into microsoft:master Dec 29, 2020
@iclanton iclanton deleted the ianc/user-config-file branch December 29, 2020 01:39
@D4N14L
Copy link
Member

D4N14L commented Dec 29, 2020

I'm wondering, could this new user config file/location also be used for package manager specific args? I had mused on this over in issue #1994 @iclanton ?

@iclanton
Copy link
Member Author

It seems like a logical place. Would you imagine a structured config file for specifying options that are normally in a .npmrc file?

@D4N14L
Copy link
Member

D4N14L commented Dec 29, 2020

@iclanton similar? PNPM uses .npmrc but Yarn does not. Also, I believe PNPM should respect user-specific .npmrc files (https://pnpm.js.org/en/npmrc). It would be more of a place to provide a common interface with the options to pass into the package manager the Rush project is using.

Though, that would likely fragment over time with the different capabilities of different package managers. So maybe a structured config file where you can provide a list of arbitrary CLI args to append to the package manager call? Then we're getting into territory where the user could easily mess up their installs. I believe this is how we came to the idea of an "allow list" in the original issue, to avoid broken installs. However, the list would need to be kept up to date with package manager tweaks to newer versions over time, which isn't great. Maybe we do the allow list and allow arbitrary args if the user sets some allowArbitraryArguments value to true. Hmm...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants