-
Notifications
You must be signed in to change notification settings - Fork 5
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
[workflows] Add workflow for building revive in a debian container. #55
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build revive-debian | ||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
REVIVE_DEBIAN_PACKAGE: revive-debian-x86 | ||
DEBIAN_CONTAINER: revive-builder-debian-x86 | ||
DEBIAN_CONTAINER_BUILDER: build-debian-builder.sh | ||
DEBIAN_CONTAINER_RUNNER: run-debian-builder.sh | ||
REVIVE_DEBIAN_INSTALL: ${{ github.workspace }}/target/release | ||
REVIVE_DEBIAN_BINARY: resolc | ||
RUST_VERSION: "1.80" | ||
|
||
jobs: | ||
build-revive-debian-x86: | ||
name: debian-container-x86 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: build-container | ||
run: | | ||
(cd utils && ./${{ env.DEBIAN_CONTAINER_BUILDER}} --build-arg RUST_VERSION=${{ env.RUST_VERSION}} . ) | ||
|
||
- name: build-revive-debian | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be good to print the versions of the tools being used. Please take a look here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
run: | | ||
rustup show | ||
cargo --version | ||
rustup +nightly show | ||
cargo +nightly --version | ||
bash --version | ||
utils/${{ env.DEBIAN_CONTAINER_RUNNER }} utils/build-revive.sh -o ${{ env.REVIVE_DEBIAN_INSTALL}} | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.REVIVE_DEBIAN_PACKAGE }} | ||
path: ${{ env.REVIVE_DEBIAN_INSTALL }}/${{ env.REVIVE_DEBIAN_BINARY }} | ||
retention-days: 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /usr/bin/env bash | ||
|
||
CONTAINER=revive-builder-debian-x86 | ||
VERSION=latest | ||
DOCKERFILE=revive-builder-debian.dockerfile | ||
|
||
docker build --rm -t ${CONTAINER}:${VERSION} -f ${DOCKERFILE} $@ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
REVIVE_INSTALL_DIR=$(pwd)/target/release | ||
while getopts "o:" option ; do | ||
case $option in | ||
o) # Output directory | ||
REVIVE_INSTALL_DIR=$OPTARG | ||
;; | ||
\?) echo "Error: Invalid option" | ||
exit 1;; | ||
esac | ||
done | ||
echo "Installing to ${REVIVE_INSTALL_DIR}" | ||
|
||
$(pwd)/build-llvm.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To get rid of doing this every time we release, we can have another workflow (could even be a separate repository). The idea is that this separate workflow only builds and releases LLVM, and here we can just download the LLVM release. The assumption is that we do not change the LLVM version often, should be way less often than we release revive. However it can be done later, it shouldn't block us for now. |
||
export PATH=$(pwd)/llvm18.0/bin:$PATH | ||
|
||
make install-revive REVIVE_INSTALL_DIR=${REVIVE_INSTALL_DIR} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# syntax=docker/dockerfile:1 | ||
# Dockerfile for building revive in a Debian container. | ||
FROM debian:12 | ||
RUN <<EOF | ||
apt-get update | ||
apt-get install -q -y build-essential cmake make ninja-build python3 \ | ||
libmpfr-dev libgmp-dev libmpc-dev ncurses-dev \ | ||
git curl | ||
EOF | ||
ARG RUST_VERSION=stable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, I think sticking to specific version should be better. What is missing is a rust version in the top level
Could you add this here and to the top level Cargo.toml? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The value in the Dockerfile is a default value, the value used is set in in the workflow file. Changed the Cargo.toml file to specify the rust-version is 1.80 |
||
RUN <<EOF | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION} | ||
EOF | ||
ENV PATH=/root/.cargo/bin:${PATH} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /usr/bin/env bash | ||
|
||
CONTAINER=revive-builder-debian-x86 | ||
VERSION=latest | ||
|
||
docker run --rm -v $(pwd):$(pwd) -w $(pwd) ${CONTAINER}:${VERSION} $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the run takes more than half an hour, maybe we should use beefier runners. I remember we had
ubuntu-latest-8-cores
andubuntu-latest-16-cores
runners.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should use the more beefy ones. But building
resolc
itself takes seconds to minutes even on potato machines. I guess the main problem is LLVM and this is solved by having a dedicated release workflow for LLVM. So I think we should try both: Beefy runners + more economic release workflows.