How to address Zlib data stream format error when generating hoogle database? - macos

I am trying to generate a local hoogle database for its eventual use in a Haskell LSP with neovim.
Currently I'm running MacOS Monterey (12.6). I installed hoogle version 5.10.18.3 via cabal.
When running hoogle generate I get the following message:
$ hoogle generate
Starting generate
Reading Cabal... hoogle: Codec.Compression.Zlib: compressed data stream format error (incorrect header check)
Does anyone have an idea of how to proceed? Typing hoogle --help or hoogle generate --help does not give much information.

Try hoogle generate --download.
You probably had a corrupted download somehow. When hoogle attempts to re-generate the database it does not by default download. Hoogle documentation
Index all of Stackage
Run hoogle generate to generate an index for the current version of Stackage LTS. This command downloads the necessary inputs from the web as required and caches them (in the same directory as the database). To force redownloading pass --download. To demand no downloading, failing if the data cannot be found, pass --download=no. Links to the results will point at Hackage.
When I ran the --download flag, these files were fetched:
Downloading https://www.stackage.org/nightly/cabal.config... 1.81s
Downloading https://www.stackage.org/lts/cabal.config... 0.75s
Downloading https://raw.githubusercontent.com/haskell/haskell-platform/master/hptool/src/Releases2015.hs... 1.34s
Downloading https://hackage.haskell.org/packages/index.tar.gz... 3.67s
Downloading https://hackage.haskell.org/packages/hoogle.tar.gz... 6.89s

Related

appImage-builder V1.0.3

