@@ -84,9 +84,6 @@ profile
8484 => FilePath
8585 -> m ()
8686profile profileBaseName = withProjectRoot "." $ \root -> do
87− freePort <- getFreePort
88− assets <- findProjectAssets root
89− putLog Debug $ "Assets impurely loaded from: " <> assets
9087 putLog Debug "Using profiled build of project."
9188 liftIO $ createDirectoryIfMissing False $ takeDirectory profileBaseName
9289 let -- Sane flags to enable by default, enable time profiling +
@@ -113,6 +110,9 @@ profile profileBaseName = withProjectRoot "." $ \root -> do
113110 { _target_path = Nothing
114111 , _target_attr = Nothing
115112 , _target_expr = Just nixBuildExpr }
113+ assets <- findProjectAssets root
114+ putLog Debug $ "Assets impurely loaded from: " <> assets
115+ freePort <- getFreePort
116116 (_, _, _, ph) <- createProcess_ "runProfExe" $ setCwd (Just root) $ setDelegateCtlc True $ proc exePath ([show freePort, T.unpack assets] <> rtsFlags)
117117 _ <- liftIO $ waitForProcess ph
118118 pure ()
@@ -122,18 +122,17 @@ run
122122 => m ()
123123run = withProjectRoot "." $ \root -> do
124124 pkgs <- fmap toList . parsePackagesOrFail =<< getLocalPkgs root
125− freePort <- getFreePort
126− assets <- findProjectAssets root
127− putLog Debug $ "Assets impurely loaded from: " <> assets
128− let obRunExpr = unwords
129− [ "Obelisk.Run.run"
130− , show freePort
131− , "(Obelisk.Run.runServeAsset " ++ show assets ++ ")"
132− , "Backend.backend"
133− , "Frontend.frontend"
134− ]
135125 withGhciScript pkgs root $ \dotGhciPath -> do
136− runGhcid root True dotGhciPath pkgs $ Just obRunExpr
126+ freePort <- getFreePort
127+ assets <- findProjectAssets root
128+ putLog Debug $ "Assets impurely loaded from: " <> assets
129+ runGhcid root True dotGhciPath pkgs $ Just $ unwords
130+ [ "Obelisk.Run.run"
131+ , show freePort
132+ , "(Obelisk.Run.runServeAsset " ++ show assets ++ ")"
133+ , "Backend.backend"
134+ , "Frontend.frontend"
135+ ]
137136
138137runRepl :: MonadObelisk m => m ()
139138runRepl = withProjectRoot "." $ \root -> do