NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.45k stars 13.65k forks source link

azuredatastudio package is missing libsecret.so in RPATH #294948

Open maxbol opened 6 months ago

maxbol commented 6 months ago

Describe the bug

azuredatastudio in nixos-unstable (as well as nixos-23.11) is missing libsecret in its LD_LIBRARY_PATH. This causes the app to display an ignorable error on start, and also makes it impossible to store passwords for any database connections.

The following overlay fixes the issue:

{ ... }: {
  nixpkgs.overlays = [
    (final: prev: {
      azuredatastudio = prev.azuredatastudio.overrideAttrs(old: rec {
        extraPackages = [
          final.libsecret
        ];
        rpath = prev.lib.concatStringsSep ":" [
          old.rpath
          (final.lib.makeLibraryPath [final.libsecret])
        ];

        fixupPhase = ''
            fix_sqltoolsservice()
            {
              mv ${old.sqltoolsservicePath}/$1 ${old.sqltoolsservicePath}/$1_old
              patchelf \
                --set-interpreter "${prev.stdenv.cc.bintools.dynamicLinker}" \
                ${old.sqltoolsservicePath}/$1_old

              makeWrapper \
                ${old.sqltoolsservicePath}/$1_old \
                ${old.sqltoolsservicePath}/$1 \
                --set LD_LIBRARY_PATH ${old.sqltoolsserviceRpath}
            }

            fix_sqltoolsservice MicrosoftSqlToolsServiceLayer
            fix_sqltoolsservice MicrosoftSqlToolsCredentials
            fix_sqltoolsservice SqlToolsResourceProviderService

          patchelf \
            --set-interpreter "${prev.stdenv.cc.bintools.dynamicLinker}" \
            ${old.targetPath}/${old.edition}

          mkdir -p $out/bin
          makeWrapper \
            ${old.targetPath}/bin/${old.edition} \
            $out/bin/azuredatastudio \
            --set LD_LIBRARY_PATH ${rpath}
        '';
      });
    })
  ];
}

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install azuredatastudio from the current stable branch 23.11
  2. Start the application

Expected behavior

The application starts without issues or warnings, and it is possible to store passwords for database connections using the system keyring.

Notify maintainers

@xavierzwirtz

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.79, NixOS, 24.05 (Uakari), 24.05.20240224.73de017`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"home-manager-23.11.tar.gz, nixos-23.11, nixos-unstable"`
 - nixpkgs: `/etc/channels/nixpkgs`

Add a :+1: reaction to issues you find important.

joshlupo commented 4 months ago

Praise you for sharing this overlay that I did not have the skill to write, but works perfectly and improves my workflow immensely.

PietroCarrara commented 3 months ago

I think this might be fixed by #292362 too