Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dry run install of symlink errors, real install succeeds #13941

Open
guijan opened this issue Nov 22, 2024 · 0 comments
Open

dry run install of symlink errors, real install succeeds #13941

guijan opened this issue Nov 22, 2024 · 0 comments

Comments

@guijan
Copy link
Contributor

guijan commented Nov 22, 2024

If a meson.build tries to install a symlink to another file installed by Meson, then meson install --dry-run -C build errors because the pointed-to file doesn't exist, while meson install -C build succeeds because the pointed-to file exists.

I've prepared a test Meson project:
meson-dry-run.zip

The contents of the test project are as follows:
meson-dry-run/hello.c

#include <stdio.h>

int
main(void)
{
	puts("Hello, world!");
}

meson-dry-run/meson.build

project('meson-dry-run', 'c',
  version : '0.1',
  default_options : ['warning_level=3'])

hw = executable('hello-world',
                'hello.c',
                install : true)

install_symlink('hello-world-link',
                install_dir : get_option('bindir'),
                pointing_to : hw.name())

Here's a failing dry run:

$ meson install --dry-run -C build
ninja: Entering directory `/tmp/fun/meson-dry-run/build'
[2/2] Linking target hello-world
Installing hello-world to /usr/local/bin

ERROR: Tried to install symlink to missing file /usr/local/bin/hello-world

And a succeeding real install:

$ doas meson install -C build
Dropping privileges to 'jan' before running ninja...
ninja: Entering directory `/tmp/fun/meson-dry-run/build'
ninja: no work to do.
Installing hello-world to /usr/local/bin
Installing symlink pointing to hello-world to /usr/local/bin/hello-world-link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant