diff --git a/flake.lock b/flake.lock index 8dcb417..a7870fc 100644 --- a/flake.lock +++ b/flake.lock @@ -64,11 +64,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -123,11 +123,11 @@ ] }, "locked": { - "lastModified": 1709578243, - "narHash": "sha256-hF96D+c2PBmAFhymMw3z8hou++lqKtZ7IzpFbYeL1/Y=", + "lastModified": 1708988456, + "narHash": "sha256-RCz7Xe64tN2zgWk+MVHkzg224znwqknJ1RnB7rVqUWw=", "owner": "nix-community", "repo": "home-manager", - "rev": "23ff9821bcaec12981e32049e8687f25f11e5ef3", + "rev": "1d085ea4444d26aa52297758b333b449b2aa6fca", "type": "github" }, "original": { @@ -165,11 +165,11 @@ ] }, "locked": { - "lastModified": 1709295149, - "narHash": "sha256-+blV8vKyvh3gYnUFYTOu2yuWxEEBqwS7hfLm6qdpoe4=", + "lastModified": 1709142038, + "narHash": "sha256-ZjP808isgLwuiqxSU1CYFyafm5GF80aYw1CXJbnVsgs=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "0ef51034dcc8b65b8be72eedd0d5db7d426ea054", + "rev": "b83751a057acbb5f989193773841217ddc93d1f8", "type": "github" }, "original": { @@ -202,11 +202,11 @@ ] }, "locked": { - "lastModified": 1709428394, - "narHash": "sha256-WIDKofwDWFLHtk14MdBiRiM8Lxn+OByHYtybjSU/18Q=", + "lastModified": 1709045095, + "narHash": "sha256-6PeSdkt9Ey2k6yrRBpTFgS3RxTjyhRHZlR8hhy38xfQ=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "1f3fa3b398051c815e8500d4c4fe794ecfdee328", + "rev": "75625623631c294604b48035db5d95fe8ff08ef3", "type": "github" }, "original": { @@ -259,11 +259,11 @@ ] }, "locked": { - "lastModified": 1709435391, - "narHash": "sha256-s4itTkIVxn5lYeTzwkbAgl99atnjdZv1idI1118vdzA=", + "lastModified": 1708830466, + "narHash": "sha256-nGKe3Y1/jkLR2eh1aRSVBtKadMBNv8kOnB52UXqRy6A=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "93554c04c2f1c02f4a383538e8848d511c3129e9", + "rev": "f070c7eeec3bde8c8c8baa9c02b6d3d5e114d73b", "type": "github" }, "original": { @@ -279,11 +279,11 @@ ] }, "locked": { - "lastModified": 1709435391, - "narHash": "sha256-s4itTkIVxn5lYeTzwkbAgl99atnjdZv1idI1118vdzA=", + "lastModified": 1708830466, + "narHash": "sha256-nGKe3Y1/jkLR2eh1aRSVBtKadMBNv8kOnB52UXqRy6A=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "93554c04c2f1c02f4a383538e8848d511c3129e9", + "rev": "f070c7eeec3bde8c8c8baa9c02b6d3d5e114d73b", "type": "github" }, "original": { @@ -294,11 +294,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1709410583, - "narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=", + "lastModified": 1709110790, + "narHash": "sha256-qUk0G9vWX90beOKB1EtLFdeImXAujNi5SP5zTyIEATc=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc", + "rev": "01467901ec51dd92774040f2b3dff4f21f4e1c45", "type": "github" }, "original": { @@ -311,11 +311,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { @@ -328,11 +328,11 @@ }, "nixpkgs-raw": { "locked": { - "lastModified": 1709309926, - "narHash": "sha256-VZFBtXGVD9LWTecGi6eXrE0hJ/mVB3zGUlHImUs2Qak=", + "lastModified": 1708979614, + "narHash": "sha256-FWLWmYojIg6TeqxSnHkKpHu5SGnFP5um1uUjH+wRV6g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "79baff8812a0d68e24a836df0a364c678089e2c7", + "rev": "b7ee09cf5614b02d289cd86fcfa6f24d4e078c2a", "type": "github" }, "original": { @@ -343,11 +343,11 @@ }, "nixpkgs-unstable-raw": { "locked": { - "lastModified": 1709479366, - "narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", + "lastModified": 1708984720, + "narHash": "sha256-gJctErLbXx4QZBBbGp78PxtOOzsDaQ+yw1ylNQBuSUY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b8697e57f10292a6165a20f03d2f42920dfaf973", + "rev": "13aff9b34cc32e59d35c62ac9356e4a41198a538", "type": "github" }, "original": { @@ -358,11 +358,11 @@ }, "nur": { "locked": { - "lastModified": 1709620574, - "narHash": "sha256-gnnPCl6xxqtrZewW0H2oSi5BHJeYFaKRFXOWn9nMLSk=", + "lastModified": 1709144707, + "narHash": "sha256-RvJU+wWBs05ET56LSK8gXIC6vXZuKl9HewCezS1Ta2Q=", "owner": "nix-community", "repo": "NUR", - "rev": "3394dde2beb574b52a518806900da3fee4ad6010", + "rev": "a6e5afae495cf1dd3dcd1d89c672885fc5eb2688", "type": "github" }, "original": { @@ -381,11 +381,11 @@ ] }, "locked": { - "lastModified": 1709474138, - "narHash": "sha256-OWwiBEw6bdCOdOTDSfLbGmWDV2JhrglfV76qlD61eAQ=", + "lastModified": 1708970090, + "narHash": "sha256-z/8pJRiLfYqGQvIJj3xGqobygNkVSSGN6115pAEDNU4=", "owner": "pjones", "repo": "plasma-manager", - "rev": "8de2af1270b2a48f9f97880ae611c626379c860a", + "rev": "74fa336c22adf822c6ef13b21bfff18fbef66e9c", "type": "github" }, "original": { @@ -470,11 +470,11 @@ ] }, "locked": { - "lastModified": 1709601361, - "narHash": "sha256-mLK/kksj7yjF/N5tBWkK+/v0cRGgvt00fQYwLV4kGDs=", + "lastModified": 1709082883, + "narHash": "sha256-KIt4XTDspnUze/QUU8mqiHea3opOv9hXl91N2L8bAB0=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "568cdfed83f7bccf9189ac34991845f3fd469ddb", + "rev": "de410fd3d5915c9ac8ba5a3bd1464ba623933656", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index dd0146e..9fc8ba7 100644 --- a/flake.nix +++ b/flake.nix @@ -84,6 +84,7 @@ name = "patched-nixpkgs-unstable"; src = nixpkgs-unstable-raw; patches = [ + ./nixpkgs-patches/288913.patch ]; }; nixpkgs-patched = nixpkgs-raw.legacyPackages.x86_64-linux.applyPatches { diff --git a/nixpkgs-patches/288913.patch b/nixpkgs-patches/288913.patch new file mode 100644 index 0000000..6cbc106 --- /dev/null +++ b/nixpkgs-patches/288913.patch @@ -0,0 +1,309 @@ +From e62dac66f96a8b02b612d58438e1d11324083794 Mon Sep 17 00:00:00 2001 +From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> +Date: Wed, 14 Feb 2024 03:31:15 +0000 +Subject: [PATCH 1/3] duckdb,python311Packages.duckdb: 0.9.2 -> 0.10.0 + +--- + pkgs/development/libraries/duckdb/default.nix | 42 +++++++++++----- + .../libraries/duckdb/version.patch | 2 +- + .../python-modules/duckdb/default.nix | 48 ++++++++++++------- + .../python-modules/duckdb/setup.patch | 30 ------------ + 4 files changed, 62 insertions(+), 60 deletions(-) + delete mode 100644 pkgs/development/python-modules/duckdb/setup.patch + +diff --git a/pkgs/development/libraries/duckdb/default.nix b/pkgs/development/libraries/duckdb/default.nix +index 801ad7979aee91..e6645480d2b24a 100644 +--- a/pkgs/development/libraries/duckdb/default.nix ++++ b/pkgs/development/libraries/duckdb/default.nix +@@ -1,10 +1,13 @@ + { lib + , stdenv + , fetchFromGitHub ++, fetchpatch ++, substituteAll + , cmake + , ninja + , openssl + , openjdk11 ++, python3 + , unixODBC + , withJdbc ? false + , withOdbc ? false +@@ -15,22 +18,31 @@ let + in + stdenv.mkDerivation rec { + pname = "duckdb"; +- version = "0.9.2"; ++ version = "0.10.0"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; +- rev = "v${version}"; +- hash = "sha256-QFK8mEMcqQwALFNvAdD8yWixwMYHSbeo6xqx86PvejU="; ++ rev = "refs/tags/v${version}"; ++ hash = "sha256-qGUq0iYTaLNHKqbXNLRmvqHMqunvIlP991IKb4qdSt4="; + }; + +- patches = [ ./version.patch ]; +- +- postPatch = '' +- substituteInPlace CMakeLists.txt --subst-var-by DUCKDB_VERSION "v${version}" +- ''; ++ patches = [ ++ # remove calls to git and set DUCKDB_VERSION to version ++ (substituteAll { ++ src = ./version.patch; ++ version = "v${version}"; ++ }) ++ # add missing file needed for httpfs compile ++ # remove on next update ++ (fetchpatch { ++ name = "missing-httpfs-file.patch"; ++ url = "https://github.com/duckdb/duckdb/commit/3d7aa3ed46ecf5f18122559e385b75f1f5e9aba8.patch"; ++ hash = "sha256-Q4IHCpMpxn86OquUZdEF7P0nHEPOcWS0TQijTkvBYbQ="; ++ }) ++ ]; + +- nativeBuildInputs = [ cmake ninja ]; ++ nativeBuildInputs = [ cmake ninja python3 ]; + buildInputs = [ openssl ] + ++ lib.optionals withJdbc [ openjdk11 ] + ++ lib.optionals withOdbc [ unixODBC ]; +@@ -54,7 +66,7 @@ stdenv.mkDerivation rec { + + installCheckPhase = + let +- excludes = map (pattern: "exclude:'${pattern}'") [ ++ excludes = map (pattern: "exclude:'${pattern}'") ([ + "[s3]" + "Test closing database during long running query" + "Test using a remote optimizer pass in case thats important to someone" +@@ -91,16 +103,22 @@ stdenv.mkDerivation rec { + "[!hide]" + # this test apparently never terminates + "test/sql/copy/csv/auto/test_csv_auto.test" ++ # test expects installed file timestamp to be > 2024 ++ "test/sql/table_function/read_text_and_blob.test" ++ # can re-enable next update (broken for 0.10.0) ++ "test/sql/secrets/create_secret_non_writable_persistent_dir.test" ++ # https://github.com/duckdb/duckdb/issues/10722 ++ "test/sql/types/nested/list/list_aggregate_dict.test" + ] ++ lib.optionals stdenv.isAarch64 [ + "test/sql/aggregate/aggregates/test_kurtosis.test" + "test/sql/aggregate/aggregates/test_skewness.test" + "test/sql/function/list/aggregates/skewness.test" +- ]; ++ ]); + in + '' + runHook preInstallCheck + +- $PWD/test/unittest ${lib.concatStringsSep " " excludes} ++ ./test/unittest ${toString excludes} + + runHook postInstallCheck + ''; +diff --git a/pkgs/development/libraries/duckdb/version.patch b/pkgs/development/libraries/duckdb/version.patch +index f40785b430797b..122ad4295d41e9 100644 +--- a/pkgs/development/libraries/duckdb/version.patch ++++ b/pkgs/development/libraries/duckdb/version.patch +@@ -52,7 +52,7 @@ index 2b49e11288..0a4a69b9a0 100644 + - set(DUCKDB_DEV_ITERATION 0) + - set(DUCKDB_VERSION "v${DUCKDB_MAJOR_VERSION}.${DUCKDB_MINOR_VERSION}.${DUCKDB_PATCH_VERSION}-dev${DUCKDB_DEV_ITERATION}") + -endif() +-+set(DUCKDB_VERSION "@DUCKDB_VERSION@") +++set(DUCKDB_VERSION "@version@") + + message(STATUS "git hash ${GIT_COMMIT_HASH}, version ${DUCKDB_VERSION}") + +diff --git a/pkgs/development/python-modules/duckdb/default.nix b/pkgs/development/python-modules/duckdb/default.nix +index a7cd1aa36dd45f..fd197f9305d63d 100644 +--- a/pkgs/development/python-modules/duckdb/default.nix ++++ b/pkgs/development/python-modules/duckdb/default.nix +@@ -1,4 +1,5 @@ + { lib ++, stdenv + , buildPythonPackage + , duckdb + , fsspec +@@ -13,25 +14,24 @@ + }: + + buildPythonPackage rec { +- inherit (duckdb) pname version src; +- format = "setuptools"; +- +- # 1. let nix control build cores +- # 2. default to extension autoload & autoinstall disabled +- # 3. unconstrain setuptools_scm version +- patches = (duckdb.patches or []) ++ [ ./setup.patch ]; ++ inherit (duckdb) patches pname src version; ++ pyproject = true; + + postPatch = (duckdb.postPatch or "") + '' + # we can't use sourceRoot otherwise patches don't apply, because the patches apply to the C++ library + cd tools/pythonpkg + +- substituteInPlace setup.py --subst-var NIX_BUILD_CORES +- +- # avoid dependency on mypy +- rm tests/stubs/test_stubs.py ++ # 1. let nix control build cores ++ # 2. default to extension autoload & autoinstall disabled ++ substituteInPlace setup.py \ ++ --replace-fail "ParallelCompile()" 'ParallelCompile("NIX_BUILD_CORES")' \ ++ --replace-fail "define_macros.extend([('DUCKDB_EXTENSION_AUTOLOAD_DEFAULT', '1'), ('DUCKDB_EXTENSION_AUTOINSTALL_DEFAULT', '1')])" "" + ''; + +- BUILD_HTTPFS = 1; ++ env = { ++ BUILD_HTTPFS = 1; ++ DUCKDB_BUILD_UNITY = 1; ++ }; + + nativeBuildInputs = [ + pybind11 +@@ -52,21 +52,35 @@ buildPythonPackage rec { + pytestCheckHook + ]; + ++ # test flags from .github/workflows/Python.yml ++ pytestFlagsArray = [ ++ "--verbose" ++ ] ++ lib.optionals stdenv.isDarwin [ ++ "tests/fast" ++ ]; ++ ++ disabledTestPaths = [ ++ # avoid dependency on mypy ++ "tests/stubs/test_stubs.py" ++ ]; ++ + disabledTests = [ + # tries to make http request + "test_install_non_existent_extension" +- # test is racy and interrupt can be delivered before or after target point ++ ++ # https://github.com/duckdb/duckdb/issues/10702 ++ # tests are racy and interrupt can be delivered before or after target point ++ # causing a later test to fail with a spurious KeyboardInterrupt + "test_connection_interrupt" ++ "test_query_interruption" + ]; + ++ # remove duckdb dir to prevent import confusion by pytest + preCheck = '' + export HOME="$(mktemp -d)" ++ rm -rf duckdb + ''; + +- setupPyBuildFlags = [ +- "--inplace" +- ]; +- + pythonImportsCheck = [ + "duckdb" + ]; +diff --git a/pkgs/development/python-modules/duckdb/setup.patch b/pkgs/development/python-modules/duckdb/setup.patch +deleted file mode 100644 +index 8c8f790a66a1d1..00000000000000 +--- a/pkgs/development/python-modules/duckdb/setup.patch ++++ /dev/null +@@ -1,30 +0,0 @@ +-diff --git a/tools/pythonpkg/setup.py b/tools/pythonpkg/setup.py +-index 30f1e1ccdd..6784169fcb 100644 +---- a/tools/pythonpkg/setup.py +-+++ b/tools/pythonpkg/setup.py +-@@ -96,7 +96,7 @@ def parallel_cpp_compile( +- return +- self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) +- +-- list(multiprocessing.pool.ThreadPool(multiprocessing.cpu_count()).imap(_single_compile, objects)) +-+ list(multiprocessing.pool.ThreadPool(@NIX_BUILD_CORES@).imap(_single_compile, objects)) +- return objects +- +- +-@@ -163,7 +163,6 @@ if 'BUILD_HTTPFS' in os.environ: +- for ext in extensions: +- toolchain_args.extend(['-DDUCKDB_EXTENSION_{}_LINKED'.format(ext.upper())]) +- +--toolchain_args.extend(['-DDUCKDB_EXTENSION_AUTOLOAD_DEFAULT=1', '-DDUCKDB_EXTENSION_AUTOINSTALL_DEFAULT=1']) +- +- +- class get_pybind_include(object): +-@@ -348,7 +347,7 @@ setup( +- packages=packages, +- include_package_data=True, +- python_requires='>=3.7.0', +-- setup_requires=setup_requires + ["setuptools_scm<7.0.0", 'pybind11>=2.6.0'], +-+ setup_requires=setup_requires + ["setuptools_scm", 'pybind11>=2.6.0'], +- use_scm_version=setuptools_scm_conf, +- tests_require=['google-cloud-storage', 'mypy', 'pytest'], +- classifiers=[ + +From e72db5d1718ab74321efde3b05039e202677afae Mon Sep 17 00:00:00 2001 +From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> +Date: Wed, 14 Feb 2024 23:04:47 +0000 +Subject: [PATCH 2/3] python311Packages.duckdb-engine: 0.9.2 -> 0.11.1 + +--- + pkgs/development/python-modules/duckdb-engine/default.nix | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/pkgs/development/python-modules/duckdb-engine/default.nix b/pkgs/development/python-modules/duckdb-engine/default.nix +index ab82edb0893b7b..efdc1d10ace37c 100644 +--- a/pkgs/development/python-modules/duckdb-engine/default.nix ++++ b/pkgs/development/python-modules/duckdb-engine/default.nix +@@ -14,8 +14,8 @@ + + buildPythonPackage rec { + pname = "duckdb-engine"; +- version = "0.9.2"; +- format = "pyproject"; ++ version = "0.11.1"; ++ pyproject = true; + + disabled = pythonOlder "3.7"; + +@@ -23,7 +23,7 @@ buildPythonPackage rec { + repo = "duckdb_engine"; + owner = "Mause"; + rev = "refs/tags/v${version}"; +- hash = "sha256-T02nGF+YlughRQPinb0I3NC6xsarh4+qRhG8YfhTvhI="; ++ hash = "sha256-GMtQtcKEn2mdryl1KMYnYYeGpdbowP3o4dStwuL8AcU="; + }; + + patches = [ ./remote_data.patch ]; + +From fc7168d8d918b9a8fd11f0c27685b31d9a571f26 Mon Sep 17 00:00:00 2001 +From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> +Date: Wed, 14 Feb 2024 23:14:49 +0000 +Subject: [PATCH 3/3] python311Packages.sqlglot: 20.9.0 -> 21.1.1 + +--- + pkgs/development/python-modules/sqlglot/default.nix | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pkgs/development/python-modules/sqlglot/default.nix b/pkgs/development/python-modules/sqlglot/default.nix +index f02a32d0f64f86..7eb9ee70eca91b 100644 +--- a/pkgs/development/python-modules/sqlglot/default.nix ++++ b/pkgs/development/python-modules/sqlglot/default.nix +@@ -11,7 +11,7 @@ + + buildPythonPackage rec { + pname = "sqlglot"; +- version = "20.9.0"; ++ version = "21.1.1"; + pyproject = true; + + disabled = pythonOlder "3.8"; +@@ -20,7 +20,7 @@ buildPythonPackage rec { + repo = "sqlglot"; + owner = "tobymao"; + rev = "refs/tags/v${version}"; +- hash = "sha256-4czhmAJUDRj0x8dCmIXg5BQ1Uvie5vx+UtWdSSY5mnM="; ++ hash = "sha256-xMKDkhotVBkLzn+f9RMGCPfWTF4Rz9a193nSJv5z+iA="; + }; + + nativeBuildInputs = [