Unverified Commit 1ee93b20 authored by Pavol Rusnak's avatar Pavol Rusnak
Browse files

python3Packages.xgrammar: 0.1.23 -> 0.1.24

parent 52325440
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
  scikit-build-core,

  # dependencies
  mlx-lm,
  pydantic,
  sentencepiece,
  tiktoken,
@@ -25,7 +26,7 @@

buildPythonPackage rec {
  pname = "xgrammar";
  version = "0.1.23";
  version = "0.1.24";
  pyproject = true;

  src = fetchFromGitHub {
@@ -33,7 +34,7 @@ buildPythonPackage rec {
    repo = "xgrammar";
    tag = "v${version}";
    fetchSubmodules = true;
    hash = "sha256-asyxJsrsbfFNh1pLBDzM4kdmunQp7/mTDw3L8KuZf4g=";
    hash = "sha256-K+GCHuWKF449JaGWr7FQrDeJS3pxmVKnGf68L53LrK0=";
  };

  patches = [
@@ -57,6 +58,9 @@ buildPythonPackage rec {
  ]
  ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [
    triton
  ]
  ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
    mlx-lm
  ];

  nativeCheckInputs = [
@@ -64,10 +68,10 @@ buildPythonPackage rec {
    writableTmpDirAsHomeHook
  ];

  NIX_CFLAGS_COMPILE = toString [
  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux (toString [
    # xgrammar hardcodes -flto=auto while using static linking, which can cause linker errors without this additional flag.
    "-ffat-lto-objects"
  ];
  ]);

  disabledTests = [
    # You are trying to access a gated repo.
@@ -98,10 +102,6 @@ buildPythonPackage rec {
    badPlatforms = [
      # error: ‘operator delete’ called on unallocated object ‘result’ [-Werror=free-nonheap-object]
      "aarch64-linux"

      # clang++: error: unsupported option '-ffat-lto-objects' for target 'arm64-apple-darwin'
      # idem for 'x86_64-apple-darwin'
      lib.systems.inspect.patterns.isDarwin
    ];
  };
}