ghci loads slowly for the first time - ghci

OS: Linux Slackware 14.2. ghci 8.4.3.
It takes around 10 seconds to start ghci for the first time. After that it starts quickly. I thought that it tries to load some libraries.
$ strace ghci
gives an interesting output:
open("/usr/lib/ghc-8.4.3/bin/../haskeline-0.7.4.2/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/ghc-8.4.3/bin/../stm-2.4.5.0/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/ghc-8.4.3/bin/../ghc-8.4.3/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/ghc-8.4.3/bin/../terminfo-0.4.1.1/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/ghc-8.4.3/bin/../ghci-8.4.3/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/ghc-8.4.3/bin/../ghc-boot-8.4.3/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/ghc-8.4.3/bin/../transformers-0.5.5.0/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/ghc-8.4.3/bin/../hpc-0.6.0.3/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/ghc-8.4.3/bin/../template-haskell-2.13.0.0/libffi.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
There is more like this. The same happens for the libraries:
libncursesw.so.5
librt.so.1
libutil.so.1
libdl.so.2
libpthread.so.0
libgmp.so.10
libc.so.6
Despite the fact that all these libraries are located in either /lib or /usr/lib it tries to find them inside internal ghc directories. What's going on? Can I fix it?

Related

isort will not parse directories anymore, are there variants?

Used isort for a while, but now it starts complaining about the fact that a directory is a directory??
venv/bin/isort --diff --check src tests
WARNING: Unable to parse file src due to [Errno 21] Is a directory: '[...]/src'
WARNING: Unable to parse file tests due to [Errno 21] Is a directory: '[...]/tests'
Are there more than one variants of isort??

Fix error permission denied "/Users/name/Library/Application Support/Lens/node_modules/lenscloud-lens-extension" while open lens apps

How to fix pop up error permission denied?
The log:
50 silly saveTree +-- lens-survey#5.2.5-latest.20211001.2
50 silly saveTree +-- lens-telemetry#5.2.5-latest.20211001.2
50 silly saveTree `-- lenscloud-lens-extension#5.2.5-latest.20211001.2
51 warn Lens No description
52 warn Lens No repository field.
53 warn Lens No license field.
54 verbose stack Error: EACCES: permission denied, access '/Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension'
55 verbose cwd /Users/162408.suryadi/Library/Application Support/Lens
56 verbose Darwin 20.4.0
57 verbose argv "/Applications/Lens.app/Contents/Frameworks/Lens Helper.app/Contents/MacOS/Lens Helper" "/Applications/Lens.app/Contents/Resources/app.asar/node_modules/npm/bin/npm-cli.js" "install" "--no-audit" "--only=prod" "--prefer-offline" "--no-package-lock"
58 verbose node v14.16.0
59 verbose npm v6.14.13
60 error code EACCES
61 error syscall access
62 error path /Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension
63 error errno -13
64 error Error: EACCES: permission denied, access '/Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension'
64 error [Error: EACCES: permission denied, access '/Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension'] {
64 error errno: -13,
64 error code: 'EACCES',
Could not load extensions: npm WARN checkPermissions Missing write access to /Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension
npm WARN enoent ENOENT: no such file or directory, open '/Users/162408.suryadi/Library/Application Support/Lens/node_modules/untitled folder/package.json'
npm WARN Lens No description
npm WARN Lens No repository field.
npm WARN Lens No license field.
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension'
npm ERR! [Error: EACCES: permission denied, access '/Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/162408.suryadi/.npm/_logs/2021-10-21T02_16_36_016Z-debug.log
In your logs you can find the description of your problem:
It is likely you do not have the permissions to access this file as the current user.
And one more thing to check:
If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
The error you got is because you cannot access the resource /Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension from the current user. If you want to fix it, you have to change the permissions for this resource or change its owner. It is also possible (since you are using Kubernetes) that you will have to make such a change in the image of the system you are using.
To change owner the resource run
sudo chown -R $USER /Users/162408.suryadi/Library/Application Support/Lens/node_modules/lenscloud-lens-extension
You can find also many similar problems. In most cases, the only difference will be the different path to the resource. The mode of operation and the solution to the problem remains the same:
Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
https://progressivecoder.com/how-to-easily-fix-missing-write-access-error-npm-install/
https://flaviocopes.com/npm-fix-missing-write-access-error/

ERROR: Command errored out with exit status 1: python setup.py egg_info; update setuptools doesn't work

I'm trying to install a private python module with command: "pip install . -i "private url" "
I had this error:
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-rnoryb6e\
I uninstall Python 38 and reinstall it.
Pip is updated and setup_tools is also updated.
And now I have this error:
D:\L1\onelib\trx-5g>D:\L1\onelib\venv\Scripts\pip.exe install . -i https://artifactory-espoo1..com/artifactory/api/pypi/ulphy-pypi-prod-virtual/simple
Looking in indexes:
https://artifactory-espoo1..com/artifactory/api/pypi/ulphy-pypi-prod-virtual/simple,
https://artifactory-espoo2.***********.com/artifactory/ap
i/pypi/mn-l1-pz-int-lib-local/simple Processing d:\l1\onelib\trx-5g
ERROR: Command errored out with exit status 1:
command: 'd:\l1\onelib\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\se
tup.py'"'"';
file='"'"'C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(file);code=f.read().repla ce('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
egg_info --egg-base
'C:\Users\hwi_pi\AppData\Local\Temp\pip-pip-egg-info-zvlq1hsf'
cwd: C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz
Complete output (15 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\setup.py",
line 23, in
version=os.environ.get('CI_COMMIT_TAG', f'0.0.0+{get_local_version_label()}'),
File "C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\setup.py",
line 17, in get_local_version_label
commit_hash = subprocess.check_output(COMMAND.split()).decode('utf-8').strip()
File "C:\Users\hwi_pi\AppData\Local\Programs\Python\Python38\lib\subprocess.py",
line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\hwi_pi\AppData\Local\Programs\Python\Python38\lib\subprocess.py",
line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\hwi_pi\AppData\Local\Programs\Python\Python38\lib\subprocess.py",
line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\hwi_pi\AppData\Local\Programs\Python\Python38\lib\subprocess.py",
line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for
full command output.
Where the logs are located ?
I'm on Windows 10.
Python 3.8.5.
I launched this command via Pycharm and via cmd windows and same result.
I tried to run the command in administration mode; and same result.
I have tried every solution available on stackoverflow and nothing solves my error.
I tried to find C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\setup.py to see the file setup.py but foled pip-req-build-_4yae_lz doesn't exist.
I can access to https://artifactory-espoo1.************.com/artifactory/api/pypi/ulphy-pypi-prod-virtual/simple via firefox; but I can't download it in .zip for example
Someone to help please ?

Creating virtualenv inside veracypt error

I'm setting up a project inside veracrypt and it's throwing this error when I try to setup the environment.
admin#kali:/media/veracrypt1$ virtualenv --python=python3 venv
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /media/veracrypt1/venv/bin/python3
Also creating executable in /media/veracrypt1/venv/bin/python
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/virtualenv.py", line 870, in main
symlink=options.symlink,
File "/usr/local/lib/python3.7/dist-packages/virtualenv.py", line 1162, in create_environment
install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
File "/usr/local/lib/python3.7/dist-packages/virtualenv.py", line 1672, in install_python
os.symlink(py_executable_base, full_pth)
PermissionError: [Errno 1] Operation not permitted: 'python3' -> '/media/veracrypt1/venv/bin/python'
I've tried to look for the source of the issue and it seems it's related to how it's a virtualdrive with limited rights
admin#kali:/media/veracrypt1$ ln -s testfile
ln: failed to create symbolic link './testfile': Operation not permitted
Looks like you are running this in an environment with limited permissions.
Some report this behavior when running on Linux,
but in a folder that is mounted to a "FAT32" partition -
see Chris Lope's blog-post:
permissionerror: [errno 1] operation not permitted
I have experienced this behavior while running in an Ubuntu VM
in a folder that was mounted to the host-OS (Windows-NTFS) as type 'vboxsf'.
Solved it by moving to work in a partition that is native Unix.

Permission denied starting Eclipse on Ubuntu

I just installed Indigo (Eclipse) on my ubuntu 11.10 machine and received a permission denied error when attempting to start Eclipse from the terminal.
ls -l /usr/lib/ | grep eclipse
yields
drwxr-sr-x 9 root ben 4096 2011-10-13 12:10 eclipse_indigo
I tried to sudo chmod 755 eclipse_indigo to no avail.
Any other suggestions would be greatly appreciated.
strace /usr/lib/eclipse_indigo
yields
execve("/usr/lib/eclipse_indigo/", ["/usr/lib/eclipse_indigo/"], [/* 74 vars */]) = -1 EACCES (Permission denied)
dup(2) = 3
fcntl(3, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcabfef8000
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Permission denied\n", 32strace: exec: Permission denied
) = 32
close(3) = 0
munmap(0x7fcabfef8000, 4096) = 0
exit_group(1) = ?
It's better if you just extract the tar.gz file from http://www.eclipse.org/downloads/?osType=linux in your home directory and use it from there...
I did the same... just wait till you need to install plugins for it. Even if you manage to start it you'll have other issues, so extract the archive and save yourself from some headaches...
Why not to install using your user instead of root?
Try sudo chown ben:ben eclipse_indigo to set yourself as the owner as well as the group-owner. I think your problem is related to that r-s in the group perms field of eclipse_indigo, unless that's a typo.
I had a similar problem on a linux machine, where eclipse was unpacked as root and started by a regular user.
Be careful, not to start eclipse as root, as it does an initialization of the so-called confguration directory inside your installation.
You may find my answer to that question useful (includes steps to fix it up):
Unable to open Eclipse (configuration area .. error)