Why did HSL extension stop working on VS Code? - visual-studio-code

I am using Windows 11. I've been using Haskell with VS Code. Suddenly yesterday it stopped giving me problems section (one that displays syntax errors and such before code is compiled). I am using Haskells own extension (ID: haskell.haskell).
I am not entirely sure, but it might be that Haskell Language Server is causing the issue. Every time I start VS Code, disable / re-enable, uninstall and install, it will prompt me this:
Obviously I hit "Yes". Then this is displayed for a fraction of a second and this disappears without any fail or pass message:
I am not keen on installing it manually, since it worked before and it should again.
Edit:
As suggested by #Ismor I checked ghcup list -c installed. It gave me this info:
[ Warn ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.8.1.0'
[ Info ] verifying digest of: gs.exe
Tool Version Tags Notes
IS ghc 9.2.5 recommended,base-4.16.4.0
IS cabal 3.6.2.0 recommended
I stack 2.9.3 latest
IS ghcup 0.1.19.0 latest,recommended
As hsl was not in the list I tried ghcup install hsl 1.9.0.0 --set which gave me:
[ Warn ] This is an old-style command for installing GHC. Use 'ghcup install ghc' instead.
[ Warn ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.4.4'
[ Warn ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.8.1.0'
[ Info ] verifying digest of: gs.exe
[ Error ] [GHCup-07140] Both installation and setting the tool failed. Install error was: Unable to find a download for the requested version/distro.
[ ... ] Set error was: The version hsl of the tool ghc is not installed.
[ Error ] Also check the logs in C:\ghcup\logs

For now I got the end result I wanted, but I am not quite sure what was the problem. Anyway I installed the ghc again, but I had to disable my antivirus before that. After that hsl was already installed and I only had to reload the extension from VS Code.
I would guess that there it was trying to update hsl and my antivirus messed up the update for some reason. I remember that when installing Haskell in the first place it required me to momentarily disable my antivirus. But take that with a large grain of salt, because I deffinetly am not sure about that.

Related

Flutter simply showing 'sysctl -n hw.optional.arm64' returned unexpected output: ''

Not sure which details are relevant so I'll include as many as possible.
Had to upgrade flutter today and instead of working when I typed in 'flutter upgrade' into android studios terminal/Iterm2/terminal zsh I was met with the following response.
'sysctl -n hw.optional.arm64' returned unexpected output: ''
When I search for this issue the only thing i can find is this post which states that sysctl can't be found. The path does appear to be in my .zshrc but still not working. I can't use which or where sysctl as it just says 'sysctl not found'
When I try to upgrade flutter through brew (brew install --cask flutter) it downloads fine but on installing it throws the following error:
==> Purging files for version 3.3.5 of Cask flutter
Error: It seems there is already a Binary at '/opt/homebrew/bin/dart'.
I can't continue working as I need the new flutter version and it seems the web doesn't have much to show for this particular error.
I can't flutter --version, flutter doctor or anything of the sort as I just get the same message.
I'm using:
MacOS monterey 12.6 macbook air.
Android studios
Iterm2
Ohmyzsh
When I open android studios it shows me the following:
"Flutter device daemon #1 exited (exit code 1), stderr: 'sysctl -n hw.optional.arm64' returned unexpected output: '' in a pop up window.
Pubspec has been edited > get dependencies > Upgrade depenedencies: Both of which have the same error as in the title.
The current configured flutter SDK is not known to be fully supported. Please update your SDK and restart intelliJ which I think is what I've been trying to do.
This is an answer I hope will be helpful for others who have the same issue.
Other answers suggested a fix by just updating the path document (.zshrc) but this is what helped me as that did not and my paths were up to date.
Sadly, it's as simple as manually deleting all my flutter SDK files locally. Downloading them again (this time the latest one) and unzipping it into the same place. Didn't even have to update the path).
Worked a charm, issues appear to be all gone except that the dialogue in android studios is still saying that there are dependencies that need getting and upgrading (but doesn't go away even when I've run it).
I solved it by removing the old flutter SDK, downloading the latest version, and setting it up again.
it works perfectly for me!

Haskell and postgresql - build error "The program pg_config is required but it could not be found."

I am currently learning haskell and just tried using postgresql as a database.
I generated my project with stack (stack new <name> -> stack setup -> stack build)
and then all I changed was adding the dependencies needed to persistent and postgresql to the
package.yaml file (under "dependencies:").
These are:
persistent
persistent-postgresql
persistent-template
This however results in a failing build with the following message:
postgresql-libpq > setup.exe: The program 'pg_config' is required but it could not be found.
postgresql-libpq >
-- While building package postgresql-libpq-0.9.4.2 using:
C:\Users\\AppData\Local\Temp\stack14388\postgresql-libpq-0.9.4.2.stack-work\dist\e626a42b\setup\setup --builddir=.stack-work\dist\e626a42b configure --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\365a3dde\pkgdb --libdir=C:\sr\snapshots\365a3dde\lib --bindir=C:\sr\snapshots\365a3dde\bin --datadir=C:\sr\snapshots\365a3dde\share --libexecdir=C:\sr\snapshots\365a3dde\libexec --sysconfdir=C:\sr\snapshots\365a3dde\etc --docdir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --htmldir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --haddockdir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --dependency=Cabal=Cabal-2.4.1.0-5rQrtDcYhR2LOcYye7obEr --dependency=Win32=Win32-2.6.1.0 --dependency=base=base-4.12.0.0 --dependency=bytestring=bytestring-0.10.8.2 -f-use-pkg-config --extra-include-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include --extra-lib-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\lib --extra-lib-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\bin --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
Does anyone know how to resolve this issue and why it even occurs?
Do I have to install postgresql just for being able to run build the project? If so, how would you
do this in production, when the database could basically lie everywhere?
It looks like Haskell is trying to build with the PostgreSQL client shared library libpq.dll and uses pg_config at build time to determine where PostgreSQL is installed and how it was built.
That would mean that you have to install PostgreSQL on the machine where you build Haskell, including the header files, build environment or however it is called by the installer.
For running Haskell you would only need libpq.dll and the dependent shared libraries.
I solved the issue in Ubuntu with the following command:
apt install libpq-dev

error installing lang/perl5.30 on FreeBSD 12.0

Clean installation of FreeBSD 12.0 updated to last patch.
Trying to install Perl: portmaster lang/perl5.30
Error: malloc.c:1242:13: error: use of undeclared identifier 'my_perl
How to fix it?
Well I don't know how FreeBSD handles patching the source code its compiling, but perl-5.30.0 needs the following patch applied to build properly on systems which use perl's malloc() library:
v5.31.0-13-g9629b6dc1d
1.go to /usr/ports/lang/per5.30
2.run "make config" and deselect PERL_MALLOC option
3.now retry make install

Using Scons to build mongo-nonx86 on an arm based Synology NAS

I have a Synology DS212j NAS (cpu Feroceon 88FR131 rev 1 (v5l)) with the optware ipkg installed. I am trying to build mongo-nonx86 on it.
"scons all" gives me the following messages:
scons: Reading SConscript files ...
scons version: 2.0.1
python version: 2 5 6 'final' 0
Checking whether the C++ compiler worksyes
Checking for C library stdc++... no
can't find stdc++ library which is needed
I have the stdc++ library installed, I also have ssl installed. My underlying question is how can I get scons to tell me more about what is really missing, where it is looking, how it is looking etc. I have so far found no options which generate any more useful diagnostic output?
Obviously a ready-made solution for getting mongodb working on this great little box would be even more welcome :-)
Well even if you do have it installed, it doesn't seem to think so, here is what I would try to do, install libssl-dev, then try to install the dev package for libstdc++, which is: libstdc++-dev.
Then see if you can compile it.

Opa build failure under OS X Lion

I've been wanting to get my hands dirty with Opa, but had been really feeling the lack of a REPL, which is my weapon of choice in coming to terms with a new language. Lo and behold, the Opa Blog mentioned a tool called opatop which appeared to be just that, but it doesn't seem to be included the standard Mac or Ubuntu distributions.
I trekked over to GitHub, grabbed the source, and started building, but I'm getting the same error mentioned here:
+ /opt/local/bin/ocamlopt.opt dynlink.cmxa unix.cmxa str.cmxa nums.cmxa -g threads.cmxa -thread -I +zip zip.cmxa -I +ocamlgraph graph.cmxa -I /opt/local/lib/ocaml/ulex ulexing.cmxa buildinfos.cmxa libbase.cmxa compilerlib.cmxa libtrx.cmxa opacapi.cmxa passlib.cmxa libqmlcompil.cmxa jslang.cmxa ocamllang.cmxa libbsl.cmxa libbsl/bslregister.cmx opalang.cmxa -o libbsl/bslregister.native
File "_none_", line 1, characters 0-1:
Error: Cannot find file dynlink.cmxa
Command exited with code 2.
I know next to nothing about OCaml development, but it looks like other files with the same extension in the relevant library directory are "OCaml native library files". Given that, is this just a library that wasn't included in the OCaml distribution I ended up with? The Mantis bug referenced in the link above makes it look as though there may be conflicting assumptions about build environments at work.
Regardless, can anyone offer any advice?
Thanks!
OCaml isn't built with native dynlink for Lion yet, so dynlink.cmxa doesn't exist under the default install.
The following patch will enable allow you to build it. From within the OCaml src dir, patch -p1 < PATH/TO/PATCH, and reinstall OCaml as appropriate.
This is for OCaml 3.12.1
--- a/configure 2011-07-04 14:15:01.000000000 -0700
+++ b/configure 2011-08-26 10:18:42.000000000 -0700
## -619,9 +619,9 ##
case "$host" in
*-*-cygwin*) natdynlink=true;;
i[3456]86-*-linux*) natdynlink=true;;
x86_64-*-linux*) natdynlink=true;;
- i[3456]86-*-darwin10.*)
+ i[3456]86-*-darwin1[01].*)
if test $arch64 == true; then
natdynlink=true
fi;;
i[3456]86-*-darwin[89]*) natdynlink=true;;
I have investigated Opa build under OS X Lion and have pushed 2 patches on opalang waiting for approval to solve main problems.
So when the patches will be available, this is my steps (as i remember) to make Opa work under Lion :
First, install necessary tools :
Install OS X Lion
Install Xcode 4
Install MacPorts
Install wget (macports)
Install coreutils (macports)
Install md5sha1sum (macports)
(I think that's all...)
Then compile Opa from source :
git clone https://github.com/MLstate/opalang.git
cd opalang
dependencies/installation_helper.sh --prefix ~/Opa
change your PATH in your ~/.profile : export PATH=~/Opa/bin:$PATH
re-source your .bashrc : source ~/.profile
./configure -prefix ~/Opa
make all install
Your new opa compiler should be in ~/Opa/bin :)