Skip to content

breakpointHook: nsenter fails on non-NixOS #383272

@danjujan

Description

@danjujan

Nixpkgs version

  • Unstable (25.05)

Describe the bug

When I use breakpointHook and try to attach to the the build environment on my Arch Linux machine nsenter fails.

Steps to reproduce

sudo /nix/store/lbyvyn6qklr21mrnkpv8j2k4b0d0xj98-attach/bin/attach 1778197
nsenter: reassociate to namespace 'ns/mnt' failed: Invalid argument

However, directly executing attach.sh to use the nsenter binary provided by Arch works. Maybe it is possible to add a fallback for non-NixOS systems to use the distro provided nsenter?

sudo  /nix/store/h77lblnc100nkq3c84arxcmq5z81lsn8-attach.sh 1778197

Expected behaviour

The breakpointHook should also work on non-NixOS machines

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.13.2-native_amd-xanmod1-1-edge, Arch Linux, noversion, rolling
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.26.2
  • nixpkgs: /nix/store/v9qmqrpnvnl2h2hb9l53224cw4dcavh5-nixpkgs/nixpkgs

Notify maintainers

@DavHau since you have introduced nsenter in #370184
Thaigersprint/thaigersprint-2025#1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions