Skip to content

swiftpm: swift-test errors with libIndexStore.so cannot open shared object file #379859

Closed

Description

@zvolin

Nixpkgs version

  • Unstable (25.05)

Describe the bug

Hey, I'm trying to use nix to develop swift programs, however running tests doesn't seem work. I saw that there is a patch to disable index store applied to swiftpm and a mention that checks are disabled due to the libIndexStore.so requirement. What would be needed to add support for swift-test?

Steps to reproduce

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
  };

  outputs =
    { nixpkgs, ... }@inputs:
    let
      systems = [
        "x86_64-linux"
        "aarch64-linux"
      ];
      eachSystem = fn: nixpkgs.lib.genAttrs systems (system: fn (inputs // { inherit system; }));
    in
    {
      devShells = eachSystem (
        { nixpkgs, system, ... }:
        let
          pkgs = import nixpkgs { inherit system; };
        in
        {
          default = pkgs.mkShell.override { stdenv = pkgs.swift.stdenv; } {
            packages = with pkgs; [
              swift
              swiftpm
              swiftPackages.XCTest
            ];

            LD_LIBRARY_PATH = "${pkgs.swiftPackages.Dispatch}/lib";
          };
        }
      );
    };
}
nix develop . --command bash -c "swift package init && swift test"

Expected behaviour

swift tests running

Screenshots

No response

Relevant log output

warning: 'swift-example': Warning: supplying the --target argument to a nix-wrapped compiler may not work correctly - cc-wrapper is currently not designed with multi-target 
compilers in mind. You may want to use an un-wrapped compiler instead.
Building for debugging...
error: open("/nix/store/0jxc9ngpcybbfcl3vd8vfhfdvjql7pzv-swift-5.8-lib/lib/libIndexStore.so: cannot open shared object file: No such file or directory")
[0/6] Wrapping AST for swift-exampleTests for debugging
error: fatalError

Additional context

No response

System metadata

  • system: "aarch64-linux"
  • host os: Linux 6.12.4-asahi, NixOS, 25.05 (Warbler), 25.05.20250121.9e4d519
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.11
  • nixpkgs: /nix/store/irknf7niks2djxz4csh7sr44wwrs082y-source

Notify maintainers

@dduan @stephank @trepetti @Trundle

Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: bug
    on Feb 6, 2025
  2. added
    2.status: stale
    on Aug 5, 2025
  3. reckenrode commented on Sep 29, 2026

    @reckenrode
    Contributor

    Fixed by Fixed by #557896.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug2.status: stale

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions