|
50 | 50 | env = lib.optionalAttrs stdenv.isDarwin { |
51 | 51 | POSTGRES_LIB = "${postgresql}/lib"; |
52 | 52 | RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; |
53 | | - NIX_BUILD_CORES = "4"; # Limit parallel jobs |
54 | | - CARGO_BUILD_JOBS = "4"; # Limit cargo parallelism |
| 53 | + NIX_BUILD_CORES = "4"; |
| 54 | + CARGO_BUILD_JOBS = "4"; |
55 | 55 | }; |
| 56 | + |
56 | 57 | CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true; |
57 | 58 |
|
58 | 59 | postInstall = '' |
|
92 | 93 | inherit (postgresql.meta) platforms; |
93 | 94 | }; |
94 | 95 | } |
95 | | - // lib.optionalAttrs (builtins.compareVersions "1.4.4" version >= 0) { |
96 | | - # Fix bindgen error on aarch64-linux by using an older version of clang |
97 | | - bindgenHook = |
98 | | - let |
99 | | - nixos2211 = ( |
100 | | - import (builtins.fetchTarball { |
101 | | - url = "https://channels.nixos.org/nixos-22.11/nixexprs.tar.xz"; |
102 | | - sha256 = "1j7h75a9hwkkm97jicky5rhvzkdwxsv5v46473rl6agvq2sj97y1"; |
103 | | - }) { inherit system; } |
104 | | - ); |
105 | | - in |
106 | | - rustPlatform.bindgenHook.overrideAttrs { |
107 | | - libclang = nixos2211.clang.cc.lib; |
108 | | - clang = nixos2211.clang; |
109 | | - }; |
110 | | - } |
| 96 | + // |
| 97 | + lib.optionalAttrs |
| 98 | + ( |
| 99 | + # Fix bindgen error on aarch64-linux for versions using pgrx with bindgen 0.68.1 |
| 100 | + # This affects pgrx 0.6.1 through 0.11.3 which have issues with ARM NEON vector ABI |
| 101 | + # We apply the fix to all versions up to and including 1.5.7 (last version before 1.5.9 which uses 0.12.6) |
| 102 | + builtins.compareVersions "1.5.7" version >= 0 |
| 103 | + ) |
| 104 | + { |
| 105 | + # Fix bindgen error on aarch64-linux by using an older version of clang |
| 106 | + bindgenHook = |
| 107 | + let |
| 108 | + nixos2211 = ( |
| 109 | + import (builtins.fetchTarball { |
| 110 | + url = "https://channels.nixos.org/nixos-22.11/nixexprs.tar.xz"; |
| 111 | + sha256 = "1j7h75a9hwkkm97jicky5rhvzkdwxsv5v46473rl6agvq2sj97y1"; |
| 112 | + }) { inherit system; } |
| 113 | + ); |
| 114 | + in |
| 115 | + rustPlatform.bindgenHook.overrideAttrs { |
| 116 | + libclang = nixos2211.clang.cc.lib; |
| 117 | + clang = nixos2211.clang; |
| 118 | + }; |
| 119 | + } |
111 | 120 | // lib.optionalAttrs (builtins.compareVersions "1.2.0" version >= 0) { |
112 | 121 | # Add missing Cargo.lock |
113 | 122 | patches = [ ./0001-Add-missing-Cargo.lock-${version}.patch ]; |
|
0 commit comments