What is the tag for menhir for coq 8.12 when installing it with opam install -y? - coq

I want to install opam menhir but make the install explicit for coq 8.12 to make my script explicit + robust to installation.
But when I ask it to show me it show the dev tag, which I assume might change at any point and make the install brittle. The project is hosted in gitlab and it doesn't seem it lets me make a git issue here so asking here. From the available options is dev actually robust/stable? I don't want future installs to break:
(iit_synthesis) brando9~ $ opam install -y menhir
[NOTE] Package menhir is already installed (current version is dev).
(iit_synthesis) brando9~ $
(iit_synthesis) brando9~ $ opam show menhir
<><> menhir: information on all versions ><><><><><><><><><><><><><><><><><><><>
name menhir
all-installed-versions 20190626 [coq-8.10] dev [coq-8.12]
all-versions 20120123 20130116 20130911 20140422 20141215 20150914 20150921 20151005 20151012 20151023 20151026 20151030
20151103 20151112 20160303 20160504 20160526 20160808 20160825 20161114 20161115 20170101 20170418 20170509
20170607 20170712 20171013 20171206 20171222 20180528 20180530 20180703 20180905 20181006 20181026 20181113
20190613 20190620 20190626 20190924 20200123 20200211 20200525 20200612 20200619 20200624 20201122 20201201
20201214 20201216 20210310 20210419 20210929 20211012 20211125 20211128 20211230 20220210 dev
<><> Version-specific details <><><><><><><><><><><><><><><><><><><><><><><><><>
version dev
repository coq-extra-dev
source-hash 98f5c17e
url.src "git+https://gitlab.inria.fr/fpottier/menhir.git#master"
homepage "http://gitlab.inria.fr/fpottier/menhir"
bug-reports "menhir#inria.fr"
dev-repo "git+https://gitlab.inria.fr/fpottier/menhir.git"
authors "François Pottier <francois.pottier#inria.fr>"
"Yann Régis-Gianas <yrg#pps.univ-paris-diderot.fr>"
maintainer "francois.pottier#inria.fr"
depends "ocaml" {>= "4.02.3"}
"dune" {>= "2.2.0"}
"menhirLib" {= version}
"menhirSdk" {= version}
synopsis An LR(1) parser generator
cross: https://coq.discourse.group/t/what-is-the-tag-for-menhir-for-coq-8-12-when-instlaling-it-with-opam-install-y/1889

source: https://coq.discourse.group/t/what-is-the-tag-for-menhir-for-coq-8-12-when-installing-it-with-opam-install-y/1889/3?u=brando90
Answer emilio gave:
Coq 8.12 was mostly tested with menhir 20190626 , you can see this in the Docker file:
github.com
coq/coq/blob/v8.12/dev/ci/docker/bionic_coq/Dockerfile
# CACHEKEY: "bionic_coq-v8.12-V2020-10-12-V1"
# ^^ Update when modifying this file.
FROM ubuntu:bionic
LABEL maintainer="e#x80.org"
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update -qq && apt-get install --no-install-recommends -y -qq \
# Dependencies of the image, the test-suite and external projects
m4 automake autoconf time wget rsync git gcc-multilib build-essential unzip jq \
# Dependencies of lablgtk (for CoqIDE)
libgtksourceview-3.0-dev \
# Dependencies of stdlib and sphinx doc
texlive-latex-extra texlive-fonts-recommended texlive-xetex latexmk \
python3-pip python3-setuptools python3-pexpect python3-bs4 fonts-freefont-otf \
# Dependencies of source-doc and coq-makefile
texlive-science tipa
# More dependencies of the sphinx doc
This file has been truncated. show original
So that version is a good bet, but as Paolo points out, it depends on what menhir user you are interested in.
thus command I ran:
# dev seems fine but scary to use dev tag: question for alternative: https://stackoverflow.com/questions/75465305/what-is-the-tag-for-menhir-for-coq-8-12-when-installing-it-with-opam-install-y
#opam install -y menhir
opam pin add -y menhir 20190626
# run bellow in case above break when using the intended coq switch
#opam install -y menhir=dev
output successful:
(metalearning_gpu) brando9~/proverbot9001/deps/StructTact $ opam install -y menhir 20190626
opam: PACKAGES... arguments: Package name "20190626" should contain at least
one letter
Usage: opam install [OPTION]... [PACKAGES]...
Try `opam install --help' or `opam --help' for more information.
(metalearning_gpu) brando9~/proverbot9001/deps/StructTact $ opam pin add -y menhir 20190626
menhir is now pinned to version 20190626
The following actions will be performed:
⊘ remove menhirLib dev [conflicts with menhir]
⊘ remove menhirSdk dev [conflicts with menhir]
↘ downgrade menhir dev to 20190626*
===== ↘ 1 ⊘ 2 =====
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⊘ removed menhir.dev
⊘ removed menhirLib.dev
⊘ removed menhirSdk.dev
⬇ retrieved menhir.20190626 (cached)
∗ installed menhir.20190626
Done.
# Run eval $(opam env) to update the current shell environment
(metalearning_gpu) brando9~/proverbot9001/deps/StructTact $
(metalearning_gpu) brando9~/proverbot9001/deps/StructTact $ eval $(opam env)

