Skip to content

Commit

Permalink
Package on Debian Buster (#450)
Browse files Browse the repository at this point in the history
* build on debian buster

* fix url

* clang version on debian buster

* fix debian/rules for debian buster

* checkout before build

* fix typo

* Jenkinsfile: formatting
  • Loading branch information
dwightguth authored and ehildenb committed Aug 22, 2019
1 parent 5fbb7ca commit e26718b
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 11 deletions.
74 changes: 65 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ pipeline {
sh '''
commit_short=$(cd deps/k && git rev-parse --short HEAD)
K_RELEASE="https://github.com/kframework/k/releases/download/nightly-$commit_short"
curl --fail --location "${K_RELEASE}/kframework_5.0.0_amd64_bionic.deb" --output kframework.deb
curl --fail --location "${K_RELEASE}/kframework_5.0.0_amd64_bionic.deb" --output kframework-bionic.deb
curl --fail --location "${K_RELEASE}/kframework-5.0.0-1-x86_64.pkg.tar.xz" --output kframework-git.pkg.tar.xz
curl --fail --location "${K_RELEASE}/kframework_5.0.0_amd64_buster.deb" --output kframework-buster.deb
'''
stash name: 'bionic-kframework', includes: 'kframework.deb'
stash name: 'bionic-kframework', includes: 'kframework-bionic.deb'
stash name: 'buster-kframework', includes: 'kframework-buster.deb'
stash name: 'arch-kframework', includes: 'kframework-git.pkg.tar.xz'
}
}
Expand Down Expand Up @@ -226,11 +228,13 @@ pipeline {
}
steps {
dir("kevm-${env.KEVM_RELEASE_ID}") {
checkout scm
unstash 'bionic-kframework'
sh '''
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install --yes ./kframework.deb
sudo apt-get install --yes ./kframework-bionic.deb
cp -r package/debian ./
cp package/ubuntu/* debian
dpkg-buildpackage --no-sign
'''
}
Expand All @@ -257,6 +261,49 @@ pipeline {
}
}
}
stage('Build Debian Buster Package') {
agent {
dockerfile {
dir "kevm-${env.KEVM_RELEASE_ID}/package"
filename 'Dockerfile.debian-buster'
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
reuseNode true
}
}
steps {
dir("kevm-${env.KEVM_RELEASE_ID}") {
checkout scm
unstash 'buster-kframework'
sh '''
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install --yes ./kframework-buster.deb
cp -r package/debian ./
dpkg-buildpackage --no-sign
'''
}
stash name: 'buster-kevm', includes: "kevm_${env.KEVM_RELEASE_ID}_amd64.deb"
}
}
stage('Test Debian Buster Package') {
agent {
dockerfile {
dir "kevm-${env.KEVM_RELEASE_ID}/package"
filename 'Dockerfile.debian-buster'
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
reuseNode true
}
}
steps {
dir("kevm-${env.KEVM_RELEASE_ID}") {
unstash 'buster-kevm'
sh '''
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install --yes ./kevm_${KEVM_RELEASE_ID}_amd64.deb
make test-interactive-firefly
'''
}
}
}
stage('Build Arch Package') {
agent {
dockerfile {
Expand All @@ -268,6 +315,7 @@ pipeline {
}
steps {
dir("kevm-${env.KEVM_RELEASE_ID}") {
checkout scm
unstash 'arch-kframework'
sh '''
sudo pacman -Syu --noconfirm
Expand Down Expand Up @@ -311,15 +359,23 @@ pipeline {
steps {
dir("kevm-${env.KEVM_RELEASE_ID}") {
unstash 'src-kevm'
unstash 'bionic-kevm'
unstash 'arch-kevm'
dir("bionic") {
unstash 'bionic-kevm'
}
dir("buster") {
unstash 'buster-kevm'
}
dir("arch") {
unstash 'arch-kevm'
}
sh '''
release_tag="v${KEVM_RELEASE_ID}-$(git rev-parse --short HEAD)"
make release.md KEVM_RELEASE_TAG=${release_tag}
hub release create \
--attach "kevm-${KEVM_RELEASE_ID}-src.tar.gz#Source tar.gz" \
--attach "kevm_${KEVM_RELEASE_ID}_amd64.deb#Ubuntu Bionic (18.04) Package" \
--attach "kevm-${KEVM_RELEASE_ID}/package/kevm-git-${KEVM_RELEASE_ID}-1-x86_64.pkg.tar.xz#Arch Package" \
hub release create \
--attach "kevm-${KEVM_RELEASE_ID}-src.tar.gz#Source tar.gz" \
--attach "bionic/kevm_${KEVM_RELEASE_ID}_amd64.deb#Ubuntu Bionic (18.04) Package" \
--attach "buster/kevm_${KEVM_RELEASE_ID}_amd64.deb#Debian Buster (10) Package" \
--attach "arch/kevm-${KEVM_RELEASE_ID}/package/kevm-git-${KEVM_RELEASE_ID}-1-x86_64.pkg.tar.xz#Arch Package" \
--file "release.md" "${release_tag}"
'''
}
Expand Down
21 changes: 21 additions & 0 deletions package/Dockerfile.debian-buster
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM debian:buster

ENV TZ=America/Chicago
RUN ln --symbolic --no-dereference --force /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone

RUN apt-get update \
&& apt-get upgrade --yes \
&& apt-get install --yes clang-7 cmake curl dh-make git libcrypto++-dev \
libjemalloc-dev libprocps-dev libprotobuf-dev libsecp256k1-dev \
libssl-dev pandoc pkg-config protobuf-compiler sudo

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install --yes nodejs
RUN npm install -g npx

ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g $GROUP_ID user \
&& useradd --create-home --uid $USER_ID --shell /bin/sh --gid $GROUP_ID user \
&& echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
2 changes: 1 addition & 1 deletion package/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: kevm
Section: devel
Priority: optional
Maintainer: Everett Hildenbrandt <[email protected]>
Build-Depends: kframework, protobuf-compiler, pandoc, clang-8, cmake, pkg-config, libjemalloc-dev, libssl-dev, libprocps-dev, libprotobuf-dev, libcrypto++-dev, libsecp256k1-dev
Build-Depends: kframework, protobuf-compiler, pandoc, clang-7, cmake, pkg-config, libjemalloc-dev, libssl-dev, libprocps-dev, libprotobuf-dev, libcrypto++-dev, libsecp256k1-dev
Standards-Version: 3.9.6
Homepage: https://github.com/kframework/evm-semantics

Expand Down
2 changes: 1 addition & 1 deletion package/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

override_dh_auto_build:
git submodule update --init --recursive
make K_RELEASE="/usr/lib/kframework" build-node
make K_RELEASE="/usr/lib/kframework" LIBFF_CC=clang-7 LIBFF_CXX=clang++-7 build-node

override_dh_auto_install:
make K_RELEASE="/usr/lib/kframework" DESTDIR="debian/kevm" INSTALL_PREFIX="/usr" install
Expand Down
16 changes: 16 additions & 0 deletions package/ubuntu/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Source: kevm
Section: devel
Priority: optional
Maintainer: Everett Hildenbrandt <[email protected]>
Build-Depends: kframework, protobuf-compiler, pandoc, clang-8, cmake, pkg-config, libjemalloc-dev, libssl-dev, libprocps-dev, libprotobuf-dev, libcrypto++-dev, libsecp256k1-dev
Standards-Version: 3.9.6
Homepage: https://github.com/kframework/evm-semantics

Package: kevm
Architecture: any
Section: devel
Priority: optional
Depends: libjemalloc-dev, libprotobuf-dev, libcrypto++-dev, libsecp256k1-dev
Description: K Semantics of EVM
Implementation of Ethereum Virtual Machine (EVM) in K.
kevm-vm executable communicates over protobuf to run EVM transactions.
33 changes: 33 additions & 0 deletions package/ubuntu/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
dh $@

override_dh_auto_build:
git submodule update --init --recursive
make K_RELEASE="/usr/lib/kframework" build-node

override_dh_auto_install:
make K_RELEASE="/usr/lib/kframework" DESTDIR="debian/kevm" INSTALL_PREFIX="/usr" install

override_dh_auto_test:
true

# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

0 comments on commit e26718b

Please sign in to comment.