Skip to content
Open
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
31 changes: 31 additions & 0 deletions .circleci/build-dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
build-essential
libbsd-dev
libelf-dev
libdw-dev
binutils-dev
zlib1g-dev
autoconf
automake
libtool
pkg-config
autoconf-archive
opam
libgmp-dev
default-jdk-headless
python3
make
git
gawk
gdb
wget
libc6-dbg
libunwind-dev
libunwind-dev:i386
linux-libc-dev-i386-cross
libc6-dev-i386
libboost-iostreams-dev
libboost-regex-dev
libboost-serialization-dev
libboost-filesystem-dev
libffi-dev
gettext-base
25 changes: 11 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
version: 2.0
jobs:
build:
environment:
BASH_ENV: /root/.bash_env
docker:
# MARKER BEGIN DISTRIBUTION +0 [[:blank:]]([-a-z0-9\.]+:[-a-z0-9\.]+)
- image: ubuntu:24.04
# MARKER END DISTRIBUTION
steps:
- checkout
- run:
name: Install dependencies
command: |
dpkg --add-architecture i386
apt update
# MARKER BEGIN PACKAGES +1 [[:blank:]]([^#]+)#
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y \
build-essential libbsd-dev libelf-dev libdw-dev binutils-dev zlib1g-dev \
autoconf automake libtool pkg-config autoconf-archive \
opam libgmp-dev \
default-jdk-headless python3 \
make git gawk gdb wget libc6-dbg \
libunwind-dev libunwind-dev:i386 linux-libc-dev-i386-cross libc6-dev-i386 \
libboost-iostreams-dev libboost-regex-dev \
libboost-serialization-dev libboost-filesystem-dev libffi-dev \
gettext-base # for envsubst
# MARKER END PACKAGES
- checkout
$(cat .circleci/build-dependencies.txt)
- run:
name: Update submodules
command: git submodule update --init --recursive
- run:
name: Set up OCaml 5.1.0 switch
no_output_timeout: 1h
command: |
opam init --no-setup --disable-sandboxing --bare -y
opam switch create 5.1.0
opam env >> $BASH_ENV
- run:
name: Build submodules
command: make -C contrib -j 2
Expand Down
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "liballocs",
"build": {
"dockerfile": "../Dockerfile",
"context": "..",
"target": "base",
"args": {
"user": "user"
}
},
"workspaceFolder": "/usr/local/src/liballocs",
"remoteUser": "user",
"postCreateCommand": "git submodule update --init --recursive && make -C contrib -j$(nproc) && ./autogen.sh && (. contrib/env.sh && ./configure --prefix=/usr/local) && make -j$(nproc)"
}
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ARG DISTRIBUTION=ubuntu:24.04
FROM ${DISTRIBUTION} AS base

ARG user=user
ARG MAKE_PARALLELISM=4

RUN apt-get update && apt-get install -y sudo adduser
RUN adduser ${user} && \
echo "${user} ALL=(root) NOPASSWD:ALL" > /etc/sudoers && \
chmod 0440 /etc/sudoers
RUN mkdir -p /usr/local/src && chown root:${user} /usr/local/src && \
chmod g+w /usr/local/src
RUN mkdir -p /usr/lib/meta && chown root:staff /usr/lib/meta && \
chmod g+w /usr/lib/meta
RUN dpkg --add-architecture i386
COPY .circleci/build-dependencies.txt /tmp/
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \
$(cat /tmp/build-dependencies.txt)
USER ${user}
RUN opam init --no-setup --disable-sandboxing --bare -y && \
opam switch create 5.1.0
ENV OPAMSWITCH=5.1.0

FROM base AS full
ARG user=user
ARG MAKE_PARALLELISM=4

COPY --chown=${user}:${user} . /usr/local/src/liballocs/
RUN cd /usr/local/src/liballocs && \
git submodule update --init --recursive && \
eval $(opam env) && \
make -C contrib -j${MAKE_PARALLELISM}
RUN cd /usr/local/src/liballocs && \
eval $(opam env) && \
./autogen.sh && \
(. contrib/env.sh && ./configure --prefix=/usr/local) && \
make -j${MAKE_PARALLELISM}
RUN sudo mkdir -p /usr/lib/meta && sudo chown root:${user} /usr/lib/meta && \
sudo chmod g+w /usr/lib/meta
# XXX: skip doing this for now, since the distro's pre-built libc will often
# use DWARF 5 and our tools can't hack it.
#RUN cd /usr/local/src/liballocs && \
# make -f tools/Makefile.meta \
# $(for libname in `ldd /bin/true | sed -En '/[[:blank:]]*([^[:blank:]]* => )?(.*) \(0x[0-9a-f]+\)/ {s//\2/;p}' | egrep 'libc\.so\.6|ld-linux.*\.so' | xargs readlink -f`; do echo "/usr/lib/meta${libname}-meta.so"; done)
34 changes: 0 additions & 34 deletions buildtest/Dockerfile.template

This file was deleted.

3 changes: 0 additions & 3 deletions buildtest/Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions buildtest/circleci-default/Makefile

This file was deleted.

2 changes: 0 additions & 2 deletions buildtest/circleci-default/README

This file was deleted.

35 changes: 0 additions & 35 deletions buildtest/circleci-default/scrape-circleci.awk

This file was deleted.

30 changes: 0 additions & 30 deletions buildtest/debian-buster/Dockerfile

This file was deleted.

30 changes: 0 additions & 30 deletions buildtest/debian-stretch/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions buildtest/rules.mk

This file was deleted.

30 changes: 0 additions & 30 deletions buildtest/ubuntu-18.04/Dockerfile

This file was deleted.

30 changes: 0 additions & 30 deletions buildtest/ubuntu-20.04/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions config.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ TOOLSUB := @toolsub@
ELFTIN := @elftin@
CIL_INSTALL := @cil_install@
LIBALLOCSTOOL_CFLAGS := @liballocstool_cflags@
LIBALLOCS_OCAML_PREFIX := @liballocs_ocaml_prefix@
# export anything needed during build of liballocs-enabled executables
export CIL_INSTALL
export TOOLSUB
export ELFTIN
export LIBMALLOCHOOKS
export LIBALLOCSTOOL_CFLAGS
export LIBALLOCS_OCAML_PREFIX

XWRAP_LDPLUGIN := $(ELFTIN)/xwrap-ldplugin/xwrap-ldplugin.so
export XWRAP_LDPLUGIN
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ AC_SUBST([toolsub], [$ac_toolsub])
AC_SUBST([elftin], [$ac_elftin])
AC_SUBST([cil_install], [$ac_cil_install])
AC_SUBST([liballocstool_cflags], [$LIBALLOCSTOOL_CFLAGS])
AC_SUBST([liballocs_ocaml_prefix], [$LIBALLOCS_OCAML_PREFIX])

AM_CONDITIONAL(DEBUG, [test "x$enable_debug" = "xyes"])
AM_CONDITIONAL(USE_FAKE_LIBUNWIND, [test "x$enable_fake_libunwind" = "xyes"])
Expand Down
Loading