Skip to content

Commit

Permalink
Merge pull request #2 from couchbasedeps/couchbase-26.2
Browse files Browse the repository at this point in the history
Couchbase 26.2
  • Loading branch information
stevewatanabe committed Jan 25, 2024
2 parents 099f7ed + a017a60 commit 0fe80fa
Show file tree
Hide file tree
Showing 14,169 changed files with 2,748,825 additions and 1,666,438 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/cpp
{
"name": "Erlang/OTP",
"build": {
"dockerfile": "../.github/dockerfiles/Dockerfile.ubuntu-base",
"context": "../.github",
"args": {
"BASE": "mcr.microsoft.com/vscode/devcontainers/base:focal",
"USER": "vscode",
"GROUP": "vscode"
}
},
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cpptools",
"erlang-ls.erlang-ls" ],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
14 changes: 14 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
;; Project-wide Emacs settings
(
(erlang-mode (indent-tabs-mode . nil))
(autoconf-mode (indent-tabs-mode . nil))
(m4-mode (indent-tabs-mode . nil))
(java-mode (indent-tabs-mode . nil))
(perl-mode (indent-tabs-mode . nil))
(xml-mode (indent-tabs-mode . nil))
(c++-mode
(indent-tabs-mode . nil)
(c-basic-offset . 4))
(c-mode
(indent-tabs-mode . nil)
(c-basic-offset . 4)))
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://EditorConfig.org
;
; To use this from emacs install the editorconfig package

root = true

[*]
end_of_line = LF

[*]
indent_style = space
indent_size = 4
tab_width = 8
insert_final_newline = true
# Adding trim_trailing_whitespace removes trailing
# from entire buffer on save and we do not want that
# trim_trailing_whitespace = true

[{Makefile*,**.mk*}]
# Use tabs for indentation (Makefiles require tabs)
indent_style = tab
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Affected versions**
The OTP versions that are affected by this bug.

**Additional context**
Add any other context about the problem here. If you wish to attach Erlang code you can either write it directly in the post using [code tags](https://guides.github.com/features/mastering-markdown/), create a [gist](https://gist.github.com), or attach it as a zip file to this post.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
67 changes: 67 additions & 0 deletions .github/actions/build-base-image/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Base Image
description: 'Builds the base testing image (using cache if possible)'

inputs:
BASE_BRANCH:
required: true
TYPE:
default: '64-bit'
BUILD_IMAGE:
default: true
github_token:
description: 'GITHUB_TOKEN'
default: '${{ github.token }}'

runs:
using: composite
steps:
- name: Cleanup GH Runner
shell: bash -euxo pipefail {0}
run: |
## Delete large files from runner to get more disk space
## See https://github.com/actions/runner-images/issues/2840
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Cache BASE image
uses: actions/cache@v3
if: inputs.TYPE == '64-bit' || inputs.TYPE == 'clang'
with:
path: otp_docker_base.tar
key: ${{ runner.os }}-${{ hashFiles('.github/dockerfiles/Dockerfile.ubuntu-base', '.github/scripts/build-base-image.sh') }}-${{ hashFiles('OTP_VERSION') }}

- name: Docker login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ inputs.github_token }}

- name: Build BASE image
shell: bash
run: .github/scripts/build-base-image.sh "${{ inputs.BASE_BRANCH }}" "${{ inputs.TYPE }}"

- name: Cache pre-built src
if: inputs.BUILD_IMAGE == 'true'
uses: actions/cache@v3
with:
path: otp_src.tar.gz
key: prebuilt-src-${{ github.ref_name }}-${{ github.sha }}
- name: Cache pre-built binaries
if: inputs.BUILD_IMAGE == 'true'
uses: actions/cache@v3
with:
path: otp_cache.tar.gz
key: prebuilt-cache-${{ inputs.TYPE }}-${{ github.ref_name }}-${{ github.sha }}
- name: Build image
if: inputs.BUILD_IMAGE == 'true'
shell: bash -euxo pipefail {0}
run: |
.github/scripts/restore-from-prebuilt.sh `pwd` .github/otp.tar.gz
rm -f otp_{src,cache}.tar.gz
docker build --tag otp \
--build-arg MAKEFLAGS=-j$(($(nproc) + 2)) \
--file ".github/dockerfiles/Dockerfile.${{ inputs.TYPE }}" \
.github/
24 changes: 24 additions & 0 deletions .github/dockerfiles/Dockerfile.32-bit
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG BASE=ghcr.io/erlang/otp/i386-debian-base
FROM $BASE

ARG MAKEFLAGS=-j4
ENV MAKEFLAGS=$MAKEFLAGS \
ERLC_USE_SERVER=yes \
ERL_TOP=/buildroot/otp \
PATH=/buildroot/otp/bin:$PATH

ARG ARCHIVE=./otp.tar.gz
COPY $ARCHIVE /buildroot/otp.tar.gz
RUN cd /buildroot && tar -xzf ./otp.tar.gz

WORKDIR /buildroot/otp/

ENV CFLAGS="-O2 -g -Werror"

## Configure, check that no application are disabled, then make and then build doc chunks
RUN ./configure --with-ssl --prefix=/otp && \
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
make && make install

## Disable -Werror as testcases do not compile with it on
ENV CFLAGS="-O2 -g"
35 changes: 35 additions & 0 deletions .github/dockerfiles/Dockerfile.64-bit
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ARG BASE=ghcr.io/erlang/otp/ubuntu-base
FROM $BASE

ARG MAKEFLAGS=$MAKEFLAGS
ENV MAKEFLAGS=$MAKEFLAGS \
ERL_TOP=/buildroot/otp \
PATH="/Erlang ∅⊤℞/bin":/buildroot/otp/bin:$PATH

ARG ARCHIVE=./otp.tar.gz
COPY $ARCHIVE /buildroot/otp.tar.gz
RUN cd /buildroot && tar -xzf ./otp.tar.gz

WORKDIR /buildroot/otp/

ENV CFLAGS="-O2 -g -Werror"

## Configure (if not cached), check that no application are disabled and then make
RUN if [ ! -f Makefile ]; then \
touch README.md && \
./configure --prefix="/Erlang ∅⊤℞" && \
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
find . -type f -newer README.md | xargs tar --transform 's:^./:otp/:' -cf ../otp_cache.tar; \
fi && \
make && make docs DOC_TARGETS=chunks && \
sudo make install install-docs DOC_TARGETS=chunks

## Disable -Werror as testcases do not compile with it on
ENV CFLAGS="-O2 -g"

## Update init.sh with correct env vars
RUN echo "export MAKEFLAGS=$MAKEFLAGS" > /buildroot/env.sh && \
echo "export ERLC_USE_SERVER=$ERLC_USE_SERVER" >> /buildroot/env.sh && \
echo "export ERL_TOP=\"$ERL_TOP\"" >> /buildroot/env.sh && \
echo "export PATH=\"$PATH\"" >> /buildroot/env.sh && \
echo "export ERL_LIBS=\"$ERL_LIBS\"" >> /buildroot/env.sh
32 changes: 32 additions & 0 deletions .github/dockerfiles/Dockerfile.clang
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ARG BASE=ghcr.io/erlang/otp/ubuntu-base
FROM $BASE
## We do a SSA lint check here
ENV ERL_COMPILER_OPTIONS=ssalint

ARG MAKEFLAGS=-j4
ENV MAKEFLAGS=$MAKEFLAGS \
ERLC_USE_SERVER=yes \
ERL_TOP=/buildroot/otp \
PATH=/otp/bin:/buildroot/otp/bin:$PATH

RUN sudo apt-get update && sudo apt-get install -y clang

ARG ARCHIVE=./otp.tar.gz
COPY $ARCHIVE /buildroot/otp.tar.gz
RUN cd /buildroot && tar -xzf ./otp.tar.gz

WORKDIR /buildroot/otp/

ENV CC=clang CXX=clang++ \
CFLAGS="-O2 -g -Werror"

## Configure, check that no application are disabled and then make
# We need --with-ssl-lib-subdir=lib/x86_64-linux-gnu since clang does not
# give us this information such as gcc does...
RUN ./configure --with-ssl --with-ssl-lib-subdir=lib/x86_64-linux-gnu --prefix=/otp && \
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
make && sudo make install && \
make FLAVOR=emu && sudo make install FLAVOR=emu

## Disable -Werror as testcases do not compile with it on
ENV CFLAGS="-O2 -g"
61 changes: 61 additions & 0 deletions .github/dockerfiles/Dockerfile.cross-compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
##
## This docker file will build Erlang on 32-bit to 64-bit x86
##
ARG BASE=ghcr.io/erlang/otp/i386-debian-base
FROM $BASE as build

ARG MAKEFLAGS=-j4
ENV MAKEFLAGS=$MAKEFLAGS \
ERLC_USE_SERVER=yes \
ERL_TOP=/buildroot/bootstrap/otp

WORKDIR /buildroot/bootstrap

ARG ARCHIVE=./otp.tar.gz
COPY $ARCHIVE /buildroot/otp.tar.gz
RUN tar xzf ../otp.tar.gz

## Build the bootstrap system
RUN cd $ERL_TOP && CFLAGS="-Wall -O2 -g" ./configure && make && make install

ENV HOST=$HOST_TRIP \
CC=$HOST_TRIP-gcc \
CPPFLAGS="--sysroot=/buildroot/sysroot" \
CFLAGS="--sysroot=/buildroot/sysroot -O2 -g -Werror" \
CPP=$HOST_TRIP-cpp \
CXX=$HOST_TRIP-g++ \
LD=$CC \
LD_FLAGS="--sysroot=/buildroot/sysroot" \
DED_CFLAGS="$CFLAGS" \
DED_LDFLAGS="$LDFLAGS -shared -Wl,-Bsymbolic" \
RANLIB=$HOST_TRIP-ranlib \
AR=$HOST_TRIP-ar \
erl_xcomp_sysroot=/buildroot/sysroot \
ERL_TOP=/buildroot/otp

RUN cd /buildroot && tar xzf otp.tar.gz

WORKDIR /buildroot/otp

## Build the cross system
# We cannot use config.guess for --build since its value clashes with the
# canonical value of host...
RUN ./configure --prefix=/otp/ --host=$HOST --build=x86-pc-linux-gnu && \
OTP_SMALL_BUILD=true V=1 make && \
make install

## Build the cross tests
ENV CFLAGS="--sysroot=/buildroot/sysroot -O2 -g"
RUN ./otp_build tests
RUN cd release/tests/test_server && \
erl -sname test@docker -noshell \
-eval "ts:install([{cross,\"yes\"},{crossflags,[{\"host\",\"$HOST\"}]},{crossroot,\"/$ERL_TOP\"}])." \
-s ts compile_testcases -s init stop

FROM debian as install

# Install the released application
COPY --from=build /otp /otp
COPY --from=build /buildroot/otp/release/tests /tests

ENV PATH=/otp/bin:$PATH
46 changes: 46 additions & 0 deletions .github/dockerfiles/Dockerfile.debian-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
##
## This docker file will build a base image for building Erlang/OTP
##
ARG BASE=debian:bullseye
FROM $BASE
## Need to have a second arg here as the first does not expose the $BASE in the script below
ARG BASE=debian:bullseye

ARG HOST_TRIP=x86_64-linux-gnu
ENV HOST_TRIP=$HOST_TRIP
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

ENV INSTALL_LIBS="zlib1g-dev libncurses5-dev libssl-dev unixodbc-dev libgmp3-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libsctp-dev lksctp-tools"
ENV CROSS_LIBS="zlib1g-dev libncurses5-dev libssl-dev unixodbc-dev libgmp3-dev libwxgtk3.0-gtk3-dev libsctp-dev lksctp-tools"

## See https://wiki.debian.org/Multiarch/HOWTO for details on how to install things
##
## 1. Install build-essential to get access to dpkg-architecture
## 2. Use dpkg-architecture to figure out what we are running on
## 3. If the HOST_TRIP does not equal BUILD_TRIP we should cross compile
RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential && \
BUILD_TRIP=`dpkg-architecture -t${HOST_TRIP} -qDEB_BUILD_MULTIARCH` && \
BUILD_ARCH=`dpkg-architecture -t${HOST_TRIP} -qDEB_BUILD_ARCH` && \
if [ "$HOST_TRIP" != "$BUILD_TRIP" ]; then \
HOST_ARCH=`dpkg-architecture -t${HOST_TRIP} -qDEB_HOST_ARCH` && \
dpkg --add-architecture $HOST_ARCH && \
sed -i "s:deb http:deb [arch=$BUILD_ARCH,$HOST_ARCH] http:g" /etc/apt/sources.list; \
fi && \
apt-get update && \
apt-get install -y build-essential m4 autoconf fop xsltproc default-jdk libxml2-utils \
$INSTALL_LIBS && \
if [ "$HOST_TRIP" != "$BUILD_TRIP" ]; then \
apt-get install -y -f \
crossbuild-essential-$HOST_ARCH \
$(for LIB in $CROSS_LIBS; do echo "$LIB:$HOST_ARCH"; done) && \
for dir in `find / -type d -name $HOST_TRIP`; do \
echo -n "$dir: /buildroot/sysroot"; \
echo `dirname $dir`; \
mkdir -p /buildroot/sysroot$dir; \
cp -r `dirname $dir`/* `dirname /buildroot/sysroot$dir`; \
cp -r $dir/* `dirname /buildroot/sysroot$dir`; \
done; \
fi && \
update-alternatives --set wx-config /usr/lib/${BUILD_TRIP}/wx/config/gtk3-unicode-3.0 && \
rm -rf /var/lib/apt/lists/*
Loading

0 comments on commit 0fe80fa

Please sign in to comment.