Commit d295c2b6 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Mercurial/Rust: fallbacking to setup.py install

Actually, `pip --target` has the effect of not providing
the main executable, whereas `--install-lib` makes a better
distinction. It still has to be supplemented with
`--prefix=/usr/local`, otherwise the resulting `hg` would
still be in `/usr/bin`, which is not expected by users of
this image (and a discrepancy with builds without Rust,
that could work with a simple `pip install Mercurial`).

I'm getty too old for this…
parent 0b756655603b
Pipeline #45888 passed with stages
in 6 minutes and 34 seconds
......@@ -10,10 +10,14 @@
build-essential \
python3-dev \
&& \
pip3 install --no-cache-dir \
--no-use-pep517 --global-option --rust \
--target /usr/local/lib/python3.9/dist-packages/ \
Mercurial==${HG_VERSION} \
mkdir /root/tarballs && cd /root/tarballs && \
pip3 download Mercurial==${HG_VERSION} && \
tar xf mercurial-${HG_VERSION}.tar.gz && \
cd mercurial-${HG_VERSION} && \
python3 setup.py \
--rust install \
--install-lib /usr/local/lib/python`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"`/dist-packages/ \
--prefix /usr/local \
&& \
pip3 install --no-cache-dir hg-evolve && \
pip3 install --no-cache-dir -r /root/requirements.txt && \
......@@ -17,6 +21,7 @@
&& \
pip3 install --no-cache-dir hg-evolve && \
pip3 install --no-cache-dir -r /root/requirements.txt && \
hg debuginstall && \
apt-get remove -y build-essential python3-dev && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
......@@ -20,5 +25,6 @@
apt-get remove -y build-essential python3-dev && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /root/tarballs && \
apt-get clean
......@@ -22,10 +22,12 @@
build-essential \
python3-dev \
&& \
pip3 install --no-cache-dir \
--no-use-pep517 --global-option --rust \
--target /usr/local/lib/python`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"`/dist-packages/ \
/root/tarballs/mercurial.tar \
tar -C /root/tarballs -xf /root/tarballs/mercurial.tar && \
cd /root/tarballs/mercurial && \
python3 setup.py \
--rust install \
--install-lib /usr/local/lib/python`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"`/dist-packages/ \
--prefix /usr/local \
&& \
pip3 install --no-cache-dir /root/tarballs/evolve.tar && \
pip3 install -r /root/requirements.txt && \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment