Skip to content
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
10 changes: 5 additions & 5 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ BOOST_PREFIX = { value = "./solx-solidity/boost/lib/", relative = true, force =

LLVM_SYS_211_PREFIX = { value = "./target-llvm/target-final/", relative = true, force = true }
MLIR_SYS_210_PREFIX = { value = "./target-llvm/target-final/", relative = true, force = true }
TABLEGEN_210_PREFIX = { value = "./target-llvm/target-final/", relative = true, force = true }
TABLEGEN_210_PREFIX = { value = "./target-llvm/target-final/", relative = true }

[alias]
run-tester = "run --bin solx-tester -- --solidity-compiler ./target/release/solx"

clippy-slang = "clippy -p solx-slang -p solx-mlir -p solx --no-default-features --features slang --target-dir target-slang"
build-slang = "build -p solx-slang -p solx-mlir -p solx --no-default-features --features slang --target-dir target-slang"
test-slang = "test -p solx-slang -p solx-mlir -p solx --no-default-features --features slang --target-dir target-slang"
run-tester-slang = "run --bin solx-tester --no-default-features --features slang-ast --target-dir target-slang -- --solidity-compiler ./target-slang/release/solx -O M3B3"
clippy-slang = "clippy -p solx-slang -p solx-mlir -p solx --no-default-features --features slang"
build-slang = "build -p solx-slang -p solx-mlir -p solx --no-default-features --features slang"
test-slang = "test -p solx-slang -p solx-mlir -p solx --no-default-features --features slang"
run-tester-slang = "run --bin solx-tester --no-default-features --features slang-ast -- --solidity-compiler ./target/release/solx -O M3B3"
3 changes: 0 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
// in the guide's Persistence section.
"mounts": [
"source=solx-target-${devcontainerId},target=${containerWorkspaceFolder}/target,type=volume",
"source=solx-target-slang-${devcontainerId},target=${containerWorkspaceFolder}/target-slang,type=volume",
"source=solx-target-llvm-${devcontainerId},target=${containerWorkspaceFolder}/target-llvm,type=volume",
"source=solx-rustup,target=/usr/local/rustup,type=volume",
"source=solx-cargo,target=/usr/local/cargo,type=volume",
Expand Down Expand Up @@ -63,14 +62,12 @@
// lag in integrated terminals after the first bootstrap.
"files.watcherExclude": {
"**/target/**": true,
"**/target-slang/**": true,
"**/target-llvm/**": true,
"**/solx-solidity/build/**": true,
"**/solx-solidity/boost/**": true
},
"search.exclude": {
"**/target": true,
"**/target-slang": true,
"**/target-llvm": true,
"**/solx-solidity/build": true,
"**/solx-solidity/boost": true
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -euo pipefail

# Named volumes are created root-owned; hand them to the dev user.
sudo chown "$(id -u):$(id -g)" \
target target-slang target-llvm \
target target-llvm \
/var/cache/solx-ccache /usr/local/rustup /usr/local/cargo

# Docker Desktop file sharing can surface the bind mount with foreign
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test "$(id -u)" -ne 0
sudo -n true

echo "==> Workspace and named volumes are writable"
for dir in . target target-slang target-llvm "${CCACHE_DIR:?CCACHE_DIR not set}"; do
for dir in . target target-llvm "${CCACHE_DIR:?CCACHE_DIR not set}"; do
touch "${dir}/.devcontainer-smoke"
rm "${dir}/.devcontainer-smoke"
done
Expand Down
15 changes: 7 additions & 8 deletions .github/actions/build-rust/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: 'Build'
description: 'Build Rust executable.'
inputs:
exec_name:
description: 'Name of the executable.'
required: true
target:
description: 'Specific build target triplet.'
required: false
Expand Down Expand Up @@ -82,25 +79,27 @@ runs:
if [[ "${RUNNER_OS}" == "Windows" ]] || [[ "${RUNNER_OS}" == "Linux" ]]; then
export RUSTFLAGS="${RUSTFLAGS} -C link-arg=-fuse-ld=lld"
fi
${SFW_PREFIX:-} cargo ${BUILD_STD_LIB} build --frozen ${RELEASE} ${{ steps.build-target.outputs.target }}
${SFW_PREFIX:-} cargo ${BUILD_STD_LIB} build-slang --frozen ${RELEASE} ${{ steps.build-target.outputs.target }}
if [ '${{ inputs.target }}' != '' ]; then
BINARY_DIR="${PWD}/target/${{ inputs.target }}/${{ inputs.build-type }}"
else
BINARY_DIR="${PWD}/target/${{ inputs.build-type }}"
fi
[ "$RUNNER_OS" = "Windows" ] && WIN_SUFFIX=".exe"
echo "${BINARY_DIR}" >> "${GITHUB_PATH}"
echo "binary-path=${BINARY_DIR}/${{ inputs.exec_name }}${WIN_SUFFIX}" >> "${GITHUB_OUTPUT}"
echo "binary-path=${BINARY_DIR}/solx${WIN_SUFFIX}" >> "${GITHUB_OUTPUT}"

- name: Prepare binary
if: inputs.release-suffix != ''
env:
BINARY_PATH: ${{ steps.build.outputs.binary-path }}
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: |
mkdir -p ./releases/${{ inputs.release-suffix }}
[ "$RUNNER_OS" = "Windows" ] && WIN_SUFFIX=".exe"
strip "./target/${{ inputs.target }}/${{ inputs.build-type }}/${{ inputs.exec_name }}${WIN_SUFFIX}"
mv "./target/${{ inputs.target }}/${{ inputs.build-type }}/${{ inputs.exec_name }}${WIN_SUFFIX}" \
"./releases/${{ inputs.release-suffix }}/${{ inputs.exec_name }}-${{ inputs.release-suffix }}${WIN_SUFFIX}"
strip "${BINARY_PATH}"
mv "${BINARY_PATH}" \
"./releases/${{ inputs.release-suffix }}/solx-${{ inputs.release-suffix }}${WIN_SUFFIX}"

- name: Upload binary
if: inputs.release-suffix != ''
Expand Down
18 changes: 12 additions & 6 deletions .github/actions/build-toolchain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ description: >-
Shared CI prologue for the standard toolchain configuration: submodule
checkout, Socket Firewall, platform prep (MSYS2 on Windows, disk cleanup
on macOS), then the LLVM and solc builds. The build parameters below
define the standard-config cache keys shared by test.yaml,
slang-tests.yaml, and cache-warmup.yaml — changing them here re-keys all
of those workflows together. Workflows needing a different LLVM
configuration (sanitizer, coverage, integration, release) call
build-llvm/build-solc directly and pair with their own cache-warmup job.
define the standard-config cache keys shared by test.yaml and
cache-warmup.yaml — changing them here re-keys both workflows together.
Workflows needing a different LLVM configuration (sanitizer, coverage,
integration, release) call build-llvm and build-solc directly as needed
and pair with their own cache-warmup job.

inputs:
llvm:
Expand Down Expand Up @@ -73,9 +73,15 @@ runs:
shell: bash
run: rm -fv "$(rustc --print sysroot)/bin/libwinpthread-1.dll"

# TODO: remove this step once the lit tests stop running against solc.
#
# Release: RelWithDebInfo bakes -g3 debug info into the statically
# linked solc.exe, producing a ~2 GB PE that the Windows loader
# rejects ("Exec format error"), and the lit tests execute solc.
- name: Build solc
if: inputs.solc == 'true'
uses: ./.github/actions/build-solc
with:
cmake-build-type: RelWithDebInfo
cmake-build-type: Release
working-dir: 'solx-solidity'
enable-mlir: 'true'
32 changes: 9 additions & 23 deletions .github/workflows/cache-warmup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Cache Warmup
on:
push:
branches:
- main
- main-slang
paths:
- 'solx-llvm'
- 'solx-solidity'
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
with:
path: ${{ runner.temp }}/ccache-llvm
key: ccache-touch-${{ github.job }}-${{ github.run_id }}
restore-keys: llvm-${{ runner.os }}-${{ runner.arch }}-RelWithDebInfo-mlir-end
restore-keys: llvm-${{ runner.os }}-${{ runner.arch }}-RelWithDebInfo-mlir-utils-end
fail-on-cache-miss: false
lookup-only: true

Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
with:
path: ${{ runner.temp }}/ccache-solc
key: ccache-touch-${{ github.job }}-${{ github.run_id }}
restore-keys: solc-${{ runner.os }}-${{ runner.arch }}-RelWithDebInfo-end
restore-keys: solc-${{ runner.os }}-${{ runner.arch }}-Release-end
fail-on-cache-miss: false
lookup-only: true

Expand Down Expand Up @@ -176,6 +176,7 @@ jobs:
with:
build-type: RelWithDebInfo
enable-assertions: 'true'
enable-mlir: 'true'
sanitizer: 'Address'

- name: Touch LLVM ccache
Expand All @@ -184,7 +185,7 @@ jobs:
with:
path: ${{ runner.temp }}/ccache-llvm
key: ccache-touch-${{ github.job }}-${{ github.run_id }}
restore-keys: llvm-${{ runner.os }}-${{ runner.arch }}-RelWithDebInfo-Address-end
restore-keys: llvm-${{ runner.os }}-${{ runner.arch }}-RelWithDebInfo-mlir-Address-end
fail-on-cache-miss: false
lookup-only: true

Expand Down Expand Up @@ -233,13 +234,13 @@ jobs:
fail-on-cache-miss: false
lookup-only: true

# ── LLVM + solc: integration config (integration-tests.yaml) ────────
# ── LLVM: integration config (integration-tests.yaml) ───────────────
warm-llvm-integration:
runs-on: ubuntu-24.04
container:
image: ghcr.io/nomicfoundation/solx-ci-runner@sha256:cd5a37f2630fdf1898ddb2ca11f8c2ecc4d572c60011fe923b27b1625f92ba15
volumes: *free-disk-volumes
name: "LLVM + solc · Integration"
name: "LLVM · Integration"
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Expand All @@ -265,29 +266,14 @@ jobs:
with:
build-type: Release
enable-assertions: 'false'
enable-mlir: 'true'

- name: Touch LLVM ccache
if: always()
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/ccache-llvm
key: ccache-touch-${{ github.job }}-${{ github.run_id }}
restore-keys: llvm-${{ runner.os }}-${{ runner.arch }}-no-assertions-end
fail-on-cache-miss: false
lookup-only: true

- name: Build solc
uses: ./.github/actions/build-solc
with:
cmake-build-type: Release
working-dir: 'solx-solidity'

- name: Touch solc ccache
if: always()
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/ccache-solc
key: ccache-touch-${{ github.job }}-${{ github.run_id }}
restore-keys: solc-${{ runner.os }}-${{ runner.arch }}-Release-end
restore-keys: llvm-${{ runner.os }}-${{ runner.arch }}-mlir-no-assertions-end
fail-on-cache-miss: false
lookup-only: true
32 changes: 8 additions & 24 deletions .github/workflows/compile-benchmark.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Compile Benchmark

# Times `solx --standard-json` over the fixtures in tests/benchmark/fixtures
# with hyperfine, comparing the PR build against a main build and the latest
# with hyperfine, comparing the PR build against a main-slang build and the latest
# release binary, and posts the report as a PR comment. Label-gated like the
# integration suite; report-only (no pass/fail gating on timings).

Expand Down Expand Up @@ -69,14 +69,14 @@ jobs:
# actions/checkout's `git clean -ffdx` doesn't recurse into submodules,
# so on a persistent self-hosted workspace a previous run can leave
# stale dirs inside temp-solx-main. Wipe wholesale before re-checking
# out main. (Same pattern as integration-tests.yaml.)
# out main-slang. (Same pattern as integration-tests.yaml.)
- name: Reset main checkout dir
run: rm -rf temp-solx-main

- name: Checkout main
- name: Checkout main-slang
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: main
ref: main-slang
submodules: true
persist-credentials: false
path: temp-solx-main
Expand All @@ -102,6 +102,7 @@ jobs:
with:
build-type: Release
enable-assertions: 'false'
enable-mlir: 'true'

- name: Build LLVM (main)
uses: ./.github/actions/build-llvm
Expand All @@ -110,44 +111,27 @@ jobs:
mirror-key: ${{ steps.build-llvm-pr.outputs.cache-key }}
build-type: Release
enable-assertions: 'false'

- name: Build solc (PR)
id: build-solc-pr
uses: ./.github/actions/build-solc
with:
cmake-build-type: Release
working-dir: 'solx-solidity'

- name: Build solc (main)
uses: ./.github/actions/build-solc
with:
cmake-build-type: 'Release'
working-dir: 'temp-solx-main/solx-solidity'
mirror-key: ${{ steps.build-solc-pr.outputs.cache-key }}
enable-mlir: 'true'

# Env and target mirror .github/actions/build-rust so the pr/main
# binaries share the released binary's build configuration: the
# statically linked glibc alone is worth ~5% on this workload.
- name: Build solx (PR)
env:
BOOST_PREFIX: ${{ github.workspace }}/solx-solidity/boost/lib
SOLC_PREFIX: ${{ github.workspace }}/solx-solidity/build
RUSTC_BOOTSTRAP: 1
RUSTFLAGS: '-C target-feature=+crt-static -C link-arg=-fuse-ld=lld'
run: |
${SFW_PREFIX:-} cargo fetch --locked
${SFW_PREFIX:-} cargo build --frozen --release --bin solx --target x86_64-unknown-linux-gnu
${SFW_PREFIX:-} cargo build-slang --frozen --release --target x86_64-unknown-linux-gnu

- name: Build solx (main)
working-directory: temp-solx-main
env:
BOOST_PREFIX: ${{ github.workspace }}/temp-solx-main/solx-solidity/boost/lib
SOLC_PREFIX: ${{ github.workspace }}/temp-solx-main/solx-solidity/build
RUSTC_BOOTSTRAP: 1
RUSTFLAGS: '-C target-feature=+crt-static -C link-arg=-fuse-ld=lld'
run: |
${SFW_PREFIX:-} cargo fetch --locked
${SFW_PREFIX:-} cargo build --frozen --release --bin solx --target x86_64-unknown-linux-gnu
${SFW_PREFIX:-} cargo build-slang --frozen --release --target x86_64-unknown-linux-gnu

- name: Download latest release binary
env:
Expand Down
Loading
Loading