Rebuild times in new shell significantly slower

Wow, thank you so much for your answer! I was starting to go a little nuts, deep in the bash man pages.

I'm sure this won't surprise you, but I can replicate / verify that by:

  • starting a new shell;
  • forcing the env vars to be EXACTLY what they were in the old shell;
  • rebuilding from there.

I think this may give me a viable workaround for my VSCode / WSL scenario, by figuring out what env vars are changing between build runs and forcing them to be the same before running swift build --build-tests.

Filtering the variables with an allow or disallow list seems like it might help a lot. In my test case from command line, it was SHLVL and PATH that were changing, but those seem unlikley to be the ones affecting the situation in VSCode / WSL.

Will report back when I know which ones specifically are causing the issue in that context.

Let me know if there's anything else I can do to help!

2 Likes