You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using wrap file for a nested subproject, and a non-default setting for subprojects_dir (subprojects_dir != 'subprojects'), unexpected failure occurs when calling subproject related command (e.g: meson subprojects purge). The error is as follows:
❯ meson subprojects purge --confirm
ERROR: wrap-redirect filename must be in the form foo/subprojects/bar.wrap
This is due to mesonbuild/wrap/wrap.py::199, which contains a hard-coded check for the subproject directory name:
ifp!='subprojects':
raiseWrapException('wrap-redirect filename must be in the form foo/subprojects/bar.wrap')
To Reproduce
The following project structure & content files is sufficient to reproduce the error: foo.zip
Applying the following patch to mesonbuild/wrap/wrap.py will allow the command to work as expected. However, please keep in mind that thorough testing was not performed to confirm there are no side-effects. This patch was intended to mitigate the immediate issue.
# mesonbuild_wrap.py.patch199,200c199,201< if p != 'subprojects':< raise WrapException('wrap-redirect filename must be in the form foo/subprojects/bar.wrap')---> subprojects_dir_name = os.path.basename(subprojects_dir)> if p != subprojects_dir_name:> raise WrapException(f'wrap-redirect filename must be in the form foo/{subprojects_dir_name}/bar.wrap')
After applying the patch, the command works as expected.
Expected behavior
The following error should only occur if the subprojects_dir name does not match what it was configured to. If subprojects_dir is not the default value 'subprojects' it does not seem appropriate to check the subprojects directory name against the default value.
❯ meson subprojects purge --confirm
ERROR: wrap-redirect filename must be in the form foo/subprojects/bar.wrap
system parameters
Native Build
Ubuntu 24.04
Python 3.12 (virtualenv)
Meson 1.6.1
Ninja 1.11.1
The text was updated successfully, but these errors were encountered:
Describe the bug
When using wrap file for a nested subproject, and a non-default setting for subprojects_dir (subprojects_dir != 'subprojects'), unexpected failure occurs when calling subproject related command (e.g: meson subprojects purge). The error is as follows:
❯ meson subprojects purge --confirm ERROR: wrap-redirect filename must be in the form foo/subprojects/bar.wrap
This is due to mesonbuild/wrap/wrap.py::199, which contains a hard-coded check for the subproject directory name:
To Reproduce
The following project structure & content files is sufficient to reproduce the error:
foo.zip
Project Structure:
File Contents:
Commands:
Workaround:
Applying the following patch to mesonbuild/wrap/wrap.py will allow the command to work as expected. However, please keep in mind that thorough testing was not performed to confirm there are no side-effects. This patch was intended to mitigate the immediate issue.
patch $(dirname $(python -c "import mesonbuild; print(mesonbuild.__file__)"))/wrap/wrap.py mesonbuild_wrap.py.patch meson subprojects purge --confirm
After applying the patch, the command works as expected.
Expected behavior
The following error should only occur if the subprojects_dir name does not match what it was configured to. If subprojects_dir is not the default value 'subprojects' it does not seem appropriate to check the subprojects directory name against the default value.
❯ meson subprojects purge --confirm ERROR: wrap-redirect filename must be in the form foo/subprojects/bar.wrap
system parameters
The text was updated successfully, but these errors were encountered: