haskell-stack getting TlsExceptionHostPort error - haskell

Been running stack/ghc inside Debian 8.2 via vagrant for a while. This morning:
$ stack setup
Run from outside a project, using implicit global project config
Using resolver: lts-4.2 from implicit global project's config file: /home/vagrant/.stack/global-project/stack.yaml
Downloading lts-4.2 build plan ...TlsExceptionHostPort (HandshakeFailed (Error_Protocol ("certificate has expired",True,CertificateExpired))) "raw.githubusercontent.com" 443
$ stack --version
Version 1.0.2, Git revision fa09a980d8bb3df88b2a9193cd9bf84cc6c419b3 (3084 commits) x86_64
The same error remains even if I delete ~/.stack. Did I mess something up?

You might want to try running stack -v setup to be able to see which files are being downloaded.
Then identify which file(s) cannot be downloaded due to this TlsExceptionHostPort - hopefully there won't be too many of them - and run:
curl -0 https://raw.githubusercontent.com/path_to_your_file > your_file
Once your blocking file(s) have been downloaded, re-run stack setup.
This might not be a clean approach, but it worked for me.

Related

GSL not installing in Windows 10 using GIT Bash

When I run the config file for installing GSL library for Windows 10 I get the following error:
error: Something went wrong bootstrapping makefile fragments for
automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE="gmake" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency
tracking).
If I run ./config MAKE="gmake" I still get the error. I have searched in StackOverflow and on the web and still haven't found a solution.

Please add a #NgModule annotation but I cannot figure why

I have a Node/Angular app which works locally in a Docker instance. For deployment to a Google VM, we have a script which checks out the Git files, compiles them, copies the outputs into an nginx folder and restarts the nginx.
I have (what I thought was) identical setups on two different VMs. I test any changes on the "staging" VM and then if all is working correctly, I run them on the "production" VM.
Yesterday, this system broke. My staging VM pulls, compiles and runs the code without any issues or even warnings. The production VM gives errors during the compilation
The compilation line is
sudo $(npm bin)/ng build --prod --output-path=dist
and the first error I see is
ERROR in : Unexpected value 'AngularFireDatabaseModule in /home/redacted/ng-app/node_modules/#angular/fire/database/angular-fire-database.d.ts' imported by the module 'AppModule in /home/redacted/ng-app/src/app/app.module.ts'. Please add a #NgModule annotation.
So, I saw this question which said I should move import to the declarations section. I did this for AngularFireDatabaseModule and then it would not compile on my (working) staging server, giving me an error
Please add a #Pipe/#Directive/#Component annotation
Which this answer says means I need to move the declaration back to the imports!
My assumption is that my two supposedly identical VMs have something different about them, but I am having difficulty figuring out what.
Is there some kind soul who can help me figure out what the difference is?
Both VMs: Running Ubuntu 20.04.3 LTS (GNU/Linux 5.11.0-1028-gcp x86_64)
Both VMs up to date
Both VMs: node --version
v17.4.0
Both VMs: sudo node --version
v13.14.0
Both VMs: npm -v
8.3.1
Both VMs: sudo npm -v
6.14.4
What else should I be checking for?
OK, I can't be sure what exactly fixed it, but in the end, I had to go into the folder where the compilation was occurring and run
sudo npm update
which seemd to fix the problems. Could've sworn I did that a few times before, but ¯\(ツ)/¯
Leaving this for anyone who is despairing - the simple answers seem to work best

weird error with haskell-stack. it doesn't install anything anymore

