mastodon-modules: build failure
Nixpkgs version
- Unstable (25.05)
Describe the bug
mastodon-modules fails in fixupPhase.
Steps to reproduce
nix-shell -p mastodon
Expected behaviour
mastodon-modules builds without error
Screenshots
No response
Relevant log output
Running phase: fixupPhase
shrinking RPATHs of ELF executables and libraries in /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3
shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/prebuilds/linux-x64/utf-8-validate.node
shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/prebuilds/linux-x64/utf-8-validate.musl.node
shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/build/Release/validation.node
shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/build/Release/obj.target/validation.node
shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/build/Release/obj.target/validation/src/validation.o
patchelf: wrong ELF type
shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/build/Release/obj.target/validation/deps/is_utf8/src/is_utf8.o
patchelf: wrong ELF type
shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/bufferutil/prebuilds/linux-x64/node.napi.node
checking for references to /build/ in /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3...
patchelf: wrong ELF type
patchelf: wrong ELF type
patching script interpreter paths in /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3
ERROR: noBrokenSymlinks: the symlink /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/@mastodon/streaming points to a missing target /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/streaming
ERROR: noBrokenSymlinks: found 1 dangling symlinks and 0 reflexive symlinks
error: builder for '/nix/store/nkvhwanxyldkkfyma1wzxrh60id2qq8m-mastodon-modules-4.3.3.drv' failed with exit code 1;
last 25 log lines:
> DEPRECATION WARNING: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
>
> More info: https://sass-lang.com/d/legacy-js-api
>
>
> ➤ YN0000: Done in 0s
> buildPhase completed in 58 seconds
> Running phase: installPhase
> Running phase: fixupPhase
> shrinking RPATHs of ELF executables and libraries in /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3
> shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/prebuilds/linux-x64/utf-8-validate.node
> shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/prebuilds/linux-x64/utf-8-validate.musl.node
> shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/build/Release/validation.node
> shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/build/Release/obj.target/validation.node
> shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/build/Release/obj.target/validation/src/validation.o
> patchelf: wrong ELF type
> shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/utf-8-validate/build/Release/obj.target/validation/deps/is_utf8/src/is_utf8.o
> patchelf: wrong ELF type
> shrinking /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/bufferutil/prebuilds/linux-x64/node.napi.node
> checking for references to /build/ in /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3...
> patchelf: wrong ELF type
> patchelf: wrong ELF type
> patching script interpreter paths in /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3
> ERROR: noBrokenSymlinks: the symlink /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/node_modules/@mastodon/streaming points to a missing target /nix/store/ghwp2jgvs9h8k6r4csvkka7ydkqw5ym1-mastodon-modules-4.3.3/streaming
> ERROR: noBrokenSymlinks: found 1 dangling symlinks and 0 reflexive symlinks
For full logs, run 'nix log /nix/store/nkvhwanxyldkkfyma1wzxrh60id2qq8m-mastodon-modules-4.3.3.drv'.
error: 1 dependencies of derivation '/nix/store/akb60ys3f7yjjd913r0spfajy02p8jnr-mastodon-4.3.3.drv' failed to build
Additional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 6.13.1, NixOS, 25.05 (Warbler), 25.05.20250207.dd81bdc - multi-user?:
yes - sandbox:
yes - version:
nix-env (Nix) 2.25.5 - channels(…):
"home-manager, nixgl, nixpkgs" - channels(root):
"nixos" - nixpkgs:
/home/…/.nix-defexpr/channels/nixpkgs
Notify maintainers
@erictapen @Izorkin @ghuntley @happy-river
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
- [x] I assert that this is a bug and not a support request.
- [x] I assert that this is not a duplicate of an existing issue.
- [x] I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a :+1: reaction to issues you find important.
Likely root cause of issue is here: #370750 (stdenv: add no-broken-symlinks hook #370750)
The hook can be disabled by setting dontCheckForBrokenSymlinks , but that is an ugly workaround, not a real fix.
Correct solution is to fix the dangling symlink issue in the mastodon-modules-4.3.3 code.
The symlink causing the failure is created by yarn for the streaming workspace. I'm not quite sure why that is, the root workspace doesn't depend on streaming directly.
But even if its intended by upstream in some way the link would be useless in our build, it can be removed safely. A fix could look like this
services.mastodon.package = pkgs.mastodon.overrideAttrs (old: {
mastodonModules = old.mastodonModules.overrideAttrs (old: {
# FIXME: Remove once fixed in nixpkgs. See https://github.com/NixOS/nixpkgs/issues/380366
postBuild = ''
# Remove workspace "package" as it contains broken symlinks
rm -r ~/node_modules/@mastodon
'';
});
});
Ideally we could just tell yarn to not create the link though