You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spent several hours yesterday trying to figure out why my ci job running spago build / spago test was failing despite nothing visibly changing in the environment, and the purs compile step exiting at random points in the build with:
$ spago build --pure --strict --pedantic-packages && bun run scripts/fmt.js --check
Reading Spago workspace configuration...
✓ Selecting 13 packages to build:
<snip>
Downloading dependencies...
Refreshing the Registry Index...
Building...
[ 1 of 941] Compiling Unsafe.Coerce
[ 2 of 941] Compiling Web.Event.Internal.Types
[ 4 of 941] Compiling Type.Proxy
[ 3 of 941] Compiling Web.DOM.Internal.Types
[ 5 of 941] Compiling Type.Function
[ 6 of 941] Compiling Type.Equality
[ 7 of 941] Compiling Type.Row
<snip>
[xxx of 941] Compiling xxx
‼ Failed to decode PsaResult at index '0': Unexpected end of JSON input
Json was:
✓ Build succeeded.
Eventually I had the thought "maybe the --memory=1G I added to the runner is making purs compile exit early" which turned out to be exactly the case. Not sure if this is necessarily a bug in spago, just documenting this as an issue here for people who run into this in the future.
The text was updated successfully, but these errors were encountered:
caseJSON.parse err >>= CJ.decode psaResultCodec >>> lmap CJ.DecodeError.print of
Left decodeErrMsg ->do
logWarn $ Array.intercalate "\n"
[ "Failed to decode PsaResult at index '" <> show idx <> "': " <> decodeErrMsg
, "Json was: " <> err
In line 44 we call getStdout (which I think is an antipattern and should only be used in tests) without first checking if result is a Left or a Right. I suspect that when the compiler fails we get the error on stderr and stdout is empty, but we still try to decode it.
Spent several hours yesterday trying to figure out why my ci job running
spago build
/spago test
was failing despite nothing visibly changing in the environment, and thepurs compile
step exiting at random points in the build with:Eventually I had the thought "maybe the
--memory=1G
I added to the runner is makingpurs compile
exit early" which turned out to be exactly the case. Not sure if this is necessarily a bug in spago, just documenting this as an issue here for people who run into this in the future.The text was updated successfully, but these errors were encountered: