@@ -84,9 +84,6 @@ profile
84 => FilePath
84 => FilePath
86profile profileBaseName = withProjectRoot "." $ \root -> do
86profile profileBaseName = withProjectRoot "." $ \root -> do
87− freePort <- getFreePort
88− assets <- findProjectAssets root
89− putLog Debug $ "Assets impurely loaded from: " <> assets
90 putLog Debug "Using profiled build of project."
87 putLog Debug "Using profiled build of project."
91 liftIO $ createDirectoryIfMissing False $ takeDirectory profileBaseName
88 liftIO $ createDirectoryIfMissing False $ takeDirectory profileBaseName
92 let -- Sane flags to enable by default, enable time profiling +
89 let -- Sane flags to enable by default, enable time profiling +
@@ -113,6 +110,9 @@ profile profileBaseName = withProjectRoot "." $ \root -> do
113 { _target_path = Nothing
110 { _target_path = Nothing
114 , _target_attr = Nothing
111 , _target_attr = Nothing
115 , _target_expr = Just nixBuildExpr }
112 , _target_expr = Just nixBuildExpr }
113+ assets <- findProjectAssets root
114+ putLog Debug $ "Assets impurely loaded from: " <> assets
115+ freePort <- getFreePort
116 (_, _, _, ph) <- createProcess_ "runProfExe" $ setCwd (Just root) $ setDelegateCtlc True $ proc exePath ([show freePort, T.unpack assets] <> rtsFlags)
116 (_, _, _, ph) <- createProcess_ "runProfExe" $ setCwd (Just root) $ setDelegateCtlc True $ proc exePath ([show freePort, T.unpack assets] <> rtsFlags)
117 _ <- liftIO $ waitForProcess ph
117 _ <- liftIO $ waitForProcess ph
@@ -122,18 +122,17 @@ run
123run = withProjectRoot "." $ \root -> do
123run = withProjectRoot "." $ \root -> do
124 pkgs <- fmap toList . parsePackagesOrFail =<< getLocalPkgs root
124 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
131− , "(Obelisk.Run.runServeAsset " ++ show assets ++ ")"
133− , "Frontend.frontend"
135 withGhciScript pkgs root $ \dotGhciPath -> do
125 withGhciScript pkgs root $ \dotGhciPath -> do
126+ freePort <- getFreePort
127+ assets <- findProjectAssets root
128+ putLog Debug $ "Assets impurely loaded from: " <> assets
136− runGhcid root True dotGhciPath pkgs $ Just obRunExpr
129+ runGhcid root True dotGhciPath pkgs $ Just $ unwords
132+ , "(Obelisk.Run.runServeAsset " ++ show assets ++ ")"
134+ , "Frontend.frontend"
138runRepl :: MonadObelisk m => m ()
137runRepl :: MonadObelisk m => m ()
139runRepl = withProjectRoot "." $ \root -> do
138runRepl = withProjectRoot "." $ \root -> do