-
Notifications
You must be signed in to change notification settings - Fork 623
Add SCCACHE_BASEDIRS support
#2521
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
Open
Felixoid
wants to merge
21
commits into
mozilla:main
Choose a base branch
from
Felixoid:add-basedir-configuration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,323
−50
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
dc30acc
Add SCCACHE_BASEDIR support
Felixoid ace9c0e
Fix clippy, introduce multiple basedirs logic
Felixoid dc589c0
Make codecov happy
Felixoid 9eb3241
Apply fmt to all files
Felixoid d2e6edd
Clean out `basedir` intermediate step, use `basedirs`
Felixoid 903bcba
Cover Windows case for mixed slashes in paths
Felixoid 6f47f36
Add `Base directories` to `--show-stats` output
Felixoid cf0b871
Make `basedirs` match case insensitive on Windows
Felixoid 99dde65
Add trace logs to strip_basedirs, fix remainings
Felixoid 4a014de
Remove outdated test
Felixoid ada2650
Optimize strip_basedirs for big input
Felixoid 2f4fa22
Apply suggestions from code review
Felixoid b0a22ed
Move basedir validation to config building
Felixoid 9ccabc3
Add basedirs for remote cache implementations
Felixoid fb5d0fb
Address review point for directories separator
Felixoid bccc8f4
Simplify strip_basedirs a bit more
Felixoid e42a1f6
Final cleanup of the code for leftovers
Felixoid 96b8f95
Review: less reallocations
Felixoid 104221e
Apply suggestions from code review
Felixoid 81e67e8
Move normalization to the config building, use bytes for basedirs
Felixoid 7a966d4
Return unnormalized output, fix tests
Felixoid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,26 @@ | |||||||||
| # If specified, wait this long for the server to start up. | ||||||||||
| server_startup_timeout_ms = 10000 | ||||||||||
|
|
||||||||||
| # Base directories to strip from source paths during cache key | ||||||||||
| # computation. | ||||||||||
| # | ||||||||||
| # Similar to ccache's CCACHE_BASEDIR, but supports multiple paths. | ||||||||||
| # | ||||||||||
| # 'basedirs' enables cache hits across different absolute root | ||||||||||
| # paths when compiling the same source code, such as between | ||||||||||
| # parallel checkouts of the same project, Git worktrees, or different | ||||||||||
| # users in a shared environment. | ||||||||||
| # When multiple paths are provided, the longest matching prefix | ||||||||||
| # is applied. | ||||||||||
|
Comment on lines
+18
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| # | ||||||||||
| # Path matching is case-insensitive on Windows and case-sensitive on other OSes. | ||||||||||
| # | ||||||||||
| # Example: | ||||||||||
| # basedir = ["/home/user/project"] results in the path prefix rewrite: | ||||||||||
| # "/home/user/project/src/main.c" -> "./src/main.c" | ||||||||||
| basedirs = ["/home/user/project"] | ||||||||||
| # basedirs = ["/home/user/project", "/home/user/workspace"] | ||||||||||
|
|
||||||||||
| [dist] | ||||||||||
| # where to find the scheduler | ||||||||||
| scheduler_url = "http://1.2.3.4:10600" | ||||||||||
|
|
@@ -134,6 +154,7 @@ Note that some env variables may need sccache server restart to take effect. | |||||||||
|
|
||||||||||
| * `SCCACHE_ALLOW_CORE_DUMPS` to enable core dumps by the server | ||||||||||
| * `SCCACHE_CONF` configuration file path | ||||||||||
| * `SCCACHE_BASEDIRS` base directory (or directories) to strip from paths for cache key computation. This is similar to ccache's `CCACHE_BASEDIR` and enables cache hits across different absolute paths when compiling the same source code. Multiple directories can be separated by `;` on Windows hosts and by `:` on any other. When multiple directories are specified, the longest matching prefix is used. Path matching is **case-insensitive** on Windows and **case-sensitive** on other operating systems. Environment variable takes precedence over file configuration. Only absolute paths are supported; relative paths will cause an error and prevent the server from start. | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| * `SCCACHE_CACHED_CONF` | ||||||||||
| * `SCCACHE_IDLE_TIMEOUT` how long the local daemon process waits for more client requests before exiting, in seconds. Set to `0` to run sccache permanently | ||||||||||
| * `SCCACHE_STARTUP_NOTIFY` specify a path to a socket which will be used for server completion notification | ||||||||||
|
|
||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.