Skip to content

Commit 18b42dc

Browse files
authored
Merge pull request #13973 from ethereum/static-build-2004
Restore static ubuntu 20.04 release builds
2 parents 13c0d93 + 930c8c0 commit 18b42dc

File tree

2 files changed

+169
-41
lines changed

2 files changed

+169
-41
lines changed

.circleci/config.yml

Lines changed: 94 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
# - ems: Emscripten
88
version: 2.1
99
parameters:
10+
ubuntu-2004-docker-image:
11+
type: string
12+
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-16
13+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:ee1def5806f40c35d583234e172ec5769bb9a08b6f5bbc713c1a2658846dbced"
1014
ubuntu-2204-docker-image:
1115
type: string
1216
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-1
@@ -97,11 +101,13 @@ commands:
97101
parameters:
98102
label:
99103
type: string
104+
binary_path:
105+
type: string
100106
steps:
101107
- run: mkdir test-cases/
102-
- run: cd test-cases && ../scripts/isolate_tests.py ../test/
103-
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface standard-json --report-file "../bytecode-report-<< parameters.label >>-json.txt"
104-
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface cli --report-file "../bytecode-report-<< parameters.label >>-cli.txt"
108+
- run: cd test-cases && python3 ../scripts/isolate_tests.py ../test/
109+
- run: cd test-cases && python3 ../scripts/bytecodecompare/prepare_report.py << parameters.binary_path >> --interface standard-json --report-file "../bytecode-report-<< parameters.label >>-json.txt"
110+
- run: cd test-cases && python3 ../scripts/bytecodecompare/prepare_report.py << parameters.binary_path >> --interface cli --report-file "../bytecode-report-<< parameters.label >>-cli.txt"
105111
- store_artifacts:
106112
path: bytecode-report-<< parameters.label >>-json.txt
107113
- store_artifacts:
@@ -313,6 +319,27 @@ defaults:
313319
CXX: clang++
314320
MAKEFLAGS: -j 5
315321

322+
- base_ubuntu2004: &base_ubuntu2004
323+
docker:
324+
- image: << pipeline.parameters.ubuntu-2004-docker-image >>
325+
environment:
326+
TERM: xterm
327+
MAKEFLAGS: -j 3
328+
329+
- base_ubuntu2004_small: &base_ubuntu2004_small
330+
<<: *base_ubuntu2004
331+
resource_class: small
332+
environment:
333+
TERM: xterm
334+
MAKEFLAGS: -j 2
335+
336+
- base_ubuntu2004_xlarge: &base_ubuntu2004_xlarge
337+
<<: *base_ubuntu2004
338+
resource_class: xlarge
339+
environment:
340+
TERM: xterm
341+
MAKEFLAGS: -j 10
342+
316343
- base_ubuntu2204: &base_ubuntu2204
317344
docker:
318345
- image: << pipeline.parameters.ubuntu-2204-docker-image >>
@@ -454,7 +481,7 @@ defaults:
454481
requires:
455482
- b_ubu_force_release
456483

457-
- workflow_ubuntu2204_static: &workflow_ubuntu2204_static
484+
- workflow_ubuntu2004_static: &workflow_ubuntu2004_static
458485
<<: *workflow_trigger_on_tags
459486
requires:
460487
- b_ubu_static
@@ -518,91 +545,91 @@ defaults:
518545
python2: true
519546

