glibcCross: assertion failed at ../pkgs/top-level/all-packages.nix:14384:25

Hi i’m trying to cross-compile and when i try to enter the shell i get this error

error: assertion '((stdenv).targetPlatform != (stdenv).hostPlatform)' failed

       at /nix/store/3qqa3phclva9vjs8zv4ygg9pnadbb6nk-source/pkgs/top-level/all-packages.nix:14384:25:

        14383|   # built with, and use, that cross-compiled libc.
        14384|   gccCrossStageStatic = assert stdenv.targetPlatform != stdenv.hostPlatform; let
             |                         ^
        14385|     libcCross1 = binutilsNoLibc.libc;
(use '--show-trace' to show detailed location information)

flake:

{
  description = "testing";

  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachSystem [ "x86_64-linux" ]
      (system:
        let pkgs = nixpkgs.legacyPackages.${system}; in
        {
          devShells.default = import ./shell.nix { inherit pkgs; };
        }
      );
}

shell:

{ pkgs }:

with pkgs;

pkgsCross.armhf-embedded.mkShell {

  nativeBuildInputs = [
    bison
    flex
    swig
    nixfmt
    python311
    python311Packages.setuptools
    gnumake
    glibcCross
  ];

  buildInputs = [
    gcc
  ];
}

Should i open an issue?

For cross compiling you want to follow a proper callPackage idiom to use a properly spliced set.