Skip to content

Commit

Permalink
Clean Cabal cache before calling it
Browse files Browse the repository at this point in the history
Cabal/GHC doesn't know about files produced by cargo, and will therefore
fail to invalidate caches. While there are ways to tell Cabal/GHC to
depend on these files, they are known to be broken in our tool versions.

See: haskell/cabal#4746

Note that we don't use `cabal clean`, as it will also remove any sources
it downloaded (specified in `cabal.project`).
  • Loading branch information
martijnbastiaan committed Aug 18, 2023
1 parent 743f018 commit f95b87e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bittide-shake/bin/Shake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@ main = do
-- build bittide-instance because we have instances that includes a binaries.
command_ [Cwd "firmware-binaries"] "cargo" ["build", "--release"]

-- XXX: Cabal/GHC doesn't know about files produced by cargo, and
-- will therefore fail to invalidate caches. While there are
-- ways to tell Cabal/GHC to depend on these files, they are
-- known to be broken in our tool versions.
--
-- See: https://github.com/haskell/cabal/issues/4746
command_ [] "rm" ["-rf", "dist-newstyle/build"]

-- Generate RTL
let
(buildTool, buildToolArgs) =
defaultClashCmd clashBuildDir targetName
Expand Down

0 comments on commit f95b87e

Please sign in to comment.