Skip to content

Commit

Permalink
fix(ping/rust): Don't set PR ref for master build (#79)
Browse files Browse the repository at this point in the history
When building the `master` image we would previously mistakingly set the
ref to the PR commit hash.

This surfaced when testing a pull request from a fork. `master` would be
pointed at the forks HEAD commit hash, but not the fork URL. Thus the
build could not find the commit and would fail. See
libp2p/rust-libp2p#3154
  • Loading branch information
mxinden authored Nov 23, 2022
1 parent 17dcc6c commit da5bbf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ping/_compositions/rust-cross-versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

[groups.build_config.build_args]
BINARY_NAME = '{{ .BinaryName }}'
GIT_REF = '{{ $.Env.GitReference }}'
GIT_REF = "master"
{{ end }}

{{ if $.Env.GitReference }}
Expand Down
2 changes: 1 addition & 1 deletion ping/rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG GIT_TARGET=""
RUN if [ ! -z "${GIT_TARGET}" ]; then sed -i "s,^git.*,git = \"https://${GIT_TARGET}\"," ./plan/Cargo.toml; fi

ARG GIT_REF=""
RUN if [ ! -z "${GIT_REF}" ]; then sed -i "s/^rev.*/rev = \"${GIT_REF}\"/" ./plan/Cargo.toml; fi
RUN if [ ! -z "${GIT_REF}" ]; then sed -i "s/^rev.*/branch = \"${GIT_REF}\"/" ./plan/Cargo.toml; fi

# Build the requested binary: Cargo will update lockfile on changed manifest (i.e. if one of the above `sed`s patched it).
ARG BINARY_NAME
Expand Down

0 comments on commit da5bbf7

Please sign in to comment.