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

run --inherit-environ option does not work #139

Open
cappadokes opened this issue Feb 24, 2022 · 2 comments
Open

run --inherit-environ option does not work #139

cappadokes opened this issue Feb 24, 2022 · 2 comments

Comments

@cappadokes
Copy link
Contributor

After a clean install of pyperformance, run the below command:

HAHA=1 pyperformance run -f --debug-single-value --inherit-environ HAHA -b 2to3

The output received is:

[...]
[1/1] 2to3...
INFO:root:Running `$PATH_TO_VENV$/bin/python -u /usr/local/lib/python3.8/dist-packages/pyperformance-1.0.4-py3.8.egg/pyperformance/data-files/benchmarks/bm_2to3/run_benchmark.py --debug-single-value --inherit-environ =,PYPERFORMANCE_RUNID --output /tmp/tmpiq530yv4`

As you can see, the HAHA variable is not inherited by the benchmark-running process. Instead, a '=' symbol is parsed in its place.

@cappadokes
Copy link
Contributor Author

Update:

I have found the problem to be line 256 in pyperformance/_benchmark.py. The line is part of the _resolve_restricted_opts function:

resolved.append(opt.partition('=')[-2]) 

Replacing -2 with -1 resolves the issue. I have created a relevant pull request (#140).

@agraul
Copy link

agraul commented Mar 10, 2022

I had the same problem and came up with the same fix. I can confirm it that this works.

agraul added a commit to agraul/python-benchmarks that referenced this issue Mar 10, 2022
Specified environ variables aren't passed through correctly. We need to
pass LD_LIBRARY_PATH to use the correct libpython from venv-salt-bundle.

Tracked upstream in python/pyperformance#139
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

No branches or pull requests

2 participants