Hi Stackagers, I see a few bugs in latest json-autotype
that appear in Stack builds only:
/tmp
accessible then?Heisenbug when executing stack runghc
on CI:
Test suite failure for package json-autotype-3.0.0
json-autotype-examples: exited with: ExitFailure 1
Full log available at /builds/migamake/json-autotype/.stack-work/logs/json-autotype-3.0.0-test.log
stack: WARNING! Expecting stack options comment at line 1, column 1
stack: WARNING! Missing or unusable stack options specification
stack: WARNING! Using runghc without any additional stack options
Invalid argument `run'
Error executing interpreter command: stack run -- runghc -- examples/json-schema/fstab.json --outputFilename output/Fstab.hs
https://gitlab.com/migamake/json-autotype/-/jobs/126570099
Here is the code that implements nested call to Stack:
runHaskellModule :: [String] -> IO ExitCode
runHaskellModule arguments = do
maybeStack <- System.Environment.lookupEnv "STACK_EXEC"
maybeCabal <- System.Environment.lookupEnv "CABAL_SANDBOX_CONFIG"
let execPrefix | Just stackExec <- maybeStack = [stackExec, "runghc"]
| Just _ <- maybeCabal = ["cabal", "exec", "runghc"]
| otherwise = ["runghc"]
putStrLn $ "Running Haskell module: " ++ show execPrefix ++ show arguments
system $ Prelude.unwords $ execPrefix ++ arguments
Can you please lend me a hand?
@mihaimaruseac Thanks in advance. It may be a bug in the way I detect stack
environment or bug in the way stack
runs nested. Either way, I would need your guidance as to how to improve it, since detection of nested stack
environment is a bit of a riddle to me.
Can you tell anything about whether /tmp
is available on Stackage CI?
to clarify, the stackage build server builds with cabal-install,
To further clarify, the stackage build server builds with runghc Setup configure
, runghc Setup build
, etc. 100% of the time, Setup.hs is cabal's defaultMain or some other use of Cabal, but in theory, it could be anything.
stack build cabal-install
should work correctly for people that are sticking to stackage defaults.
resolv
and other missing deps back into the build plans anyways. Assuming it is compatible and all. Not sure how difficult it would be to detect which conditional dependencies we could harmlessly include automatically, but we can for sure include them on a case-by-case basis as needs arise, such as this.
Hi, I can't install the package unix with with the following command:stack build --copy-compiler-tool unix.
When I tried this, nothing happened.
I have Mac Sierra and I would expect the unix-2.7.2.2 version to be installed. My GHC version is 8.6.4.
Thanks in advance.