Skip to content

Commit 6c27141

Browse files
committed
Use architecture-independent wheels and confirm libpq is available at runtime #339
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent ec8c81a commit 6c27141

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

etc/scripts/build_nix_docker.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ def create_defualt_nix(dependencies_list, meta_dict):
227227
for component in url_section:
228228
if component.get("packagetype") == "bdist_wheel":
229229
whl_url = component.get("url")
230+
if (
231+
("cp313" not in whl_url and "py3" not in whl_url)
232+
or ("manylinux" not in whl_url and "-none-" not in whl_url)
233+
or ("any.whl" not in whl_url and "x86_64" not in whl_url)
234+
):
235+
continue
230236
whl_sha256 = get_sha256_hash(whl_url)
231237
nix_content += " " + name + " = buildCustomPackage {\n"
232238
nix_content += ' pname = "' + name + '";\n'
@@ -310,6 +316,16 @@ def create_defualt_nix(dependencies_list, meta_dict):
310316
pip
311317
];
312318
319+
# Add PostgreSQL to buildInputs to ensure libpq is available at runtime
320+
buildInputs = with pkgs; [
321+
postgresql
322+
];
323+
324+
# This wrapper ensures the PostgreSQL libraries are available at runtime
325+
makeWrapperArgs = [
326+
"--set LD_LIBRARY_PATH ${pkgs.postgresql.lib}/lib"
327+
];
328+
313329
propagatedBuildInputs = with pythonWithOverlay.pkgs; [
314330
"""
315331

0 commit comments

Comments
 (0)