opam icon indicating copy to clipboard operation
opam copied to clipboard

./configure --bindir option is not respected

Open ccxcz opened this issue 2 months ago • 2 comments

Installing opam-full from source puts binaries into $prefix/bin instead of the provided $bindir.

When building opam-full-2.4.1 I configured it with following options:

+ ./configure '--prefix=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a' \
    --libdir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/library.ocaml' \
    --bindir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/command' \
    --sbindir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/command' \
    --mandir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/man' \
    --docdir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/doc/opam' \
    --datadir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/data' \
    --datarootdir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/data' \
    --infodir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/info' \
    --localedir=/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/locale' \
    --localstatedir=/var/pthbs' \
    --with-dune=/home/ccx/versions/dune.0bf1fa603f0e8ae0f1b4fd7e28d8be34f035e643e5594e0a380ce13485b06a6c/command/dune' \
    --with-mccs \
    --with-vendored-deps \
    --enable-static

And then installed with make 'DESTDIR=/home/ccx/git/mrrl/work/builddir.3156738/destdir' install which produced following output:

./opam-installer --prefix "/home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a" --mandir "/home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/man" processed-opam.install
Creating directory /home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/bin
_build/install/default/bin/opam  => /home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/bin/opam
Creating directory /home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/man/man1
...
_build/install/default/man/man1/opam.1 => /home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/man/man1/opam.1
./opam-installer --prefix "/home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a" --mandir "/home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/man" processed-opam-installer.install
_build/install/default/bin/opam-installer => /home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/bin/opam-installer
_build/install/default/man/man1/opam-installer.1 => /home/ccx/git/mrrl/work/builddir.3156738/destdir/home/ccx/versions/opam.3df4741f0b1229a4304e20cb571acf8439c5e1de51fa2a40423488b3bc07d39a/man/man1/opam-installer.1

Looking at the opam-installer manpage I see no option corresponding to --bindir in configure that would instruct it to put the executables in the correct place.

ccxcz avatar Oct 28 '25 12:10 ccxcz

Indeed, the only propagated directories are : prefix, mandir, libdir, docdir. And opam-installer doesn't (ftm) handle some user configured paths. We'll discuss that topic and see how to update it.

rjbou avatar Oct 28 '25 16:10 rjbou

Discussed in 03-11-2025 meeting: it seems that there is no reason (other than historically not done). Good to go to add all paths configured via cli.

rjbou avatar Nov 10 '25 18:11 rjbou