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

Install Python3 explicitly #9507

Merged
merged 4 commits into from
Feb 6, 2023
Merged

Install Python3 explicitly #9507

merged 4 commits into from
Feb 6, 2023

Conversation

mihaimaruseac
Copy link
Member

The issue in #8915 is that the environment no longer has a leftover python3 binary in /bin/python3. This uncovers a bug in the upb and jwt-verify-lib Dockerfiles where python2 was installed (or no Python was installed).

The issue seems to show up on Bazel projects only due to the way Bazel executes commands: it uses env - to run them in a clear environment, meaning that even $PATH is altered. Before bc02fd0 the issues in the Dockerfiles were hidden by the fact that the environment contained multiple versions of Python and one happened to be matched by this search path.

This fixes #8915, reverting #8914 and #8909 tweaks to #8915. I did not do a similar thing for #8930 as maybe that can be fixed by changing the base python image?

Tested: Tested that I can build the upb fuzzers with this change.

Signed-off-by: Mihai Maruseac mihaimaruseac@google.com

The issue in #8915 is that the environment no longer has a leftover
`python3` binary in `/bin/python3`. This uncovers a bug in the `upb` and
`jwt-verify-lib` Dockerfiles where `python2` was installed (or no Python
was installed).

The issue seems to show up on Bazel projects only due to the way Bazel
executes commands: it uses `env -` to run them in a clear environment,
meaning that even `$PATH` is altered. Before bc02fd0 the issues in the
Dockerfiles were hidden by the fact that the environment contained
multiple versions of Python and one happened to be matched by this
search path.

This fixes #8915, reverting #8914 and #8909 tweaks to #8915. I did not
do a similar thing for #8930 as maybe that can be fixed by changing the
base python image?

Tested: Tested that I can build the `upb` fuzzers with this change.

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
@jonathanmetzman
Copy link
Contributor

Interesting. We build python3 from scratch. Maybe i'll just add a link in /bin instead of merging this.

@mihaimaruseac
Copy link
Member Author

Oh, sure, that also works

Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

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

LGTM

@jonathanmetzman jonathanmetzman merged commit f4cefbc into google:master Feb 6, 2023
eamonnmcmanus pushed a commit to eamonnmcmanus/oss-fuzz that referenced this pull request Mar 15, 2023
The issue in google#8915 is that the environment no longer has a leftover
`python3` binary in `/bin/python3`. This uncovers a bug in the `upb` and
`jwt-verify-lib` Dockerfiles where `python2` was installed (or no Python
was installed).

The issue seems to show up on Bazel projects only due to the way Bazel
executes commands: it uses `env -` to run them in a clear environment,
meaning that even `$PATH` is altered. Before bc02fd0 the issues in the
Dockerfiles were hidden by the fact that the environment contained
multiple versions of Python and one happened to be matched by this
search path.

This fixes google#8915, reverting google#8914 and google#8909 tweaks to google#8915. I did not
do a similar thing for google#8930 as maybe that can be fixed by changing the
base python image?

Tested: Tested that I can build the `upb` fuzzers with this change.

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
asedeno added a commit to asedeno/oss-fuzz that referenced this pull request Sep 23, 2024
Similar to google#9507, to get past failures of the form:

```
/usr/bin/env: 'python3': No such file or directory
```

Signed-off-by: Alejandro R. Sedeño <asedeno@google.com>
DavidKorczynski pushed a commit that referenced this pull request Sep 23, 2024
Similar to #9507, to get past failures of the form:

```
/usr/bin/env: 'python3': No such file or directory
```

Signed-off-by: Alejandro R. Sedeño <asedeno@google.com>
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.

Figure out why bazel behaves weirdly (not recognizing changes to image after it is installed)
2 participants