on master help sign in
Don't create ob profile out directories until everything has built
commitcf06275161147444326fece071cceb43929cb68c authorElliot Cameron <eacameron@gmail.com> dateMon 24 Feb 2020, 14:08 (7 years ago) parent6b15a33
1 file changed+4−7
lib/command/src/Obelisk/Command/Run.hs+4−7
lib/command/src/Obelisk/Command/Run.hs+4−7
@@ -96,13 +96,6 @@ profile
9696profile profileBasePattern rtsFlags = withProjectRoot "." $ \root -> do
9797 putLog Debug "Using profiled build of project."
9898
99− time <- liftIO getCurrentTime
100− let profileBaseName = formatTime defaultTimeLocale profileBasePattern time
101−
102− putLog Debug $ T.pack $ "Storing profiled data under base name of " <> profileBaseName
103−
104− liftIO $ createDirectoryIfMissing True $ takeDirectory $ root </> profileBaseName
105−
10699 outPath <- withSpinner "Building profiled executable" $
107100 fmap (T.unpack . T.strip) $ readProcessAndLogStderr Debug $ setCwd (Just root) $ nixCmdProc $
108101 NixCmd_Build $ def
@@ -114,6 +107,10 @@ profile profileBasePattern rtsFlags = withProjectRoot "." $ \root -> do
114107 }
115108 assets <- findProjectAssets root
116109 putLog Debug $ "Assets impurely loaded from: " <> assets
110+ time <- liftIO getCurrentTime
111+ let profileBaseName = formatTime defaultTimeLocale profileBasePattern time
112+ liftIO $ createDirectoryIfMissing True $ takeDirectory $ root </> profileBaseName
113+ putLog Debug $ "Storing profiled data under base name of " <> T.pack (root </> profileBaseName)
117114 freePort <- getFreePort
118115 (_, _, _, ph) <- createProcess_ "runProfExe" $ setCwd (Just root) $ setDelegateCtlc True $ proc (outPath </> "bin" </> "ob-run") $
119116 [ show freePort