520547
- job_native_test_ext_gnosis: &job_native_test_ext_gnosis
521-
<<: *workflow_ubuntu2204_static
548+
<<: *workflow_ubuntu2004_static
522549
name: t_native_test_ext_gnosis
523550
project: gnosis
524551
binary_type: native
525552
nodejs_version: '16.18'
526553
- job_native_test_ext_zeppelin: &job_native_test_ext_zeppelin
527-
<<: *workflow_ubuntu2204_static
554+
<<: *workflow_ubuntu2004_static
528555
name: t_native_test_ext_zeppelin
529556
project: zeppelin
530557
binary_type: native
531558
resource_class: large
532559
- job_native_test_ext_ens: &job_native_test_ext_ens
533-
<<: *workflow_ubuntu2204_static
560+
<<: *workflow_ubuntu2004_static
534561
name: t_native_test_ext_ens
535562
project: ens
536563
binary_type: native
537564
nodejs_version: '18.11'
538565
- job_native_test_ext_trident: &job_native_test_ext_trident
539-
<<: *workflow_ubuntu2204_static
566+
<<: *workflow_ubuntu2004_static
540567
name: t_native_test_ext_trident
541568
project: trident
542569
binary_type: native
543570
nodejs_version: '16.18'
544571
- job_native_test_ext_euler: &job_native_test_ext_euler
545-
<<: *workflow_ubuntu2204_static
572+
<<: *workflow_ubuntu2004_static
546573
name: t_native_test_ext_euler
547574
project: euler
548575
binary_type: native
549576
resource_class: medium
550577
- job_native_test_ext_yield_liquidator: &job_native_test_ext_yield_liquidator
551-
<<: *workflow_ubuntu2204_static
578+
<<: *workflow_ubuntu2004_static
552579
name: t_native_test_ext_yield_liquidator
553580
project: yield-liquidator
554581
binary_type: native
555582
- job_native_test_ext_bleeps: &job_native_test_ext_bleeps
556-
<<: *workflow_ubuntu2204_static
583+
<<: *workflow_ubuntu2004_static
557584
name: t_native_test_ext_bleeps
558585
project: bleeps
559586
binary_type: native
560587
resource_class: medium
561588
- job_native_test_ext_pool_together: &job_native_test_ext_pool_together
562-
<<: *workflow_ubuntu2204_static
589+
<<: *workflow_ubuntu2004_static
563590
name: t_native_test_ext_pool_together
564591
project: pool-together
565592
binary_type: native
566593
nodejs_version: '16.18'
567594
- job_native_test_ext_perpetual_pools: &job_native_test_ext_perpetual_pools
568-
<<: *workflow_ubuntu2204_static
595+
<<: *workflow_ubuntu2004_static
569596
name: t_native_test_ext_perpetual_pools
570597
project: perpetual-pools
571598
binary_type: native
572599
nodejs_version: '18.11'
573600
- job_native_test_ext_uniswap: &job_native_test_ext_uniswap
574-
<<: *workflow_ubuntu2204_static
601+
<<: *workflow_ubuntu2004_static
575602
name: t_native_test_ext_uniswap
576603
project: uniswap
577604
binary_type: native
578605
nodejs_version: '16.18'
579606
- job_native_test_ext_prb_math: &job_native_test_ext_prb_math
580-
<<: *workflow_ubuntu2204_static
607+
<<: *workflow_ubuntu2004_static
581608
name: t_native_test_ext_prb_math
582609
project: prb-math
583610
binary_type: native
584611
nodejs_version: '18.11'
585612
- job_native_test_ext_elementfi: &job_native_test_ext_elementfi
586-
<<: *workflow_ubuntu2204_static
613+
<<: *workflow_ubuntu2004_static
587614
name: t_native_test_ext_elementfi
588615
project: elementfi
589616
binary_type: native
590617
resource_class: medium
591618
- job_native_test_ext_brink: &job_native_test_ext_brink
592-
<<: *workflow_ubuntu2204_static
619+
<<: *workflow_ubuntu2004_static
593620
name: t_native_test_ext_brink
594621
project: brink
595622
binary_type: native
596623
nodejs_version: '18.11'
597624
- job_native_test_ext_chainlink: &job_native_test_ext_chainlink
598-
<<: *workflow_ubuntu2204_static
625+
<<: *workflow_ubuntu2004_static
599626
name: t_native_test_ext_chainlink
600627
project: chainlink
601628
binary_type: native
602629
nodejs_version: '16.18'
603630
resource_class: large # Tests run out of memory on a smaller machine
604631
- job_native_test_ext_gp2: &job_native_test_ext_gp2
605-
<<: *workflow_ubuntu2204_static
632+
<<: *workflow_ubuntu2004_static
606633
name: t_native_test_ext_gp2
607634
project: gp2
608635
binary_type: native
@@ -826,8 +853,11 @@ jobs:
826853
MAKEFLAGS: -j 10
827854

828855
b_ubu_static:
856+
# We temporarily keep building static release binaries on ubuntu 20.04
857+
# to avoid glibc incompatibilities.
858+
# See: https://github.com/ethereum/solidity/issues/13954
829859
# On large runs 2x faster than on medium. 3x on xlarge.
830-
<<: *base_ubuntu2204_xlarge
860+
<<: *base_ubuntu2004_xlarge
831861
environment:
832862
TERM: xterm
833863
MAKEFLAGS: -j 10
@@ -838,8 +868,14 @@ jobs:
838868
- run:
839869
name: strip binary
840870
command: strip build/solc/solc
841-
- store_artifacts: *artifacts_solc
842-
- persist_to_workspace: *artifacts_executables
871+
- store_artifacts:
872+
path: build/solc/solc
873+
destination: solc-static-linux
874+
- run: mv build/solc/solc build/solc/solc-static-linux
875+
- persist_to_workspace:
876+
root: build
877+
paths:
878+
- solc/solc-static-linux
843879
- gitter_notify_failure_unless_pr
844880

