How to fix InvalidAbsFile error from stack build - haskell

I seem to be getting a peculiar problem which is hard to even search up online.
I'm using stack and have already created a project from my professor but when I try to run it with stack build or stack run
I get this error:
InvalidAbsFile "C:\\Programs\\Projects\\bimaru2\\\"C:\\Windows\\system32\\ghc-9.0.2.exe"
The error is mentioned here: https://hackage.haskell.org/package/path-0.9.2/docs/Path-Windows.html#v:InvalidAbsFile but this description is not telling me anything.
I found someone with a similar problem: InvalidAbsFile error when running "stack" on windows in an existing project. I removed Java but the problem still persists. I tried changing directories and all, so the first path is printed according to where the project is. My version of ghc was 8.10.7 and I reinstalled 9.2.4, so I have no idea where 9.0.2 comes from (nor do I have it in C:\Windows\system32\ directory).
This is the second project I get this error with, but the first one I solved by setting system-ghc in stack.yaml file from true to false (although the professor mentioned that then it did not compile for him until he changed it back when we turned in the assignment).
packages:
- .
resolver: lts-18.28
compiler: ghc-8.10.7
compiler-check: match-exact
system-ghc: false
install-ghc: false
I tried the same with this one, but it did not work.
If needed, I will provide a link to the github repo where the project is located.
I'd be really grateful if you could help me get the project running. Thanks in advance!

Related

stack install error: Recommended extra-dep

I am currently trying to install stack to utilise the software Taiji. I have been able to run 'stack setup', but get an error when I run stack install:
C:\Users\My Name\Taiji-1.2.1>stack install
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for shelly-1.8.1:
unix needed, but the stack configuration has no specified version (latest matching version is 2.7.2.2)
needed due to Taiji-1.2.1 -> shelly-1.8.1
Some different approaches to resolving this:
* Recommended action: try adding the following to your extra-deps in C:\Users\My Name\Taiji-1.2.1\stack.yaml:
- unix-2.7.2.2#sha256:9e93f93cc5a065248120136e83a0a6d1ce93d6eb5ef2a2543f9593e93e164d24,3496
Plan construction failed.
I am guessing I'll have to install another package of some sort and put it into the Taiji-1.2.1 folder, but am not exactly sure how(I am completely new to stack/programming). Is anyone able to help me with this issue? Thanks kindly.
When you see this error, you will need to open stack.yaml (the error message contains the full path), find the line saying # extra-deps: [], and replace it with the line shown in the error message:
extra-deps:
- unix-2.7.2.2#sha256:9e93f93cc5a065248120136e83a0a6d1ce93d6eb5ef2a2543f9593e93e164d24,3496
(If you already have something listed in extra-deps, then you can just add that line to the end of extra-deps rather than replacing the whole thing.)
Now, this is usually enough. But you’ve got a further problem: you are using Windows, but you’re trying to compile a program which depends on the unix package — a package which is not available on Windows. Due to this, you will not be able to compile your program on Windows.
(As for why all that extra-deps stuff is needed: basically, Stack maintains a list of package versions known to work with each other, but occasionally you will run into a package which isn’t in that list. In that case you will need to list that package version in extra-deps to tell Stack which version to use.)

Error: Cannot find module './dist-tools/transform.js' from '/opt/atlassian/pipelines/agent/build/node_modules/aws-sdk'

Hi so we have something interesting happening in our builds.
Nothing regarding the gulp build script changed from our side for one of our projects. But suddenly today when we try to do a pipeline build on one of our repositories we get the following stacktrace error:
Error: Cannot find module './dist-tools/transform.js' from '/opt/atlassian/pipelines/agent/build/node_modules/aws-sdk'
at /opt/atlassian/pipelines/agent/build/node_modules/resolve/lib/async.js:128:35
at load (/opt/atlassian/pipelines/agent/build/node_modules/resolve/lib/async.js:147:43)
at onex (/opt/atlassian/pipelines/agent/build/node_modules/resolve/lib/async.js:172:17)
at /opt/atlassian/pipelines/agent/build/node_modules/resolve/lib/async.js:13:69
at FSReqWrap.oncomplete (fs.js:152:21)
Has anyone come accross this before? (we are using node 10.17 for our builds)
We tested the same code from our local builds and get the exact same issue. It seems that something in the aws-sdk package changed?
Since this error suddenly appeared this morning, we looked at our aws-sdk package and updated it to the latest version (2.643.0), but we still get the same error. No code that uses the aws-sdk package has changed.
Also seeing this as of this morning. I find this somewhat sus (adding dist-tools to npmignore).
https://github.com/aws/aws-sdk-js/commit/98c40e64cb7d60927c6a0cec49592fc1fcaa59d7
I wonder if pulling the package directly from GH would resolve.
UPDATE:
I've got a convo going on over here about this https://github.com/aws/aws-sdk-js/issues/3159
We downgraded to the previous version and our issue went away.

Haskell-Stack: Access violation error during build

