question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Builtin "swift build" command invalidates cache for global command

See original GitHub issue

Whenever I save a file in an SPM project, swift build will automatically be run. After that has happened, running swift test from my terminal rebuilds all dependencies and the source.

This is not the case if I just run swift build and then swift test straight from my terminal.

I can also see the issue in reverse, that is, after I have run swift build or swift test from the terminal, the build time is much longer in VS Code.

This leads to the very annoying workflow that I save a test file, then wait for everything to be rebuilt from scratch in VS Code, then finally run swift test which again rebuilds everything from scratch, and then runs the tests.

Happy to provide any more information that might be relevant ☺️

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vknabelcommented, Jun 2, 2018

The workaround landed in 2.4.0.

1reaction
vknabelcommented, May 25, 2018

@LinusU I could not find a solution on this by now. As a workaround we could add a new setting to allow passing a custom build path if this issue becomes too big.

This would additionally help others who want to automatically build their tests like https://github.com/jinmingjian/sde/pull/32, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

swift package purge-cache - Marco Eidinger
Learn about the global repository cache in Swift Package Manager, why it exists and when to clear it with the purge-cache subcommand.
Read more >
Caching SwiftPM for iOS app build on CI env - Swift Forums
Disable caching for SPM build​​ Regarding the discussion in #160 I think the module cache was barfing because… Disabling it for now.
Read more >
Where is Swift Package Manager cache located (Xcode 12.5)?
Is the location outside of DerivedData folder so cache still persists somewhere in ~/Library/Caches and can be reused even for clean build?
Read more >
Xcode Build Settings
A convenient reference of available build settings for Xcode projects.
Read more >
Invalidate caches | IntelliJ IDEA Documentation - JetBrains
When you invalidate the cache, IntelliJ IDEA removes the cache files for all projects ever run in the current version of the IDE....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found