build with clang/libc++ #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PGXS | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
pgxs-build: | |
name: Build | |
runs-on: ubuntu-latest | |
env: | |
CC: clang-21 | |
CXX: clang++-21 | |
CXXFLAGS: -stdlib=libc++ | |
LDFLAGS: -stdlib=libc++ | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
build-essential \ | |
pkg-config \ | |
libjwt-dev \ | |
libcurl4-openssl-dev \ | |
libssl-dev \ | |
libreadline-dev \ | |
zlib1g-dev \ | |
libxml2-dev \ | |
libxslt1-dev \ | |
uuid-dev \ | |
flex \ | |
bison | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 21 all | |
sudo apt-get install libc++-21-dev libc++abi-21-dev | |
- name: Checkout PostgreSQL source | |
uses: actions/checkout@v4 | |
with: | |
repository: postgres/postgres | |
ref: REL_18_STABLE | |
path: pg-source | |
- name: Configure and build PostgreSQL | |
run: | | |
cd pg-source | |
./configure \ | |
--prefix=/usr/local/pgsql \ | |
--enable-debug \ | |
--enable-cassert | |
make -j$(nproc) | |
- name: Install PostgreSQL | |
run: | | |
cd pg-source | |
sudo make install | |
sudo ldconfig | |
- name: Add PostgreSQL binaries to PATH | |
run: | | |
echo "/usr/local/pgsql/bin" >> $GITHUB_PATH | |
- name: Checkout pg_oauth extension | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Build pg_oauth with PGXS | |
run: | | |
export USE_PGXS=1 | |
export PG_CONFIG=/usr/local/pgsql/bin/pg_config | |
make -j | |
- name: Install pg_oauth extension | |
run: | | |
export USE_PGXS=1 | |
export PG_CONFIG=/usr/local/pgsql/bin/pg_config | |
sudo make install |