I get an error with stack, while trying to install a package.
Run from outside a project, using implicit global project config
Using resolver: lts-8.0 from implicit global project's config file: /home/chuck/.stack/global-project/stack.yaml
Invalid package ID: "array-0.5.1.1 base-4.9.1.0 binary-0.8.3.0 bytestring-0.10.8.1"
stack --version works:
Version 0.1.10.0 x86_64
and stack setup returns this:
Run from outside a project, using implicit global project config
Using resolver: lts-8.0 from implicit global project's config file: /home/chuck/.stack/global-project/stack.yaml
stack will use a locally installed GHC
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
I reinstalled stack and I get the same error after the new installation. So, I don't know what I'm doing wrong. I need it for using atom.
EDIT
Stack.yaml:
# This is the implicit global project's config file, which is only used when
# 'stack' is run outside of a real project. Settings here do _not_ act as
# defaults for all projects. To change stack's default settings, edit
# '/home/chuck/.stack/config.yaml' instead.
#
# For more information about stack's configuration, see
# https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
#
flags: {}
extra-package-dbs: []
packages: []
extra-deps: []
resolver: lts-8.0
After trying a many things I "found the answer".
The problem was, as epsilonhalbe saw, that I had an old version. So I tried to do this wget -qO- https://get.haskellstack.org/ | sh and it didn't work, because I had stack on /usr/bin/ so, I removed stack and then tried again wget -qO- https://get.haskellstack.org/ | sh. I added $HOME/.local/bin/ to the path, and it's working properly.
I hope it can help someone
EDIT
There's a new version of stack, but ghc-mod just works until the lts-9.0 of stack. So, if you're having troubles with ghc-modand your stack version is over 8.0.2 then:
nano /Users/USERNAME/.stack/global-project/stack.yaml
and replace resolver: --- for resolver: lts-9.0
Then, on the terminal stack solver and it's gonna work :)
I was blocked by the same problem, unless I check which stack (or use where stack as alternative) and I found that I'm using an old version of stack which I installed somehow, and the new version was never accessed when I typed the stack command ...
Here is the situation when I realized the problem..
If you check stack --version and get something like Version 0.1.10.0 x86_64, then it is far away from the current version, the current version I'm using (when answering this question) is Version 1.3.3, Git revision 078cfadeb37a39501eae24732e5c757cc8aca31b x86_64 hpack-0.17.0
If you had confirmed that you are not using the wrong one stack, but the stack version is still too low, you can use stack upgrade --git to upgrade your stack to the latest version from git (notice that this will take a while).
Hope this helpful.

Permission denied when installing ghc using stack setup

I'm following http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html to get started with the stack tool.
$> stack --version
Version 0.1.3.1, Git revision 908b04205e6f436d4a5f420b1c6c646ed2b804d7
In the step "Installing GHC" I get Permission denied:
$> stack setup
Run from outside a project, using implicit global config
Using resolver: lts-3.2 from global config file: /Users/karl/.stack/global/stack.yaml
Preparing to download ghc-7.10.2 .../Users/karl/.stack/programs/x86_64-osx/ghc-7.10.2.tar.bz2.tmp:
openBinaryFile: permission denied (Permission denied)
Is this expected (a bug in the guide) or a bug in stack?
Running the same command with sudo seems to solve the problem. Is this the intended method?
$> sudo stack setup
Password:
Downloaded ghc-7.10.2.
Installed GHC.
stack will use a locally installed GHC
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
I'm running a fresh install of OS X 10.10.4 (Yosemite).
Thanks to the suggestion by #user5402 I found, that for some reason, ~/.stack/programs was owned by root.
After removing the .stack directory stack setup worked as expected.

Permission denied error while installing gitlab-ci

While installing gitlab ci (continues integration) on ubuntu (12.04LTS) i get the following error in step 5 (Setup application)
from: https://github.com/gitlabhq/gitlab-ci/blob/master/doc/installation.md
root#s2:~# cd /home/gitlab_ci/gitlab-ci/
root#s2:/home/gitlab_ci/gitlab-ci# sudo -u gitlab_ci -H gem install bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/local/lib/ruby/gems/1.9.1 directory.
It seems these gems try to install outside /home/gitlab_ci which indeed would fail as user gitlab_ci
My question is - are these instructions wrong? - or - am i an edge case.
And offcourse how would I safely solve this problem, just running the command as root might give me more trouble later on...
Extra information, Ruby was originally installed for gitlab itself and that works fine.
Considering that gitlab installation step 2 proposes to recompile ruby, I usually compile it with a --prefix=/home/gitlab/ruby1.9.3 argument, in order to use a ruby in which I have full rights to write/add any gem I want without using sudo.
So the $PATH used by the gitlab_ci account should include /home/gitlab/ruby1.9.3/bin and any gem installed by that account would go into the local compiled ruby.
If both accounts are part of the same group, they should both be able to write into /home/gitlab/ruby1.9.3/lib/ruby/gems/1.9.1.

Resources