845881
b_ubu_codecov:
@@ -1248,7 +1284,7 @@ jobs:
12481284
- run:
12491285
name: External <<parameters.project>> tests (native)
12501286
command: |
1251-
test/externalTests/<<parameters.project>>.sh native /tmp/workspace/solc/solc
1287+
test/externalTests/<<parameters.project>>.sh native /tmp/workspace/solc/solc-static-linux
12521288
- store_artifacts:
12531289
path: reports/externalTests/
12541290
# persist_to_workspace fails if the directory does not exist and the test script will create
@@ -1389,6 +1425,23 @@ jobs:
13891425
- store_artifacts: *artifacts_test_results
13901426
- gitter_notify_failure_unless_pr
13911427

1428+
# Note: b_bytecode_ubu_static is required because b_ubu_static and b_ubu
1429+
# are currently built on different Ubuntu base images.
1430+
# It can be safely removed once we move both to the same Ubuntu version.
1431+
b_bytecode_ubu_static:
1432+
<<: *base_ubuntu2004_small
1433+
environment:
1434+
TERM: xterm
1435+
MAKEFLAGS: -j 2
1436+
LC_ALL: C
1437+
steps:
1438+
- checkout
1439+
- attach_workspace:
1440+
at: build
1441+
- prepare_bytecode_report:
1442+
label: "ubuntu2004-static"
1443+
binary_path: "../build/solc/solc-static-linux"
1444+
13921445
b_bytecode_ubu:
13931446
<<: *base_ubuntu2204_small
13941447
environment:
@@ -1401,6 +1454,7 @@ jobs:
14011454
at: build
14021455
- prepare_bytecode_report:
14031456
label: "ubuntu"
1457+
binary_path: "../build/solc/solc"
14041458

14051459
b_bytecode_osx:
14061460
<<: *base_osx
@@ -1414,6 +1468,7 @@ jobs:
14141468
at: .
14151469
- prepare_bytecode_report:
14161470
label: "osx"
1471+
binary_path: "../build/solc/solc"
14171472

14181473
b_bytecode_win:
14191474
<<: *base_win_bash
@@ -1424,22 +1479,13 @@ jobs:
14241479
# platforms so line ending conversions must absolutely be disabled.
14251480
- run: git config --global core.autocrlf false
14261481
- checkout
1482+
# Ensure windows has python3 alias required by prepare_bytecode_report
1483+
- run: ln -s /c/tools/miniconda3/python /c/tools/miniconda3/python3
14271484
- attach_workspace:
14281485
at: build
1429-
- run: mkdir test-cases/
1430-
- run: cd test-cases/ && python ../scripts/isolate_tests.py ../test/
1431-
- run: cd test-cases/ && python ../scripts/bytecodecompare/prepare_report.py ../build/solc/Release/solc.exe --interface standard-json --report-file ../bytecode-report-windows-json.txt
1432-
- run: cd test-cases/ && python ../scripts/bytecodecompare/prepare_report.py ../build/solc/Release/solc.exe --interface cli --report-file ../bytecode-report-windows-cli.txt
1433-
- store_artifacts:
1434-
path: bytecode-report-windows-json.txt
1435-
- store_artifacts:
1436-
path: bytecode-report-windows-cli.txt
1437-
- persist_to_workspace:
1438-
root: .
1439-
paths:
1440-
- bytecode-report-windows-json.txt
1441-
- bytecode-report-windows-cli.txt
1442-
- gitter_notify_failure_unless_pr
1486+
- prepare_bytecode_report:
1487+
label: "windows"
1488+
binary_path: "../build/solc/Release/solc.exe"
14431489

