Skip to content

Commit

Permalink
Install Python3 explicitly (google#9507)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mihaimaruseac authored and eamonnmcmanus committed Mar 15, 2023
1 parent 8792629 commit 5bfacdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions projects/jwt-verify-lib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#
################################################################################

# TODO: workaround https://github.com/google/oss-fuzz/issues/8915
FROM gcr.io/oss-fuzz-base/base-builder@sha256:a723398a016b23d0e2b29f5c0203a6734900e404d09fdd44a555c1514ca513fa
FROM gcr.io/oss-fuzz-base/base-builder

RUN git clone https://github.com/google/jwt_verify_lib.git
RUN apt-get update && apt-get install python3 -y
RUN git clone --depth 1 https://github.com/google/jwt_verify_lib.git
WORKDIR $SRC/jwt_verify_lib/
COPY build.sh $SRC/
4 changes: 2 additions & 2 deletions projects/upb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder@sha256:a723398a016b23d0e2b29f5c0203a6734900e404d09fdd44a555c1514ca513fa
FROM gcr.io/oss-fuzz-base/base-builder

RUN apt-get update && apt-get install python -y
RUN apt-get update && apt-get install python3 -y
RUN git clone --depth 1 https://github.com/protocolbuffers/upb.git upb
WORKDIR upb
COPY build.sh $SRC/

0 comments on commit 5bfacdf

Please sign in to comment.