Skip to content

Commit f380cdd

Browse files
committed
build: add meson build support to dev container
- Install meson 1.0.1 and ninja 1.10.1 from source - Add python3-setuptools, curl, unzip as dependencies - Document meson build in README.md
1 parent 7bcdd6f commit f380cdd

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

.devcontainer/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ ENV DEBIAN_FRONTEND=noninteractive
1010
RUN apt-get update && apt-get install -y \
1111
# Build tools
1212
build-essential git lcov bison flex pkg-config cppcheck \
13+
# For meson/ninja installation
14+
curl unzip \
1315
# Core dependencies
1416
libkrb5-dev libssl-dev libldap-dev libpam-dev \
1517
libxml2-dev libxslt-dev libreadline-dev libedit-dev \
1618
zlib1g-dev uuid-dev libossp-uuid-dev libuuid1 e2fsprogs \
1719
# ICU support
1820
libicu-dev \
1921
# Language support
20-
python3-dev tcl-dev libperl-dev gettext \
22+
python3-dev python3-setuptools tcl-dev libperl-dev gettext \
2123
# Perl test modules
2224
libipc-run-perl libtime-hires-perl libtest-simple-perl \
2325
# LLVM/Clang
@@ -34,6 +36,15 @@ RUN apt-get update && apt-get install -y \
3436
sudo tini \
3537
&& rm -rf /var/lib/apt/lists/*
3638

39+
# Install meson and ninja from source (matching workflow versions)
40+
RUN curl -L "https://github.com/mesonbuild/meson/releases/download/1.0.1/meson-1.0.1.tar.gz" -o /tmp/meson-1.0.1.tar.gz \
41+
&& curl -L "https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-linux.zip" -o /tmp/ninja-linux.zip \
42+
&& unzip -o /tmp/ninja-linux.zip -d /tmp \
43+
&& cp /tmp/ninja /usr/bin/ \
44+
&& tar xzf /tmp/meson-1.0.1.tar.gz -C /tmp \
45+
&& cd /tmp/meson-1.0.1 && python3 setup.py install \
46+
&& rm -rf /tmp/meson-1.0.1* /tmp/ninja*
47+
3748
# Set up locale
3849
RUN locale-gen en_US.UTF-8
3950
ENV LANG=en_US.UTF-8 \

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,25 @@ pg_ctl -D data_ora start
6262
make oracle-check
6363
```
6464

65+
### Meson Build (Alternative)
66+
67+
```bash
68+
# Enter the development container
69+
docker compose exec dev bash
70+
71+
# Configure with meson
72+
meson setup build -Dcassert=true -Dbuildtype=debug
73+
74+
# Build with ninja
75+
ninja -C build
76+
77+
# Run from build directory
78+
./build/src/backend/postgres --version
79+
```
80+
81+
Note: Meson requires a clean source tree. If you previously ran `./configure`,
82+
run `make distclean` first.
83+
6584
## Developer Formatting hooks and CI:
6685
- A pre-commit formatting hook is provided at `.githooks/pre-commit`. Enable it with `git config core.hooksPath .githooks`, or run `make code-format` (equivalently `bash tools/enable-git-hooks.sh`).
6786
- The hook depends only on in-tree tools `src/tools/pgindent` and `src/tools/pg_bsd_indent`. On commit it formats staged C/C++ files with pgindent and re-adds them to the staged area.

0 commit comments

Comments
 (0)