[v3] elf: Don't remove the initial 'env' command
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
redhat-pt-bot/TryBot-32bit |
success
|
Build for i686
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
fail
|
Patch failed to apply
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
fail
|
Patch failed to apply
|
Commit Message
tst-rtld-list-diagnostics.py is called by
"$(test-wrapper-env) $(objpfx)$(rtld-installed-name) --list-diagnostics"
and $(test-wrapper-env) is set to "$(test-wrapper) env". When there is
a test wrapper, it is incorrect to use:
# Remove the initial 'env' command.
parse_diagnostics(opts.command.split()[1:])
to remove 'env' and there is no need to remove 'env'. Don't remove 'env'
and pass shell=True to run. This fixes [BZ #31357].
---
elf/tst-rtld-list-diagnostics.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
* H. J. Lu:
> tst-rtld-list-diagnostics.py is called by
>
> "$(test-wrapper-env) $(objpfx)$(rtld-installed-name) --list-diagnostics"
>
> and $(test-wrapper-env) is set to "$(test-wrapper) env". When there is
> a test wrapper, it is incorrect to use:
>
> # Remove the initial 'env' command.
> parse_diagnostics(opts.command.split()[1:])
>
> to remove 'env' and there is no need to remove 'env'. Don't remove 'env'
> and pass shell=True to run. This fixes [BZ #31357].
> ---
> elf/tst-rtld-list-diagnostics.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/elf/tst-rtld-list-diagnostics.py b/elf/tst-rtld-list-diagnostics.py
> index 9e70e74bf8..5e05ebc05c 100644
> --- a/elf/tst-rtld-list-diagnostics.py
> +++ b/elf/tst-rtld-list-diagnostics.py
> @@ -33,7 +33,8 @@ except:
> self.stdout = stdout
> self.stderr = stderr
>
> - def _run(*popenargs, input=None, timeout=None, check=False, **kwargs):
> + def _run(*popenargs, input=None, timeout=None, check=False, shell=True,
> + **kwargs):
> assert(timeout is None)
> with subprocess.Popen(*popenargs, **kwargs) as process:
> try:
I think you need to change the subprocess.run call further down below.
> @@ -293,8 +294,7 @@ def main(argv):
> if opts.manual:
> check_consistency_with_manual(opts.manual)
>
> - # Remove the initial 'env' command.
> - parse_diagnostics(opts.command.split()[1:])
> + parse_diagnostics(opts.command.split()[:])
I would expect
+ parse_diagnostics(opts.command)
here because we pass the whole thing to the shell as a string.
Thanks,
Florian
@@ -33,7 +33,8 @@ except:
self.stdout = stdout
self.stderr = stderr
- def _run(*popenargs, input=None, timeout=None, check=False, **kwargs):
+ def _run(*popenargs, input=None, timeout=None, check=False, shell=True,
+ **kwargs):
assert(timeout is None)
with subprocess.Popen(*popenargs, **kwargs) as process:
try:
@@ -293,8 +294,7 @@ def main(argv):
if opts.manual:
check_consistency_with_manual(opts.manual)
- # Remove the initial 'env' command.
- parse_diagnostics(opts.command.split()[1:])
+ parse_diagnostics(opts.command.split()[:])
if errors:
sys.exit(1)