diff --git a/bittide-shake/bin/Shake.hs b/bittide-shake/bin/Shake.hs index a0fdd10d3..8d57b1c80 100644 --- a/bittide-shake/bin/Shake.hs +++ b/bittide-shake/bin/Shake.hs @@ -23,7 +23,6 @@ import System.Process (readProcess, callProcess) import Paths_bittide_shake -import Clash.Shake.Cargo import Clash.Shake.Extra import Clash.Shake.Flags import Clash.Shake.Vivado @@ -334,7 +333,8 @@ main = do -- We build all rust binaries in "firmware-binaries". They are required to -- build bittide-instance because we have instances that includes a binaries. - liftIO $ cargoBuildFirmwareProgram "firmware-binaries" Release + command_ [Cwd "firmware-binaries"] "cargo" ["build", "--release"] + let (buildTool, buildToolArgs) = defaultClashCmd clashBuildDir targetName diff --git a/bittide-shake/src/Clash/Shake/Cargo.hs b/bittide-shake/src/Clash/Shake/Cargo.hs deleted file mode 100644 index 082176c5b..000000000 --- a/bittide-shake/src/Clash/Shake/Cargo.hs +++ /dev/null @@ -1,47 +0,0 @@ --- SPDX-FileCopyrightText: 2023 Google LLC --- --- SPDX-License-Identifier: Apache-2.0 -module Clash.Shake.Cargo where - -import Prelude - -import System.Exit -import System.IO -import System.Process - -import qualified Clash.Util.Interpolate as I - -data CargoBuildMode = Release | Debug - deriving Eq - -cargoBuildFirmwareProgram :: - FilePath -> - -- ^ Directory to perform the call in - CargoBuildMode -> - -- ^ release mode? - IO () -cargoBuildFirmwareProgram workingDir release = do - let - cmd = "cargo" - args = "build" : ["--release" | release == Release] - createProc = - (proc cmd args) - { cwd = Just workingDir} - (exitCode, _stdoutOut, stderrOut) <- readCreateProcessWithExitCode createProc "" - - case exitCode of - ExitSuccess -> do - pure () - ExitFailure exitInt -> do - hPutStrLn stderr [I.i| - "#{cmd} #{unwords args}" terminated with exit code #{exitInt}. - - Stderr: - - #{stderrOut} - - Stdout: - - #{_stdoutOut} - |] - exitWith exitCode