this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

switch to psybin

+14 -91
+14 -91
.tangled/workflows/build.yml
··· 29 29 - jq 30 30 - skopeo 31 31 - nix 32 - - postgresql_15 33 - - postgresql_15.pg_config # pg_config is a separate output in nixpkgs 25.05+ / unstable 32 + - postgresql_15 # libs/headers only — pg_config not included in this nixpkgs snapshot 34 33 - libffi 35 34 - openjpeg 36 35 - pango ··· 139 138 python3 -m venv .venv 140 139 141 140 # ----------------------------------------------------------------- 142 - # psycopg_c build fix 141 + # psycopg build strategy 143 142 # 144 - # In nixpkgs 25.05+ / unstable, pg_config was split into a separate 145 - # output (postgresql_15.pg_config). We list it explicitly in the 146 - # dependencies so it's on PATH automatically via the Nix profile. 143 + # pg_config is not present in the postgresql_15 package in the 144 + # Nixery nixpkgs snapshot used here — it was split into a separate 145 + # output that Nixery's dependency syntax can't address (dotted 146 + # attribute paths like postgresql_15.pg_config silently do nothing). 147 147 # 148 - # We still use --no-build-isolation for psycopg[c] because pip's 149 - # PEP 517 build-isolation spawns an isolated subprocess with its 150 - # own PATH overlay that can shadow the profile PATH. Building 151 - # without isolation ensures our env vars (PG_CONFIG, PATH, 152 - # LDFLAGS, CPPFLAGS) are visible to the build backend. 148 + # Fix: pre-install psycopg[binary] (a self-contained wheel that 149 + # bundles its own libpq — no pg_config, no compilation required). 150 + # Pipenv will then see psycopg as already satisfied and skip the 151 + # source build for psycopg_c. 153 152 # ----------------------------------------------------------------- 154 - echo "=== Locating pg_config ===" 155 - 156 - PG_CONFIG_BIN="" 157 - 158 - # Try 1: already on PATH (expected — postgresql_15.pg_config is in dependencies) 159 - PG_CONFIG_BIN="$(command -v pg_config 2>/dev/null || true)" 160 - 161 - # Try 2: common Nix profile locations 162 - if [ -z "$PG_CONFIG_BIN" ]; then 163 - for p in /nix/var/nix/profiles/default/bin/pg_config \ 164 - /run/current-system/sw/bin/pg_config \ 165 - ~/.nix-profile/bin/pg_config; do 166 - if [ -x "$p" ]; then PG_CONFIG_BIN="$p"; break; fi 167 - done 168 - fi 169 - 170 - # Try 3: brute-force search the Nix store 171 - if [ -z "$PG_CONFIG_BIN" ]; then 172 - PG_CONFIG_BIN="$(find /nix/store -maxdepth 4 -name pg_config -type f -executable 2>/dev/null | head -1)" 173 - fi 174 - 175 - echo " pg_config resolved to: ${PG_CONFIG_BIN:-NOT FOUND}" 176 - 177 - if [ -z "$PG_CONFIG_BIN" ]; then 178 - echo "ERROR: pg_config not found anywhere in the system!" 179 - echo " Nix store postgresql entries:" 180 - ls -d /nix/store/*postgresql* 2>/dev/null | head -10 || echo " (none)" 181 - echo "" 182 - echo " Full /nix/store bin search:" 183 - find /nix/store -maxdepth 4 -name 'pg_config' 2>/dev/null || echo " (none)" 184 - echo "" 185 - echo " Current PATH: $PATH" 186 - echo "" 187 - echo "psycopg_c build WILL fail." 188 - exit 1 189 - fi 190 - 191 - PG_INCLUDEDIR="$($PG_CONFIG_BIN --includedir)" 192 - PG_LIBDIR="$($PG_CONFIG_BIN --libdir)" 193 - PG_BINDIR="$(dirname "$PG_CONFIG_BIN")" 194 - PG_SERVER_INCLUDEDIR="$($PG_CONFIG_BIN --includedir-server 2>/dev/null || echo "$PG_INCLUDEDIR")" 195 - 196 - # --- Symlink into well-known dirs (create them if missing) --- 197 - for d in /usr/local/bin /usr/bin; do 198 - mkdir -p "$d" 2>/dev/null || true 199 - ln -sf "$PG_CONFIG_BIN" "$d/pg_config" 2>/dev/null || true 200 - done 201 - 202 - # --- PATH: prepend pg_config's directory --- 203 - export PATH="${PG_BINDIR}:/usr/local/bin:${PATH}" 204 - 205 - # --- Compiler / linker flags --- 206 - export PG_CONFIG="$PG_CONFIG_BIN" 207 - export LDFLAGS="${LDFLAGS:-} -L${PG_LIBDIR}" 208 - export CPPFLAGS="${CPPFLAGS:-} -I${PG_INCLUDEDIR} -I${PG_SERVER_INCLUDEDIR}" 209 - 210 - echo " PG_CONFIG = $PG_CONFIG" 211 - echo " PG_BINDIR = $PG_BINDIR" 212 - echo " PG_INCLUDEDIR = $PG_INCLUDEDIR" 213 - echo " PG_SERVER_INCLUDEDIR = $PG_SERVER_INCLUDEDIR" 214 - echo " PG_LIBDIR = $PG_LIBDIR" 215 - echo " LDFLAGS = $LDFLAGS" 216 - echo " CPPFLAGS = $CPPFLAGS" 217 - echo " PATH (first 3) = $(echo "$PATH" | tr ':' '\n' | head -3 | tr '\n' ':')" 153 + echo "=== Pre-installing psycopg binary wheel ===" 154 + .venv/bin/pip install --upgrade pip 155 + .venv/bin/pip install "psycopg[binary]" 156 + echo "psycopg binary install: OK" 218 157 echo "" 219 158 220 - # --- Verify pg_config is globally callable --- 221 - echo " Smoke test (command -v): $(command -v pg_config 2>&1 || echo FAIL)" 222 - echo " Smoke test (version): $($PG_CONFIG_BIN --version)" 223 - echo "" 224 - 225 - # --- Step 1: Pre-install psycopg[c] build deps and build it 226 - # with --no-build-isolation so our env vars (PG_CONFIG, PATH, 227 - # LDFLAGS, CPPFLAGS) are visible to the build backend. 228 - # This bypasses pip's isolated subprocess that loses PATH. --- 229 - echo "=== Pre-installing psycopg[c] with --no-build-isolation ===" 230 - .venv/bin/pip install setuptools wheel 231 - .venv/bin/pip install --no-build-isolation "psycopg[c]" 232 - echo "" 233 - 234 - # --- Step 2: Install remaining production dependencies via pipenv. 235 - # psycopg[c] is already installed so pipenv will skip rebuilding it. --- 236 159 echo "=== Installing production dependencies ===" 237 160 pipenv install --deploy --categories "packages" 238 161