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

Release CI #97

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM revive-llvm

WORKDIR /app

COPY . .
RUN RUSTFLAGS='-L /app/llvm18.0/lib/unknown -L /usr/lib -L /app/llvm18.0/lib' REVIVE_INSTALL_DIR='/app/release/revive/' make install-revive
16 changes: 16 additions & 0 deletions .github/Dockerfile-llvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.20.3

ARG RUST_VERSION=stable

RUN apk add bash git cmake make ninja python3 ncurses-static curl
RUN ninja --version

COPY build-llvm.sh .

RUN bash -c ./build-llvm.sh
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
RUN bash -c ./build-llvm.sh
RUN bash -c ./build-llvm.sh

We probably need to modify the build-llvm.sh file to use other flags. AFAIK @xermicus discovered that some other flags are needed to it statically links against LLVMs libc++ instead of gccs libstdc++.

Copy link
Member

@xermicus xermicus Oct 25, 2024

Choose a reason for hiding this comment

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

Yes, when I tried cross compiling to musl using the current build script, resolc was still dyn linked against libstdc++ (and segfaulted with an LLVM panic message). See also this comment in the related issue.

@wpt967 mentioned he was looking into it, what is the status?

Copy link
Member

Choose a reason for hiding this comment

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

I told @wpt967 to de-pritotize this one since we are only supporting compilation REMIX for now. Until we have proper releases.


RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION}
ENV PATH=/root/.cargo/bin:/llvm18.0/bin:${PATH}

WORKDIR /app
RUN REVIVE_INSTALL_DIR=$(pwd)/target/release
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release
run-name: Release ${{ github.ref_name }}
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+"
jobs:

CreateRelease:
permissions:
contents: write
runs-on: ubuntu-20.04
steps:
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
make_latest: true

Release:
needs: [CreateRelease]
permissions:
contents: write
runs-on: ubuntu-20.04
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: build llvm
run: docker build -t revive-llvm:latest --progress=plain -f --build-arg RUST_VERSION=1.80 .github/Dockerfile-llvm

- name: build revive
run: docker build -t revive:latest --progress=plain -f .github/Dockerfile

- name: get binary
run: docker run --rm revive:latest -v output:/app/output cp /app/release/revive/resolc /app/output

# docker push revive:latest

- run: gh release upload ${{ github.ref_name }} output/resolc --clobber
2 changes: 0 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test
run-name: Test ${{ github.ref_name }}
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Release:
# runs-on: ubuntu-20.04
runs-on: parity-large
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: build llvm
run: docker build -t revive-llvm:latest --progress=plain --build-arg RUST_VERSION=1.80 -f .github/Dockerfile-llvm .

- name: build revive
run: docker build -t revive:latest --progress=plain -f .github/Dockerfile

- name: get binary
run: docker run --rm revive:latest -v output:/app/output cp /app/release/revive/resolc /app/output .

# docker push revive:latest

- run: gh release upload ${{ github.ref_name }} output/resolc
Loading