I am trying to use the latest version of the appImage-builder because appimages of my application built with the old version of appImage-builder do not run on ubuntu 22.04 anymore. So I got the order to try and see if it works with the new appImage-builder.
Currently (June 2022), only versions below 1.0 which are based on ubuntu 18.04 are available on docker (which we previously used to build our appimage).
The newer versions are available via github (https://github.com/AppImageCrafters/appimage-builder/releases).
However, I seem to be unable to execute:
appimage-builder --generate
or
appimage-builder --recipe AppImageBuilder.yml
Is there any documentation available on how to correctly use the .appimage version of appImage-builder? All I could find in https://appimage-builder.readthedocs.io/en/latest/ seems to refer to the docker version or a manually built version of appImage-builder.
Depending on the error message you get, there could be a couple of issues at play here.
If you got an error related to FUSE, then you need to install the libfuse2 package with apt install libfuse2. AppImages rely on libfuse2, but Ubuntu has stopped including it since 22.04, in favor of libfuse3.
If you get an error related to "file not found", then it could be that you do not have AppImageLauncher installed. Sadly, with type 2 AppImages the design decision was taken to modify the ELF header of the executable with 3 magic bytes at offset 8 of the executable. This means that Linux linkers will not run the file. AppImageLauncher actually copies the file to a temporary directory and zeroes out the magic number in order to be able to execute it.
A good starting point for debugging issues like this is to run the strace command, which will let you see which system call likely cause the error. Keep in mind that if you try to execute a file and you get File not found, it might mean that the linker specified by the file can not be found on the system or the ELF header is not valid. You can also run the executable by using the linker directly, which might give you more clues. For example with: /lib64/ld-linux-x86-64.so.2 <NAME-OF-YOUR-EXECUTABLE>.

Golang image iptc metadata

I need to get the meta data, especially the iptc meta data from the uploaded files on the server.
I have found two packages I can import, but both of them require the "libiptcdata" libary. It should not be a problem, but after I installed the libary with brew, as it is written on both of the packages page, and typed go get "https://github.com/Melraidin/iptc" (for example, one of the two packages I wanted to use), I got the following error:
../../github.com/Melraidin/iptc/main.go:10:10: fatal error: libiptcdata/iptc-data.h: No such file or directory
#include <libiptcdata/iptc-data.h>
^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
The error is real, the file is really is not there, but how then it could work at anyone else? I found these 2 packages suggestion of using on a few page.
Thank you for your help
First, I have removed the brew installed "libiptcdata" libary, than installed the following libaries:
"libiptcdata0"
"libiptcdata0-dev"
"python-iptcdata"
with these three, the "go get" is managed to run, and could continue working on the original problem...

Creating pip package for TensorFlow with GPU support results in 0 byte simple_console_for_windows.zip

After successfully building TensorFlow with GPU support, I'm trying to build the pip package and I'm getting an error saying it can't read the simple_console_for_windows.zip file.
I've confirmed that the file is in C:\tensorflow\bazel-bin\tensorflow\tools\pip_package folder, but it is 0 bytes.
This is my pip build command:
bazel-bin\tensorflow\tools\pip_package\build_pip_package C:/tmp/tensorflow_pkg
This is the full error:
Unzipping simple_console_for_windows.zip to create runfiles tree...
[./bazel-bin/tensorflow/tools/pip_package/simple_console_for_windows.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_windows.zip or
./bazel-bin/tensorflow/tools/pip_package/simple_console_for_windows.zip.zip, and cannot find ./bazel-bin/tensorflow/tools/pip_package/simple_console_for_windows.zip.ZIP, period.
I'm on Windows 10, using Bazel 0.16.1, Tensorflow 1.11, CUDA 9.2 and CUDNN 7.2.1.
My build command was:
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
Anyone have an idea what I could try or check to get the pip package to build?
Here is an open issue with workaround. https://github.com/tensorflow/tensorflow/issues/20332
Edit the following file to remove all the lines with ".zip".
bazel-out/x64_windows-opt/bin/tensorflow/tools/pip_package/simple_console_for_windows.zip-0.params
Run the following command line to generate the required zip file, which is about 107 MB in my case. The verbose option will list all the files.
external\bazel_tools\tools\zip\zipper\zipper.exe vcC bazel-out/x64_windows-opt/bin/tensorflow/tools/pip_package/simple_console_for_windows.zip #bazel-out/x64_windows-opt/bin/tensorflow/tools/pip_package/simple_console_for_windows.zip-0.params
Now the original pip build command will build a whl.
This is a known issue, and unfortunately its root cause is https://github.com/tensorflow/tensorflow/issues/22390
TF is a big codebase, and when the size of the zip file exceeds 2 GBs, bazel's zipping tools break because they only use zip32.
The ultimate solutions are to contribute a fix to bazel to use zip64, and TensorFlow to lose some weight, the package has grown substantially lately.
However, bazel team was able to give us a workaround.
Only when building the pip package, you should add --define=no_tensorflow_py_deps=true to your bazel command. You will still not be able to build a debug binary, but at least you will be able to build a release binary.

How to load Spatialite SQLite extension on macOS

I am attempting to load the libspatialite extension in SQLite. As per the installation guide, I downloaded the latest libspatialite and moved the included libspatialite.1.1.3.dylib file to /usr/local/lib.
greg /usr/local/lib $ls | grep libspatialite
libspatialite.1.1.3.dylib
However, I was unable to load the extension.
sql> SELECT load_extension('libspatialite.1.1.3.dylib')
[2017-09-19 10:45:25] [1] [SQLITE_ERROR] SQL error or missing database (dlopen(libspatialite.1.1.3.dylib.dylib, 10): image not found)
I also tried storing libspatialite.1.1.3.dylib.dylib in the same directory as the sqlite file with no luck.
I have confirmed that enable_load_extension is true and I'm using DataGrip as my IDE. I have also quit DataGrip and rebooted to ensure any new binaries are collected. Am I missing something obvious?
As per this homebrew formula for libspatialite:
New SQLite3 extension won't load via SELECT load_extension("mod_spatialite"); unless named mod_spatialite.dylib (should actually be mod_spatialite.bundle). See: https://groups.google.com/forum/#!topic/spatialite-users/EqJAB8FYRdI
So, if installing manually, you gonna need to rename the dynamic library file as per suggested. Or you can let Homebrew do the installation for you:
brew install libspatialite

Including date and time in Tex File

The latex file is giving the following error:
! LaTeX Error: File `datetime.sty' not found.
Here is the Latex code: \usepackage{datetime}
Am I missing something?
I am using Debian 3.1 Linux Machine.
I don't use Debian myself, but if I look it up, Debian contains it in the package 'texlive-latex-extra'. If you installed LaTeX via the packet-manager of debian (I think so) the command 'apt-get install texlive-latex-extra' executed as root should install you the needed file. Alternatively you can use a graphical package-manager to install the package.
If your LaTeX Distribution does not load the package automatically, you can try to install it manually according to the readme file here: http://www.ctan.org/pub/tex-archive/macros/latex/contrib/datetime/ Edit: http://www.ctan.org/pkg/datetime
Yes, you are missing the datetime.sty file; you are probably missing the whole package too. What system are you using for managing your (La)TeX installation ? If you tell us you may get more specific advice than I can give.
You need to get the datetime package from CTAN or one of its mirrors and install it into your local texmf tree. Your LaTeX manager will do this for you. You may also be able to configure your LaTeX manager to automatically download and install packages the first time they are requested.

Resources