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

Fix error with stdout and stderr together in shell command when running git_date update #3480

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

frederikdyrmose
Copy link

@frederikdyrmose frederikdyrmose commented Oct 22, 2023

When compiling from source on aarch64 I encounter an error regarding converting git_date to UTC time due to the inclusion of stderr in stdout:

20.77   Preparing metadata (pyproject.toml): finished with status 'error'
20.84   error: subprocess-exited-with-error
20.84
20.84   × Preparing metadata (pyproject.toml) did not run successfully.
20.84   │ exit code: 1
20.84   ╰─> [15 lines of output]
20.84       Traceback (most recent call last):
20.84         File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
20.84           main()
20.84         File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
20.84           json_out['return_val'] = hook(**hook_input['kwargs'])
20.84                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20.84         File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
20.84           whl_basename = backend.build_wheel(metadata_directory, config_settings)
20.84                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20.84         File "/tmp/pip-req-build-561biiaw/ci/ext.py", line 491, in generate_build_info
20.84           time.gmtime(int(git_date)))
20.84                       ^^^^^^^^^^^^^
20.84       ValueError: invalid literal for int() with base 10: "12:14:19.175267 git.c:460               trace: built-in: git show -s '--format=%ct' HEAD\n1685547898"
20.84       [end of output]
20.84
20.84   note: This error originates from a subprocess, and is likely not a problem with pip.
20.86 error: metadata-generation-failed
20.86
20.86 × Encountered error while generating package metadata.
20.86 ╰─> See above for output.
20.86
20.86 note: This is an issue with the package mentioned above, not pip.
20.86 hint: See above for details.

This error is fixed by not mixing stdout and stderr in the shell_cmd function. I updated the function, and now it compiles without any problems on linux aarch64, linux x86_64 and windows x86_64 when testing locally.

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.

1 participant