summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Angulo <iam@alejandr0angul0.dev>2023-02-20 09:34:25 -0800
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2023-03-02 22:55:38 +0000
commit8421c0546c875109ad9230cb5ada709382184885 (patch)
tree5fe09472ab3238f41ab27a79b637677cc648a6ef
parentMerge pull request #217694 from NixOS/backport-214746-to-release-22.11 (diff)
downloadnixpkgs-origin/backport-217341-to-release-22.11.tar.gz
ldb: copy cross fix from teventorigin/backport-217341-to-release-22.11
Saw the following while building on an x86_64-linux host for an armv6l-linux target: ``` Testing pyembed configuration: Could not build a python embedded interpreter ``` I dug into the config log and this seemed to be cause of the issue: ``` ['armv6l-unknown-linux-gnueabihf-gcc', '-MMD', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '-g', '-fwrapv', '-O3', '-I/nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10', '-I/nix/store/kaiinm7cjirmv4zd3pdqa r23rsypfqlh-libxcrypt-4.4.33/include', '-DNDEBUG', '../../test.c', '-c', '-o/build/ldb-2.6.1/bin/.conf_check_59d3a0a5b9 6e327858e281d280fec4ed/testbuild/default/test.c.1.o'] err: In file included from /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/Python.h:8, from ../../test.c:432: /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyconfig.h:1480: warning: "SIZEOF_LONG" r edefined 1480 | #define SIZEOF_LONG 8 | ../../test.c:154: note: this is the location of the previous definition 154 | #define SIZEOF_LONG 4 | /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyconfig.h:1504: warning: "SIZEOF_SIZE_T" redefined 1504 | #define SIZEOF_SIZE_T 8 | ../../test.c:156: note: this is the location of the previous definition 156 | #define SIZEOF_SIZE_T 4 | /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyconfig.h:1507: warning: "SIZEOF_TIME_T" redefined 1507 | #define SIZEOF_TIME_T 8 | ../../test.c:170: note: this is the location of the previous definition 170 | #define SIZEOF_TIME_T 4 | /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyconfig.h:1513: warning: "SIZEOF_VOID_P" redefined 1513 | #define SIZEOF_VOID_P 8 | ../../test.c:166: note: this is the location of the previous definition 166 | #define SIZEOF_VOID_P 4 | In file included from /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/Python.h:50: /nix/store/0pyymzxf7n0fzpaqnvwv92ab72v3jq8d-python3-3.10.9/include/python3.10/pyport.h:746:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." 746 | #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." | ^~~~~ ``` (cherry picked from commit 4c296f58dff81cabe74ab6ac82e5edfef4e25916)
-rw-r--r--pkgs/development/libraries/ldb/default.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/development/libraries/ldb/default.nix b/pkgs/development/libraries/ldb/default.nix
index bdd630103e37..234ec77a4a5d 100644
--- a/pkgs/development/libraries/ldb/default.nix
+++ b/pkgs/development/libraries/ldb/default.nix
@@ -63,6 +63,11 @@ stdenv.mkDerivation rec {
"--without-ldb-lmdb"
];
+ # python-config from build Python gives incorrect values when cross-compiling.
+ # If python-config is not found, the build falls back to using the sysconfig
+ # module, which works correctly in all cases.
+ PYTHON_CONFIG = "/invalid";
+
stripDebugList = [ "bin" "lib" "modules" ];
meta = with lib; {