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

builders: Added escape of 'env' parameter #83

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

Mishytca
Copy link

There is an issue with passing the "EXT_MODULES" parameter from the configuration moulin yaml file to the build.sh context.

The 'android_kernel' builder didn't escape double quotes, while wrapping the 'env' parameter in additional double quotes like this:

bash -c "...env..."

As a result, an incorrect syntax was generated in the build.ninja file.

To generate a functional build.ninja file, it was necessary to take this aspect into account in the moulin.yaml file and add additional escaping there.

This approach is ambiguous since it requires the user to know the implementation details of each moulin builder.

To address this issue, a simple escape function was added to all builders that support the 'env' parameter. It escapes double quotes to ensure proper handling of the 'env' variable.

The issue has been resolved for the following builders:

  • android_kernel builder
  • android builder
  • zephyr builder

@svlad-90
Copy link

svlad-90 commented Oct 20, 2023

Hi, @lorc, could you, please, have a look?

moulin/builders/escape.py Outdated Show resolved Hide resolved
moulin/builders/escape.py Outdated Show resolved Hide resolved
@Mishytca Mishytca marked this pull request as draft October 24, 2023 08:12
@Mishytca Mishytca marked this pull request as ready for review October 24, 2023 08:48
moulin/builders/android_kernel.py Outdated Show resolved Hide resolved
moulin/build_conf.py Outdated Show resolved Hide resolved
moulin/build_conf.py Outdated Show resolved Hide resolved
moulin/builders/escape.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@lorc lorc left a comment

Choose a reason for hiding this comment

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

Thank you
Reviewed-by: Volodymyr Babchuk <[email protected]>

Mykhailo Androsiuk added 2 commits October 25, 2023 17:58
There is an issue with passing the "EXT_MODULES" parameter from the
configuration moulin yaml file to the build.sh context.

The 'android_kernel' builder didn't escape double quotes, while
wrapping the 'env' parameter in additional double quotes like this:

bash -c "...env..."

As a result, an incorrect syntax was generated in the build.ninja file.

To generate a functional build.ninja file, it was necessary to take
this aspect into account in the moulin.yaml file and add additional
escaping there.

This approach is ambiguous since it requires the user to know the
implementation details of each moulin builder.

To address this issue, a simple escape function was added to all
builders that support the 'env' parameter. It escapes double quotes to
ensure proper handling of the 'env' variable.

The issue has been resolved for the following builders:
- android_kernel builder
- android builder
- zephyr builder

Signed-off-by: Mykhailo Androsiuk <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
The existing source code has failed to pass the Flake8 check in
build_conf.py:
Do not compare types, use 'isinstance()' (E721)

That blocks merge of the other changes. This patch is intended to fix
the above-mentioned lint warning.

Signed-off-by: Mykhailo Androsiuk <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
@lorc lorc merged commit e4ce12e into xen-troops:main Oct 25, 2023
1 check passed
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.

3 participants