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

If invalid value given to clone-recursive, raise exception #13839

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andy5995
Copy link
Contributor

Fixes #13821 but perhaps a separate ticket should be opened for a related bug, or maybe some extra docs are needed. Note in the ticket I mentioned three things I had to do to get it working as expected after the failures.

@@ -310,7 +310,7 @@ files get exported.
To enable this, the following needs to be added to the `.wrap` file:

```ini
clone-recursive=true
clone-recursive = true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, I added a space on both sides of the = sign (to match the examples on the wrap manual page).

@andy5995 andy5995 marked this pull request as draft October 30, 2024 16:34
@andy5995 andy5995 marked this pull request as ready for review October 30, 2024 16:50
@andy5995 andy5995 changed the title docs: note required value for clone-recursive in wrap If invalid value given to clone-recursive, raise exception Oct 30, 2024
mesonbuild/wrap/wrap.py Outdated Show resolved Hide resolved
Fixes mesonbuild#13821 but perhaps a separate ticket should be opened for a
related bug, or maybe some extra docs are needed. Note in the ticket I
mentioned three things I had to do to get it working as expected after
the failures.
@@ -600,6 +600,9 @@ def _get_git(self, packagename: str) -> None:
if self.wrap.values.get('depth', '') != '':
is_shallow = True
depth_option = ['--depth', self.wrap.values.get('depth')]
clone_recursive_val = self.wrap.values.get('clone-recursive', '').lower()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing this earlier in the function is an improvement. Now if there's an invalid value in the wrap file, meson will error out sooner. When the value is corrected, meson will clone the repository and the submodules.

Previously, after a failed attempt, meson would make no attempt to clone the submodules even after the value was corrected in the wrap file.

There is still a parser error if no value is provided to clone-recursive, which is the desired behavior. An exception will be raised if a value is given other than 'true' or 'false'. If 'clone-recursive' is not included in the wrap file at all, 'false' will be assumed.

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

Successfully merging this pull request may close these issues.

Wrap does not clone submodules even after specifying clone-recursive = 1
3 participants