bitter-ability-32190
09/20/2023, 6:06 PMbitter-ability-32190
09/20/2023, 6:08 PMThe local storage only supports a single sccache server at a time. Multiple concurrent servers will race and cause spurious build failures.So we'd need to do something similar to what we do for mypy. So I think the only missing piece is how a
shell_command gets its hands on a named cache.
I'm thinking we maybe do it in a hidden field or plugin, since there's implciations of opening this up I don't want to have to explore yet.witty-crayon-22786
09/20/2023, 6:10 PMsccache is for incremental compilation: only for per-crate compilationwitty-crayon-22786
09/20/2023, 6:11 PMbitter-ability-32190
09/20/2023, 6:11 PMwitty-crayon-22786
09/20/2023, 6:11 PMbitter-ability-32190
09/20/2023, 6:12 PMsccache? Or that unlocking this "incremental" compilation would be better than using sccache?witty-crayon-22786
09/20/2023, 6:12 PMengine crate in MODE=debug for the first time, it takes ~2 mins on my machine: the second time it takes about 6 secondswitty-crayon-22786
09/20/2023, 6:13 PMsccache at the per-crate level: it just doesnāt cache incremental compilation for single crates.bitter-ability-32190
09/20/2023, 6:15 PMsccache for better 3rdparty and incremental for our own code?witty-crayon-22786
09/20/2023, 6:15 PMwitty-crayon-22786
09/20/2023, 6:15 PMtarget directory⦠at which point sccache might no longer be necessary.bitter-ability-32190
09/20/2023, 6:17 PMwitty-crayon-22786
09/20/2023, 6:21 PMwitty-crayon-22786
09/20/2023, 6:22 PMmypy cache, itās possible that you could have the named cache exist at a path that was dependent on the project being builtbitter-ability-32190
09/20/2023, 6:26 PMwitty-crayon-22786
09/20/2023, 6:26 PMbitter-ability-32190
09/20/2023, 6:26 PMbitter-ability-32190
09/20/2023, 6:30 PMwitty-crayon-22786
09/20/2023, 6:30 PMbitter-ability-32190
09/20/2023, 6:32 PMbitter-ability-32190
09/20/2023, 6:32 PMshell_command šwitty-crayon-22786
09/20/2023, 6:33 PMwitty-crayon-22786
09/20/2023, 6:34 PMbitter-ability-32190
09/20/2023, 6:34 PMbitter-ability-32190
09/20/2023, 6:34 PMI'm thinking we maybe do it in a hidden field or plugin, since there's implciations of opening this up I don't want to have to explore yet.
broad-processor-92400
09/20/2023, 7:37 PM./cargo ⦠working outside the sandbox so we can keep the incrementality when building/testing rust directly)broad-processor-92400
09/20/2023, 7:41 PMexperimental in the name, somehow, and itās up to users to use it right (but we keep it experimental to reserve the right to make it easier to use correctly).
Potentially just takes a string with a couple of basic substitutions, eg experimental_cache_dir="{buildroot_id}/rust-sccache" would end up as a per-buildroot dir.witty-crayon-22786
09/20/2023, 7:51 PMnamed_caches a bit more... that same concern applies to ~everything in there.witty-crayon-22786
09/20/2023, 7:51 PMpants gc goalgorgeous-winter-99296
09/20/2023, 7:52 PMThere's also this, which I don't grok: https://docs.rs/cargo-hakari/latest/cargo_hakari/about/index.htmlIt generates a crate which gathers all things that have features, and then makes everyone depend on that. So just fixes the issue of different feature-flags on different
-p crate invocations leading to unnecessary compilation times.
Also, does this mean that proper rust support is in the works too? :obitter-ability-32190
09/20/2023, 7:52 PMgorgeous-winter-99296
09/20/2023, 7:53 PMPants-compiles-its-engine mean then? š Just a more narrow support for that specific use-case?bitter-ability-32190
09/20/2023, 7:54 PMgorgeous-winter-99296
09/20/2023, 7:55 PMbitter-ability-32190
09/21/2023, 1:47 AMcargo invokes sccache, but we maybe looking at a red herring:
The sccache command will spawn a server process if one is not already running,
bitter-ability-32190
09/21/2023, 1:49 AMIncrementally compiled crates cannot be cached. By default, in the debug profile Cargo will use incremental compilation for workspace members and path dependencies. You can disable incremental compilation.So... here' what I'm thinking
bitter-ability-32190
09/21/2023, 1:51 AMMODE=debug. It's all local tools, incremental, and completely out of Pants
⦠We still use the Pants sandbox fingerprint for the metadata though. We can make sure the MODE makes it in that fingerprint
⢠Otherwise, it's all Pants (leveraging sccache)
⦠This benefits CI, and people who aren't banging on the engine (because they're likely setting MODE anyways)bitter-ability-32190
09/21/2023, 3:07 PMsccache is caching the path to the cc compiler, which in this case would be the binary shim in the sandbox for the previous run.
Fun stuffbitter-ability-32190
09/21/2023, 3:33 PMcargo as well šµ