!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

231 Members
NixOS on RISC-V https://wiki.nixos.org/wiki/RISC-V https://pad.lassul.us/NixOS-riscv64-linux https://github.com/orgs/NixOS/teams/risc-v70 Servers

Load older messages


SenderMessageTime
25 Apr 2025
@outfoxxed:outfoxxed.meoutfoxxedSince this is in the critical chain to even getting a zero package nixos install running I'd assume theres some reason everyone doesn't run into this00:27:55
@alex:tunstall.xyzAlex
In reply to @outfoxxed:outfoxxed.me
the package just uses ${libstemmer} directly, and not via a native/target dep
how is that suppposed to be handled?

Splicing can't work when packages do that.

Use targetPackages.libstemmer instead and it might work.
If you don't want to patch Nixpkgs, you can override { inherit (self.targetPackages) libstemmer; } instead.

00:30:35
@outfoxxed:outfoxxed.meoutfoxxedis this documented anywhere in the "new users creating a package" path?00:31:32
@alex:tunstall.xyzAlex
In reply to @outfoxxed:outfoxxed.me
Since this is in the critical chain to even getting a zero package nixos install running I'd assume theres some reason everyone doesn't run into this
It's possible that this is a new regression.
00:31:56
@alex:tunstall.xyzAlexIt's likely mentioned in the "writing packages for cross" section of the manual.00:33:30
@outfoxxed:outfoxxed.meoutfoxxeddoesn't look like a new regression, at least not to this package, which is the root of the linking issue00:35:24
@senk0:element.senk0.com@senk0:element.senk0.com left the room.00:35:40
@alex:tunstall.xyzAlex

Have you looked at why it's in the build time closure?

Changes to other packages may have resulted in it being required where it wasn't before.
I suspect that one of the dependants in the chain can be overridden to not require it.

00:38:02
@outfoxxed:outfoxxed.meoutfoxxedprobably, but it looks far easier to just fix it00:38:32
@alex:tunstall.xyzAlexIt's a Python package, so see the "overriding Python packages" section of the Nixpkgs manual.00:39:26
@outfoxxed:outfoxxed.meoutfoxxeddoesn't seem to02:48:02
@outfoxxed:outfoxxed.meoutfoxxed
libstemmer = builtins.trace "${targetPackages.libstemmer} ${buildPackages.libstemmer} ${pkgs.libstemmer}" targetPackages.libstemmer;
02:48:35
@outfoxxed:outfoxxed.meoutfoxxed

prints 3x and only in one of them is targetPackages set correctly

trace: /nix/store/4fca7idn7b9hy41ch7kbbwi2dn96zfyq-libstemmer-2.2.0 /nix/store/4fca7idn7b9hy41ch7kbbwi2dn96zfyq-libstemmer-2.2.0 /nix/store/4fca7idn7b9hy41ch7kbbwi2dn96zfyq-libstemmer-2.2.0
trace: /nix/store/bdsm3nvxjczzyki4057bmj941wr7gjqs-libstemmer-riscv64-unknown-linux-gnu-2.2.0 /nix/store/4fca7idn7b9hy41ch7kbbwi2dn96zfyq-libstemmer-2.2.0 /nix/store/rxys7b8xsdm6zk710f4vdmsib1gsi9zv-libstemmer-2.2.0
trace: /nix/store/4fca7idn7b9hy41ch7kbbwi2dn96zfyq-libstemmer-2.2.0 /nix/store/4fca7idn7b9hy41ch7kbbwi2dn96zfyq-libstemmer-2.2.0 /nix/store/4fca7idn7b9hy41ch7kbbwi2dn96zfyq-libstemmer-2.2.0
02:49:02
@outfoxxed:outfoxxed.meoutfoxxedwhichever pass sets env vars is not that one02:49:12
@outfoxxed:outfoxxed.meoutfoxxed*postConfigure at least02:50:53
@outfoxxed:outfoxxed.meoutfoxxed
{
  lib,
  python,
  fetchFromGitHub,
  fetchpatch2,
  buildPythonPackage,
  cython,
  setuptools,
  targetPackages,
  buildPackages,
  pkgsCross,
  pkgs,
}: let
  #inherit (targetPackages) libstemmer;
  libstemmer = builtins.trace "${targetPackages.libstemmer} ${buildPackages.libstemmer} ${pkgs.libstemmer}" targetPackages.libstemmer;#targetPackages.libstemmer;
