JetBrains Rider (C#) + dotCover setup?

Our team is using JetBrains Rider as our IDE for dotnet development and we’ve added the JetBrains Rider IDE nixos package “jetbrains.rider”, which worked perfectly out-of-the-box.

We’d now like to turn on ‘dotCover’ (https://www.jetbrains.com/dotcover/), which is one of many plugins that JetBrains Rider supports.

Via the JetBrains IDE, we’ve installed and activated the ‘dotCover’ plugin, however, no coverage results are generated for out tests and the following error is displayed.

Test not run

Last runner error: Unable to start profiling. An error occurred trying to start process '/nix/store/3hi8v34pkvhi7wiwam56qpsnzj81mk0h-rider-2022.1/rider/plugins/dotCommon/DotFiles/linux-x64/JetBrains.Profiler.PdbServer' with working directory '/home/talos/projects/talos/talos-appliance/pipes-n-processors'. No such file or directory

It would appear that JetBrains Rider is attempting to load ‘JetBrains.Profiler.PdbServer’ but can’t find the package.

Thoughts? Solution?

Thanks!

This file is probably just using the wrong ELF interpreter, try using this instead of jetbrains.rider:

(jetbrains.rider.overrideAttrs (old: {
  postPatch = old.postPatch + ''
    patchelf --set-interpreter $interp plugins/dotCommon/DotFiles/linux-x64/JetBrains.Profiler.PdbServer
  '';
})

Raphi – thanks for the tip – apologies for the slow reply!

I tried your suggestion, however, it resulted in the following ‘missing patch file’ error:


building '/nix/store/wwh71dyybag7ysjmnn6h1cibbjx9vr6v-rider-2022.1.drv'...
unpacking sources
unpacking source archive /nix/store/0b4ldclyywfqd8pakwhs28l3zyimkj4v-JetBrains.Rider-2022.1.tar.gz
source root is JetBrains Rider-2022.1
setting SOURCE_DATE_EPOCH to timestamp 1650321716 of file JetBrains
patching sources
patchelf: missing filename
error: builder for '/nix/store/wwh71dyybag7ysjmnn6h1cibbjx9vr6v-rider-2022.1.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/vvkgy5gkmrib2yg1n0jl78smp89g1jw2-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/s25zba4f7sc4yrv23qlvsvp666kv2npg-nixos-system-talos-devenv-22.05.2676.b9fd420fa53.drv' failed to build

Any thoughts or suggestions?

Thanks!

Try this, this should work on all nixpkgs branches:

postPatch = old.postPatch + ''
  interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
  patchelf --set-interpreter $interp plugins/dotCommon/DotFiles/linux-x64/JetBrains.Profiler.PdbServer
'';

Should I use this in place of the current ‘jetbrains.rider’ package or add it?

Not entirely sure I understand what you mean.

Thx!

Wherever you are currently using jetbrains.rider now, replace it with

(jetbrains.rider.overrideAttrs (old: {
  postPatch = old.postPatch + ''
    interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
    patchelf --set-interpreter $interp plugins/dotCommon/DotFiles/linux-x64/JetBrains.Profiler.PdbServer
  '';
})

Hi Raphi – Thank you very much! Your fix works like a charm!

Question, should this fix be integrated into the ‘jetbrains.rider’ package?

FYI: For anyone else that trips across this issue, long story short, the current ‘jetbrains.rider’ package dotCover plugins fail to operate thus no code coverage metrics are reported.

Replacing ‘jetbrains.rider’ package with the statement below fixes this issue.

(jetbrains.rider.overrideAttrs (old: {
  postPatch = old.postPatch + ''
    interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
    patchelf --set-interpreter $interp plugins/dotCommon/DotFiles/linux-x64/JetBrains.Profiler.PdbServer
  '';
}))

Thx again!

Hi Raphi -

I posted this question to the help channel, but got no bites. Given you help/feedback on other JetBrain packages, I’m wondering if you can help or point me in the right direction?

https://discourse.nixos.org/t/add-jetbrains-dotulitimate-package/22981?u=jdaly

Thanks.