Skip to content

Commit

Permalink
Improve cache system
Browse files Browse the repository at this point in the history
Fix #3464

- Invalidate the cache if the target language changed
- Always delete the fable_modules folder if the cache is invalide
  • Loading branch information
Maxime Mangel committed Aug 16, 2023
1 parent 1a2ffae commit 8320fdb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Fable.Cli/ProjectCracker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ let getFullProjectOpts (opts: CrackerOptions) =

cacheInfo.Version = Literals.VERSION
&& cacheInfo.Exclude = opts.Exclude
&& cacheInfo.FableOptions.Language = opts.FableOptions.Language
&& (
[
cacheInfo.ProjectPath
Expand Down Expand Up @@ -789,6 +790,11 @@ let getFullProjectOpts (opts: CrackerOptions) =
| None ->
let projRefs, mainProj = retryGetCrackedProjects opts

// The cache was considered outdated / invalid so it is better to make
// make sure we have are in a clean state
if IO.Directory.Exists(opts.FableModulesDir) then
IO.Directory.Delete(opts.FableModulesDir, true)

let fableLibDir, pkgRefs =
match opts.FableOptions.Language with
| Python -> copyFableLibraryAndPackageSourcesPy opts mainProj.PackageReferences
Expand Down

0 comments on commit 8320fdb

Please sign in to comment.