in buildPythonPackage rec {
  pname = "pystemmer";
  version = "2.2.0.1-fix";

  src = fetchFromGitHub {
    owner = "snowballstem";
    repo = "pystemmer";
    tag = "v${version}";
    hash = "sha256-ngPx95ybgJmndpNPBwCa3BCNsozRg+dlEw+nhlIwI58=";
  };

  patches = [
    (fetchpatch2 {
      # relax cython constraint
      name = "pystemmer-relax-cython.patch";
      url = "https://github.com/snowballstem/pystemmer/commit/d3d423dc877b4f49e0ab1776f7edaff37feb6799.patch";
      hash = "sha256-9K6gy/cLFPfW82XYHVVPXUbQhf8XyB4NUi4YqNtyWcw=";
    })
  ];

  build-system = [
    cython
    setuptools
  ];

  postConfigure = let a = ''
    export PYSTEMMER_SYSTEM_LIBSTEMMER="${lib.getDev libstemmer}/include"
  ''; in builtins.trace a a;

  env.NIX_CFLAGS_COMPILE = toString [ "-I${lib.getDev libstemmer}/include" ];

  NIX_CFLAGS_LINK = [ "-L${libstemmer}/lib" ];

  pythonImportsCheck = [ "Stemmer" ];

  checkPhase = ''
    runHook preCheck
    ${python.interpreter} runtests.py
    runHook postCheck
  '';

  meta = with lib; {
    description = "Snowball stemming algorithms, for information retrieval";
    downloadPage = "https://github.com/snowballstem/pystemmer";
    homepage = "http://snowball.tartarus.org/";
    license = with licenses; [
      bsd3
      mit
    ];
    platforms = platforms.unix;
  };
}

02:53:30
@outfoxxed:outfoxxed.meoutfoxxed

just doesn't build at all if i try to build it directly

nix-repl> :b nixosConfigurations.jupiter.pkgs.python312Packages.pystemmer
error:
       … while evaluating the attribute 'drvPath'
         at /nix/store/isfbldda5j8j6x3nbv1zim0c0dpf90v8-source/lib/customisation.nix:418:7:
          417|     // {
          418|       drvPath =
             |       ^
          419|         assert condition;

       … while evaluating the attribute 'drvPath'
         at /nix/store/isfbldda5j8j6x3nbv1zim0c0dpf90v8-source/lib/customisation.nix:418:7:
          417|     // {
          418|       drvPath =
             |       ^
          419|         assert condition;

       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'libstemmer' missing
       at /nix/store/070hcnb78yzmrh3xg95hn6pjkyb31r21-source/pystemmer.nix:15:34:
           14|   #inherit (targetPackages) libstemmer;
           15|   libstemmer = builtins.trace "${targetPackages.libstemmer} ${buildPackages.libstemmer} ${pkgs.libstemmer}" targetPackages.libstemmer;#targetPackages.libstemmer;
             |                                  ^
           16| in buildPythonPackage rec {
03:05:06
@outfoxxed:outfoxxed.meoutfoxxedwhile it fails during build if i try to build the whole system03:05:30
@outfoxxed:outfoxxed.meoutfoxxed
nix-repl> :p nixosConfigurations.jupiter.pkgs.targetPackages
{
  __raw = true;
  recurseForDerivations = false;
  stdenv = {
    cc = «derivation /nix/store/r1mr2kx550g5n8ayc0rxlm09ijq4pbn7-gcc-wrapper-14.2.1.20250322.drv»;
  };
}

that's certainly unhelpful

03:06:26
@outfoxxed:outfoxxed.meoutfoxxedpkgsHostHost appears to work, but I'm not sure if thats the best one I'm reading it as pkgs[runs(is linked) on host][doesn't codegen so irrelevant?]03:35:11
@outfoxxed:outfoxxed.meoutfoxxedso pkgsHostTarget is identical but maybe more correct?03:35:24
@dramforever:matrix.orgdramforeverthat should be the build = x86_64, host = riscv64 libstemmer03:39:59
@dramforever:matrix.orgdramforeverif it doesn't work something else went wrong03:40:08
@dramforever:matrix.orgdramforeverwait no03:41:36
@dramforever:matrix.orgdramforeverare you even sure you need to cross this to riscv64?03:41:46
@outfoxxed:outfoxxed.meoutfoxxed

I'm getting linker errors that look like this

> /nix/store/28kj37kcx5gshdk38adk4383rfcawvhj-binutils-2.44/bin/ld: /nix/store/rxys7b8xsdm6zk710f4vdmsib1gsi9zv-libstemmer-2.2.0/lib/libstemmer.a(libstemmer.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
03:41:54
@dramforever:matrix.orgdramforeverthis is probably a build dependency of something03:41:56
@dramforever:matrix.orgdramforever iiuc this should be for host = x86_64 03:42:10
@dramforever:matrix.orgdramforeverit's a dependency of sphinx03:42:15
@dramforever:matrix.orgdramforeverthe docs generator03:42:18

Show newer messages


Back to Room ListRoom Version: 10