14441490
b_bytecode_ems:
14451491
<<: *base_node_small
@@ -1464,6 +1510,8 @@ jobs:
14641510
environment:
14651511
REPORT_FILES: |
14661512
bytecode-report-emscripten.txt
1513+
bytecode-report-ubuntu2004-static-json.txt
1514+
bytecode-report-ubuntu2004-static-cli.txt
14671515
bytecode-report-ubuntu-json.txt
14681516
bytecode-report-ubuntu-cli.txt
14691517
bytecode-report-osx-json.txt
@@ -1506,10 +1554,10 @@ jobs:
15061554
name: Gather and rename binaries from dependent jobs
15071555
command: |
15081556
mkdir github/
1509-
cp workspace/solc/solc github/solc-static-linux
1510-
cp workspace/build/solc/solc github/solc-macos
1511-
cp workspace/solc/Release/solc.exe github/solc-windows.exe
1512-
cp workspace/soljson.js github/soljson.js
1557+
cp workspace/solc/solc-static-linux github/solc-static-linux
1558+
cp workspace/build/solc/solc github/solc-macos
1559+
cp workspace/solc/Release/solc.exe github/solc-windows.exe
1560+
cp workspace/soljson.js github/soljson.js
15131561
15141562
cd github/
15151563
tar --create --file ../github-binaries.tar *
@@ -1635,6 +1683,10 @@ workflows:
16351683
- t_win_soltest: *workflow_win
16361684

16371685
# Bytecode comparison:
1686+
- b_bytecode_ubu_static:
1687+
<<: *workflow_trigger_on_tags
1688+
requires:
1689+
- b_ubu_static
16381690
- b_bytecode_ubu:
16391691
<<: *workflow_trigger_on_tags
16401692
requires:
@@ -1654,6 +1706,7 @@ workflows:
16541706
- t_bytecode_compare:
16551707
<<: *workflow_trigger_on_tags
16561708
requires:
1709+
- b_bytecode_ubu_static
16571710
- b_bytecode_ubu
16581711
- b_bytecode_win
16591712
- b_bytecode_osx
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# vim:syntax=dockerfile
2+
#------------------------------------------------------------------------------
3+
# Dockerfile for building and testing Solidity Compiler on CI
4+
# Target: Ubuntu 19.04 (Disco Dingo)
5+
# URL: https://hub.docker.com/r/ethereum/solidity-buildpack-deps
6+
#
7+
# This file is part of solidity.
8+
#
9+
# solidity is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU General Public License as published by
11+
# the Free Software Foundation, either version 3 of the License, or
12+
# (at your option) any later version.
13+
#
14+
# solidity is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with solidity. If not, see <http://www.gnu.org/licenses/>
21+
#
22+
# (c) 2016-2019 solidity contributors.
23+
#------------------------------------------------------------------------------
24+
FROM buildpack-deps:focal AS base
25+
LABEL version="16"
26+
27+
ARG DEBIAN_FRONTEND=noninteractive
28+
29+
RUN set -ex; \
30+
dist=$(grep DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2); \
31+
echo "deb http://ppa.launchpad.net/ethereum/cpp-build-deps/ubuntu $dist main" >> /etc/apt/sources.list ; \
32+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1c52189c923f6ca9 ; \
33+
apt-get update; \
34+
apt-get install -qqy --no-install-recommends \
35+
build-essential \
36+
software-properties-common \
37+
cmake ninja-build \
38+
libboost-filesystem-dev libboost-test-dev libboost-system-dev \
39+
libboost-program-options-dev \
40+
libcvc4-dev libz3-static-dev z3-static jq \
41+
; \
42+
apt-get install -qy python3-pip python3-sphinx; \
43+
pip3 install codecov; \
44+
rm -rf /var/lib/apt/lists/*
45+
46+
FROM base AS libraries
47+
48+
# EVMONE
49+
RUN set -ex; \
50+
cd /usr/src; \
51+
git clone --branch="v0.9.1" --recurse-submodules https://github.com/ethereum/evmone.git; \
52+
cd evmone; \
53+
mkdir build; \
54+
cd build; \
55+
cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="/usr" ..; \
56+
ninja; \
57+
ninja install/strip; \
58+
rm -rf /usr/src/evmone
59+
60+
# HERA
61+
RUN set -ex; \
62+
cd /usr/src; \
63+
git clone --branch="v0.6.0" --depth 1 --recurse-submodules https://github.com/ewasm/hera.git; \
64+
cd hera; \
65+
mkdir build; \
66+
cd build; \
67+
cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="/usr" ..; \
68+
ninja; \
69+
ninja install/strip; \
70+
rm -rf /usr/src/hera
71+
72+
FROM base
73+
COPY --from=libraries /usr/lib /usr/lib
74+
COPY --from=libraries /usr/bin /usr/bin
75+
COPY --from=libraries /usr/include /usr/include

0 commit comments

Comments
 (0)