I've been trying to build my Haskell project for the last couple days using stack and I'm getting an access violation error. From what I understand I have the latest stack version and GHC.
This was all originally working until I added a library to my cabal file. I've now removed it but the error still occurs. I've also reverted back to when my code was definitely working so I'm sure this is something caused by stack.
I've tried uninstalling stack, deleting .stack-work and reinstalling. Then doing a stack setup. I've tried many variations of commands but no results.
I've now also tried creating a new project with Stack and building it and I get the same issue.
stack build
Building all executables for `haskell-project' once. After a successful build of all of them, only specified executables will be rebuilt.
haskell-project-0.1.0.0: configure (exe)
Access violation in generated code when reading 000000000e58391a
-- While building custom Setup.hs for package haskell-project-0.1.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\13cecb13\pkgdb --package-db=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\pkgdb --libdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\lib --bindir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\bin --datadir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\share --libexecdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\libexec --sysconfdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\etc --docdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --htmldir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --haddockdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --dependency=base=base-4.10.1.0 --dependency=containers=containers-0.5.10.2 --dependency=mtl=mtl-2.2.1-DscMMmDQUE6GBfOSl4qMUH --dependency=parsec=parsec-3.1.11-3BgBURmbRiVF8fgoxhAiBa --dependency=pretty-simple=pretty-simple-2.0.1.0-J3QTM6x6LHL5fhqavYvVhJ --dependency=text=text-1.2.2.2-9VTsh6V7U7hpagw2HDvpZ --extra-include-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --enable-tests --enable-benchmarks
Process exited with code: ExitFailure 1
What would be the steps to fix this or likely causes?
I managed to find a temporary solution for anybody who is having the same issue.
I downgraded cabal to version 1.24.0.2 and changed the resolver to using GHC version 8.0.1 (resolver: ghc-8.0.1).
After then running stack solver I'm now able to build.
The issue #3765 on the stack tracker has some workarounds for this, in addition to Michael's answer.
The best solution, it seems, is to unset __COMPAT_LAYER, which when set to INSTALLER can reproduce the bug.
C:\>set __COMPAT_LAYER=
The cause might be a bug in some versions of GHC, which is catching exceptions it ought to propagate to the user. If this is the case, there is an underlying problem, and this bug is hiding it.
Do please add a comment on the aforementioned issue, as it will help the maintainers track the prevalence of this problem.

Charm++ State_Space_searchengine Compiling error

I am trying to compile and run TSP problem in charm++ framework. The Code is mentioned in the State_Space_SearchEngine directory inside TSP_SE folder. I have compiled it as per the README file mentioned in the directory. As it says to run 'make OPTS=-O3' command in //tmp/libs/ck-libs/state_space_searchengine/ that I have done. And after doing this when I run the TSP_SE application using 'make OPTS=-O3' command I am getting these errors.
Please help me out.Compilation Error
To fix the error all you need to do is make the mainchare class (Main) inherit from CBase_Main in file main.C of the TSP_SE directory.
This fix has been incorporated into the mainline development version of Charm++ and will be a part of the Charm++ v6.8.0 release. Thanks for pointing it out.

Node.js module "fibers" not taking the correct version

I'm pretty new to node.js and its package management system and its require. I'm having trouble with the following runtime error I'm getting after having installed a bunch of packages with npm install:
ERROR: Couldn't initialise framework "wdio-mocha-framework".
Error: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
(required by <path>.../node_modules/fibers/bin/linux-ia32-v8-5.0/fibers.node)
at Error (native)
My understanding of the error is that the binary fibers.node was compiled with a newer libstdc++ than the one available at runtime.
It appears to me like the npm install did compile a fibers.node:
> fibers#1.0.13 install <path>.../node_modules/fibers
> node build.js || nodejs build.js
make[1]: Entering directory `<path>.../node_modules/fibers/build'
<snip some output, including warnings, here that I don't deem relevant>
Installed in `<path>.../node_modules/fibers/bin/linux-ia32-v8-3.14/fibers.node`
However, I see that the fibers.node that is throwing the error at runtime is not the same one as was compiled, and I assume that's the source of the problem.
Compiled:
.../linux-ia32-v8-3.14/fibers.node
Used at runtime and fails:
.../linux-ia32-v8-5.0/fibers.node
So I'm guessing and hoping that if I could convince wdio-mocha-framework to use the locally-compiled fibers.node, it would work. My questions are thus:
Would that fix it?
If so, how do I achieve that?
If not, what's the correct direction to take to further understand and fix this error? Perhaps instead of getting 3.14 to be used at runtime, I should be convincing 5.0 to be compiled at install-time? Or ... other?
Your help is most sincerely appreciated.
Update/Edit:
I think I solved this on my own, in case anyone ever finds this poor, dusty old question lying forgotten on the back of a shelf somewhere...
The problem was apparently due to multiple versions of node/node-gyp that were installed in my environment in parallel, and the build process, even though it was started with a newer version of node, was finding node-gyp in the $PATH and that's apparently what caused the old version of fibers to be built. At least, I think so.
Just had this problem recently. I managed to solve it just by uninstalling the current version of Node.JS (I had the most recent, in this case 9.5.0) and installing the recommended, in this case 8.9.4. and the issue is gone. hope this helps someone.

Resources