mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.35k stars 1.53k forks source link

install_symlink pointing_to does not observe prefix #13220

Open nils-werner opened 1 month ago

nils-werner commented 1 month ago

Describe the bug

If I pass in something like get_option('bindir') into install_symlinks pointing_to, the resulting path does not include prefix, and comes up with a different path than all the other install_dir instances anywhere else in my builds:

project(
    'test',
    'cpp',
    meson_version : '>=0.61.0',
)

install_data(
    'datafile',
    install_dir : get_option('datadir'),               # $DESTDIR/usr/local/share/
)

install_symlink(
    'datafile2',
    install_dir : '/',
    pointing_to : get_option('datadir') / 'datafile'   # $DESTDIR/share/datafile
)

Plus, it fails due to a "missing file" error.

I can do a workaround using

install_data(
    'datafile',
    install_dir : get_option('datadir'),
)

install_symlink(
    'datafile2',
    install_dir : '/',
    pointing_to : get_option('prefix') / get_option('datadir') / 'datafile'
)

but I don't think I should have to.

To Reproduce Try the example from above

Expected behavior

I'd expect that pointing_to should observe prefix like all other install_dirs do.

system parameters