Related

How to update git version on RHEL?

I just created a fresh RHEL VM on GCP to play some Kubernetes on it.
It was not having any git installed on it.
I used yum package manager to install git on it, but it didn't installed the latest version of git.
Current Version: 2.38.0 / 3 October 2022
Version Installed by yum: 1.8.3.1
Create a file:
touch gitupgrade.sh
And add the following to it:
yum -y remove git
yum -y clean packages
mkdir tempgit
cd tempgit
yum install -y autoconf cpio curl-devel expat-devel gcc gettext-devel make openssl-devel perl-ExtUtils-MakeMaker zlib-devel
wget -O v2.24.1.tar.gz https://github.com/git/git/archive/v2.24.1.tar.gz
tar -xzvf ./v2.24.1.tar.gz
cd git-2.24.1/
make configure
./configure --prefix=/usr/local/git
make && make install
ln -sf /usr/local/git/bin/* /usr/bin/
cd ..
rm -fr git-2.24.1
cd ..
rm -fr tempgit
echo "results"
which git
git --version
The run it to upgrade:
sudo sh gitupgrade.sh
And that’s a wrap
Red Hat Enterprise Linux, Oracle Linux, CentOS, Scientific Linux, et al.
RHEL and derivatives typically ship older versions of git. You can download a tarball and build from source, or use a 3rd-party repository such as the IUS Community Project to obtain a more recent version of git.

Setting up a Movesense development environment on Linux

I followed an instruction to set up a Movesense development environment, "Manual setup on Linux", from Suunto / Movesense-community / Movesense-device-lib, README.md
However, I got stuck at sudo apt-get install gcc-arm-embedded:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-arm-embedded
How can I move forward?
I used Ubuntu 17.10 (Artful Aardvark) as a guest OS.
Try adding the repository:
sudo apt-get remove gcc-arm-none-eabi gdb-arm-none-eabi binutils-arm-none-eabi
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
I downloaded it directly from ARM IIRC:
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
Following the instructions under "GNU/Linux" in the "GNU ARM Embedded Toolchain" section of
https://gnu-mcu-eclipse.github.io/toolchain/arm/install/#gnu-arm-embedded-toolchain
Summarized:
// Get some support dependencies for 32 bit running on 64-bit machines
// Check toolchain README for actual list.
$ sudo apt-get -y install lib32z1 lib32ncurses5 lib32bz2-1.0
// Install the toolchain
$ mkdir -p "${HOME}"/opt
$ cd "${HOME}"/opt
$ tar xjf ~/Downloads/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
$ chmod -R -w "${HOME}"/opt/gcc-arm-none-eabi-7-2017-q4-major
You will likely have to modify some of the build files in the Movesense project to point to this location for it to build.
The following might also be helpful: How to install a functional ARM cross-GCC toolchain on Ubuntu 18.04 (Bionic Beaver)
I had some trouble installing it on a Windows machine and tried out Vagrant. This makes the development environment highly movable and in sync if you have multiple developers working on the project.

Can't install CURL on Ubuntu 18.4LTS (libcurl4 required) but installing it remove libcurl3 and thus mongo not working properly

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
You have to do some custom things in order to run mongodb 4.0 in ubuntu 18.10
sudo apt-get install libcurl3
locate libcurl3 file likely in /usr/lib/x86_64-linux-gnu/, make a LD_LIBRARY folder in home, copy the libcurl.so.4 there and rename to libcurl.so.3
mkdir ~/LD_LIBRARY
cp /usr/lib/x86_64-linux-gnu/libcurl.so.4 ~/LD_LIBRARY/
mv ~/LD_LIBRARY/libcurl.so.4 ~/LD_LIBRARY/libcurl.so.3
make a link of libcurl3 by:
cd ~/LD_LIBRARY
ln -s libcurl.so.3 libcurl.so.4
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/LD_LIBRARY/" >> ~/.bashrc
source ~/.bashrc
now start mongod it will run.
Also now you can install
sudo apt-get install libcurl4 php-curl
And use all the application require php-curl and libcurl4
Here is How I solve curl installation error:
First I install required version of libcurl4 on which curl depends:
sudo apt-get install curl
This command give error that
curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.8ppa2) but it is not going to be installed
I first install libcurl4 required version which in my case is libcurl4-7.58.0-2ubuntu3.8ppa2 note in your case it my differ:
sudo apt-get install libcurl4=7.58.0-2ubuntu3.8ppa2
After installation of libcurl4 I install curl which get installed and work fine:
sudo apt-get install curl

Docker base image for perl; E: Package 'libssl1.0.0' has no installation candidate

I have a dockerfile that uses perl:5.22 as the base image
When I do:
#Dockerfile:
From perl:5.22
RUN apt-get update && apt-get install libssl1.0.0 libssl-dev
I get this error:
When I do: sudo apt-cache policy libssl1.0.0 in the dockerfile, like this:
#Dockerfile:
From perl:5.22
RUN apt-cache policy libssl1.0.0 && \
apt-cache policy libssl-dev
RUN apt-get update && apt-get install libssl1.0.0
I get:
Step 2/3 : RUN apt-cache policy libssl1.0.0 && apt-cache policy
libssl-dev ---> Running in a60f0185ef5a libssl1.0.0:
Installed: (none)
Candidate: (none)
Version table:
libssl-dev:
Installed: 1.1.0f-3+deb9u2
Candidate: 1.1.0f-3+deb9u2
Version table:
*** 1.1.0f-3+deb9u2 500
500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
100 /var/lib/dpkg/status
1.1.0f-3+deb9u1 500
500 http://deb.debian.org/debian stretch/main amd64 Packages
There's no available candidate to install libssl1.0.0; I get:
E: Package 'libssl1.0.0' has no installation candidate
However there's a candidate to install the libssl-dev package, but none for the libssl1.0.0
I'm new with docker; does the perl 5.22 base image already come with libssl1.0.0 already preinstalled in the image? I couldn't see it in their base image and secondly, *how do I install this package (libssl1.0.0) in my dockerfile if there's no candidate available to install it*?
Lastly, since the base image already comes preinstalled with the libssl-dev could I use this package, libssl-dev, instead of the libssl1.0.0, is there a difference between libssl-dev and libssl1.0.0 ?
Actually, it is already installed by default.
$ docker run -it perl:5.22 /bin/bash
root#e5315bc25223:~# apt search libssl
Sorting... Done
Full Text Search... Done
libssl-dev/now 1.1.0f-3+deb9u2 amd64 [installed,local]
Secure Sockets Layer toolkit - development files
libssl1.0.0/now 1.0.1t-1+deb8u8 amd64 [installed,local]
Secure Sockets Layer toolkit - shared libraries
The perl image is based on debian:stretch, which no longer supports libssl1.0.0. You can pull the package from jessie (https://packages.debian.org/jessie/libssl1.0.0) and install with dpkg.
Sample Dockerfile addition:
RUN wget "http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u8_amd64.deb" \
&& dpkg -i libssl1.0.0_1.0.1t-1+deb8u8_amd64.deb
Regarding the version, apt show libssl-dev gives:
Package: libssl-dev
Version: 1.1.0f-3+deb9u2
As far as if you can use 1.1.0 instead of 1.0.0, that really depends on your software's requirements.

Docker file for building code cloned from git

I've cloned a copy of FreeCAD from github and I'm trying to create a docker file so that I can develop it locally on my machine.
The objectives being that:
I have a local copy of the code from git on my machine
I can make modifications to the code
I can build debug and release image (do I need to create two separate images?)
Have access to the code on my machine, so that I can use git for source control
This is the content of my Dockerfile:
# Get base image
FROM phusion/baseimage
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Get the build pre-requisites
RUN apt-get update
RUN apt-get install -y build-essential cmake python python-matplotlib libtool
RUN apt-get install -y libcoin80-dev libsoqt4-dev
RUN apt-get install -y libxerces-c-dev libboost-dev libboost-filesystem-dev
RUN apt-get install -y libboost-regex-dev
RUN apt-get install -y libboost-program-options-dev libboost-signals-dev
RUN apt-get install -y libboost-thread-dev libboost-python-dev libqt4-dev
RUN apt-get install -y libqt4-opengl-dev qt4-dev-tools python-dev
RUN apt-get install -y python-pyside pyside-tools
RUN apt-get install -y liboce*-dev oce-draw
RUN apt-get install -y libeigen3-dev libqtwebkit-dev libshiboken-dev
RUN apt-get install -y libpyside-dev libode-dev swig libzipios++-dev
RUN apt-get install -y libfreetype6 libfreetype6-dev
# to make Coin to support additional image file formats
RUN apt-get install -y libsimage-dev
# to register your installed files into your system's package manager, so yo can easily uninstall later
RUN apt-get install -y checkinstall
# needed for the 2D Drafting module
RUN apt-get install -y python-qt4 python-pivy
# doxygen and libcoin80-doc (if you intend to generate source code documentation)
RUN apt-get install -y doxygen libcoin80-doc
# libspnav-dev (for 3Dconnexion devices support like the Space Navigator or Space Pilot)
RUN apt-get install -y libspnav-dev
# CMAke related issue for compiling on Ubuntu Xenial: http://forum.freecadweb.org/viewtopic.php?f=4&t=16292
RUN apt-get install -y libmedc-dev
RUN apt-get install -y libvtk6-dev
RUN apt-get install -y libproj-dev
# Get git
RUN apt-get install -y git
RUN git clone https://github.com/FreeCAD/FreeCAD.git freecad
RUN cd freecad
RUN mkdir freecad-debug
RUN cd freecad-debug
# command below is just a diagnostic to let me know wth I am (output is: /)
# RUN pwd
RUN cmake ../ -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Debug .
#cmake -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Release .
RUN make
I attempt to build the image using the following command:
docker build -tag freeCAD-my-fork .
Everything works until I get to the first cmake invocation. I then get the following error:
CMake Error: The source directory "/" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
The command '/bin/sh -c cmake ../ -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Debug .' returned a non-zero code: 1
I placed a RUN pwd in my Dockerfile, so I could find where the cmake command was being run from, and I was surprised to find that it was been run from the root directory.
I thought the issue was being caused by my use of relative and that it would be fixed by absolute paths - however specifying /path/to/my/copy/freecad when cloning etc, the issue remains.
How can I write my Dockerfile so that it achieves the objectives outlined above (stated at the beginning of my question)?
Default WORKDIR in docker is "/".All docker commands will be executed in that directory.There are two option either you change WORKDIR(https://docs.docker.com/engine/reference/builder/#workdir) or execute everything in one layer(In one RUN command).I have taken second approach.
Cloning and Building source code both executed in One layer of docker.
RUN git clone https://github.com/FreeCAD/FreeCAD.git freecad \
&& cd freecad \
&& mkdir freecad-debug \
&& cd freecad-debug \
&& cmake ../ -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Debug . \
&& make
You should install all your dependencies using run as you do but the actual building and copying of source code files should not happen when you build your image but when you run a container.
This way you can reuse your image for as many builds as you like.
Write a script with the build commands and copy it over to your image. Then in the CMD part of the dockerfile run that script.
To share the git project with the container you can mount your local files with docker run -v hostpath:containerpath imagename. That way any files in hostpath will be visible to the container at containerpath and vice versa. Alternatively you could also git clone from the script which is invoked by CMD but then you have to expose the build somehow to your host (some mounted volume again).