Commit 06f194b8 authored by Valentin Reis's avatar Valentin Reis
Browse files

no linking, copy rather.

parent a0d45b5e
Pipeline #5867 passed with stage
in 20 seconds
...@@ -329,7 +329,7 @@ readProcessVerbose verbosity name arguments envVars = do ...@@ -329,7 +329,7 @@ readProcessVerbose verbosity name arguments envVars = do
Just r -> return r Just r -> return r
Nothing -> die "readProcess returned more than one line." Nothing -> die "readProcess returned more than one line."
setupSystem :: Text -> ArgsCommon -> IO [(Text, Text)] setupSystem :: Text -> ArgsCommon -> IO ([(Text, Text)],Text)
setupSystem target sa = do setupSystem target sa = do
sVerbose "sudo rm -rf result" >>= \case sVerbose "sudo rm -rf result" >>= \case
...@@ -348,7 +348,6 @@ setupSystem target sa = do ...@@ -348,7 +348,6 @@ setupSystem target sa = do
["-d", "/tmp/tmpdir-XXXX"] ["-d", "/tmp/tmpdir-XXXX"]
[] []
sVerbose $ "chmod 777 " <> varTMPDIR sVerbose $ "chmod 777 " <> varTMPDIR
sVerbose $ "ln -s " <> varTMPDIR <> " " <> "./nixtmpdir"
passVars <- getVars ["PATH", "NIX_PATH", "NIX_SSL_CERT_FILE"] passVars <- getVars ["PATH", "NIX_PATH", "NIX_SSL_CERT_FILE"]
...@@ -358,7 +357,7 @@ setupSystem target sa = do ...@@ -358,7 +357,7 @@ setupSystem target sa = do
when (isTarget target) $ setupNodeOs envVars when (isTarget target) $ setupNodeOs envVars
return envVars return (envVars,varXDG_CACHE_HOME)
where where
getVars :: [Text] -> IO [(Text, Text)] getVars :: [Text] -> IO [(Text, Text)]
getVars vars = catMaybes <$> mapM maybeGet vars getVars vars = catMaybes <$> mapM maybeGet vars
...@@ -409,7 +408,7 @@ nixArguments target ArgsCommon {..} = ...@@ -409,7 +408,7 @@ nixArguments target ArgsCommon {..} =
wrap :: NixCommand -> Text -> ArgsCommon -> IO () wrap :: NixCommand -> Text -> ArgsCommon -> IO ()
wrap nixCommand target sa@ArgsCommon {..} = do wrap nixCommand target sa@ArgsCommon {..} = do
when (verbosity == Verbose) $ print sa when (verbosity == Verbose) $ print sa
envVars <- setupSystem target sa (envVars,tmpXDGHOME) <- setupSystem target sa
putText $ nixc <> " " <> T.unwords arglist putText $ nixc <> " " <> T.unwords arglist
case nixCommand of case nixCommand of
NixShell -> executeFile (toS nixc) True (fmap toS arglist) Nothing NixShell -> executeFile (toS nixc) True (fmap toS arglist) Nothing
...@@ -419,6 +418,7 @@ wrap nixCommand target sa@ArgsCommon {..} = do ...@@ -419,6 +418,7 @@ wrap nixCommand target sa@ArgsCommon {..} = do
(P.proc (toS nixc) $ fmap toS arglist) (P.proc (toS nixc) $ fmap toS arglist)
) )
<> P.runProcess_ (P.proc "cp" ["-r", "/tmp/papa", "./result"]) <> P.runProcess_ (P.proc "cp" ["-r", "/tmp/papa", "./result"])
<> P.runProcess_ (P.proc "cp" ["-r", toS tmpXDGHOME, "./nixtmpdir"])
where where
nixc = toCommand nixCommand nixc = toCommand nixCommand
arglist = arglist =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment