Skip to content

Commit 32283e4

Browse files
authored
Enable readline support in postgres build; some cleanup (#5)
1 parent 7a65c92 commit 32283e4

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

.github/workflows/build-and-test.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v4
3535
- uses: actions/setup-python@v4
36-
if: matrix.os != 'ubuntu-latest'
36+
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
3737
with:
3838
python-version: '3.10'
3939
- uses: actions/setup-python@v4
40-
if: matrix.os == 'ubuntu-latest'
40+
if: ${{ startsWith(matrix.os, 'ubuntu') }}
4141
# for testing due to docker env issues
4242
with:
4343
python-version: '3.9'
@@ -46,7 +46,7 @@ jobs:
4646
python -m pip install --upgrade pip
4747
python -m pip install --upgrade cibuildwheel
4848
- name: Restore postgres build from cache
49-
if: ${{ matrix.os != 'ubuntu-latest' }}
49+
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
5050
id: restore-postgres
5151
uses: actions/cache/restore@v3
5252
env:
@@ -58,14 +58,14 @@ jobs:
5858
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{
5959
hashFiles('Makefile', 'pgbuild/Makefile', '.github/workflows/build-and-test.yml') }}
6060
- name: Build postgres and pgvector
61-
if: ${{ matrix.os != 'ubuntu-latest' && ! steps.restore-postgres.outputs.cache-hit }}
61+
if: ${{ !startsWith(matrix.os, 'ubuntu') && !steps.restore-postgres.outputs.cache-hit }}
62+
# Run `make` now so that we may cache the postgres build before running cibuildwheel
63+
# (On Linux cibuildwheel runs in a docker container, so this won't work)
6264
env:
6365
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment-target }}
64-
# this step is implied by Build wheels, but we do it here for caching before python tests run
65-
# on ubuntu, cibuildwheel will run this step within a docker container, so it cannot use the cache this way
6666
run: make
6767
- name: Save postgres build
68-
if: ${{ matrix.os != 'ubuntu-latest' && ! steps.restore-postgres.outputs.cache-hit }}
68+
if: ${{ !startsWith(matrix.os, 'ubuntu') && !steps.restore-postgres.outputs.cache-hit }}
6969
id: cache-postgres
7070
uses: actions/cache/save@v3
7171
env:
@@ -82,18 +82,6 @@ jobs:
8282
CIBW_SKIP: pp* cp313-* *-musllinux*
8383
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment-target }}
8484
run: python -m cibuildwheel --output-dir wheelhouse
85-
- name: Save postgres build
86-
if: ${{ matrix.os == 'ubuntu-latest' && ! steps.restore-postgres.outputs.cache-hit }}
87-
id: cache-postgres2
88-
uses: actions/cache/save@v3
89-
env:
90-
cache-name: cache-postgres
91-
with:
92-
path: |
93-
pgbuild
94-
src/pixeltable_pgserver/pginstall
95-
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{
96-
hashFiles('Makefile', 'pgbuild/Makefile', '.github/workflows/build-and-test.yml') }}
9785
- uses: actions/upload-artifact@v3
9886
with:
9987
path: wheelhouse/*.whl

pgbuild/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $(POSTGRES_SRC)/configure: $(POSTGRES_SRC).tar.gz
2222
## configure
2323
$(POSTGRES_BLD)/config.status: $(POSTGRES_SRC)/configure
2424
mkdir -p $(POSTGRES_BLD)
25-
cd $(POSTGRES_BLD) && ../$(POSTGRES_SRC)/configure --prefix=$(INSTALL_PREFIX) --without-readline --without-icu
25+
cd $(POSTGRES_BLD) && ../$(POSTGRES_SRC)/configure --prefix=$(INSTALL_PREFIX) --without-icu
2626

2727
## build
2828
# https://stackoverflow.com/questions/68379786/

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "pixeltable-pgserver"
9-
version = "0.2.2"
9+
version = "0.2.3"
1010
description = "Embedded Postgres Server for Pixeltable"
1111
readme = "README.md"
1212
requires-python = ">=3.9"
@@ -42,3 +42,6 @@ testpaths = ["tests"]
4242
before-all = "make"
4343
test-extras = "test"
4444
test-command = "bash -x {project}/cibuildwheel_test.bash {project}"
45+
46+
[tool.cibuildwheel.linux]
47+
before-all = "yum install -y readline-devel; make"

0 commit comments

Comments
 (0)