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

Fix executable as script on Windows #8259

Merged
merged 1 commit into from
Jan 30, 2021

Conversation

xclaesse
Copy link
Member

On Windows this would fail because of missing DLL:

mylib = library(...)
exe = executable(..., link_with: mylib)
meson.add_install_script(exe)

The reason is on Windows we cannot rely on rpath to find libraries from
build directory, they are searched in $PATH. We already have all that
mechanism in place for custom_target() using ExecutableSerialisation
class, so reuse it for install/dist/postconf scripts too.

This has bonus side effect to also use exe_wrapper for those scripts.

Fixes: #8187

@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request introduces 2 alerts when merging f63177c into 0f5a136 - view on LGTM.com

new alerts:

  • 1 for Unused local variable
  • 1 for Unused import

@tp-m tp-m added the OS:windows Winodows OS specific issues label Jan 26, 2021
@lgtm-com
Copy link

lgtm-com bot commented Jan 26, 2021

This pull request introduces 1 alert when merging 469bec1 into 0f5a136 - view on LGTM.com

new alerts:

  • 1 for Unused import

@xclaesse xclaesse force-pushed the exe-serialisation branch 2 times, most recently from d2773f5 to f2cf8b6 Compare January 27, 2021 00:10
@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2021

This pull request introduces 1 alert when merging f2cf8b6 into 9d602e6 - view on LGTM.com

new alerts:

  • 1 for Unused import

@xclaesse xclaesse force-pushed the exe-serialisation branch 10 times, most recently from 1cd1172 to b240f55 Compare January 27, 2021 20:14
On Windows this would fail because of missing DLL:
```
mylib = library(...)
exe = executable(..., link_with: mylib)
meson.add_install_script(exe)
```

The reason is on Windows we cannot rely on rpath to find libraries from
build directory, they are searched in $PATH. We already have all that
mechanism in place for custom_target() using ExecutableSerialisation
class, so reuse it for install/dist/postconf scripts too.

This has bonus side effect to also use exe_wrapper for those scripts.

Fixes: mesonbuild#8187
@xclaesse
Copy link
Member Author

Failing CI seems unrelated, I think it's ready for review.

@jpakkane jpakkane merged commit 0626465 into mesonbuild:master Jan 30, 2021
@xclaesse xclaesse deleted the exe-serialisation branch October 20, 2021 14:44
bruchar1 added a commit to bruchar1/meson that referenced this pull request Feb 9, 2023
\mesonbuild#8259 induced a regression, causing Meson 0.57.0 and upward to
stop printing outputs of source scripts.
This makes _find_source_scripts() mark executables as verbose
in meson_exe.
bruchar1 added a commit to bruchar1/meson that referenced this pull request Feb 9, 2023
 mesonbuild#8259 induced a regression, causing Meson 0.57.0 and upward to
stop printing outputs of scripts added using `meson.add_*_script()`.
This makes _find_source_scripts() mark executables as verbose
in meson_exe.
eli-schwartz pushed a commit that referenced this pull request Feb 13, 2023
 #8259 induced a regression, causing Meson 0.57.0 and upward to
stop printing outputs of scripts added using `meson.add_*_script()`.
This makes _find_source_scripts() mark executables as verbose
in meson_exe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS:windows Winodows OS specific issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executables with DLL deps passed to add_install_script() can't run on Windows
3 participants