selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🚀 Feature]: do not copy unneccesary `selenium-manager` binaries via `Selenium.WebDriver` NuGet

Open LukasGelke opened this issue 8 months ago • 3 comments

Description

build\Selenium.WebDriver.targets just includes all selemium-manager binaries in the build regardless of (target) OS. It would be nice, if one could somehow control which ones are copied. Our tests (currently) only run on windows, so the linux and macos binaries are never used and are just "bloat". Some Applications/Tests may have the <RuntimeIdentifier> or similar MsBuild-Properties set. However I guess it is not always present, if the package is included in e.g a "plain net8.0" project So a dedicated property (that can be set in .csproj or Directory.Build.props)? (Empty=Default="copy all" to be non-breaking)

Have you considered any alternatives or workarounds?

manually delete unneeded binaries after dotnet publish

LukasGelke avatar May 21 '25 11:05 LukasGelke

@LukasGelke, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

selenium-ci avatar May 21 '25 11:05 selenium-ci

It will be resolved implicitly by https://github.com/SeleniumHQ/selenium/issues/15355

nvborisenko avatar May 21 '25 21:05 nvborisenko

Seems that issue is on long shelf. But we can do something to be step closer.

Here I propose to start resolving this particular issue. We can consider selenium-manager.exe as "native library" and pack it appropriately. Meaning that nuget will deal with it as with native library. Then at runtime we will find the path to selenium-manager.exe.

Before re-packing nuget package, I ask help to test it in different environments like console app, test app, asp.net, anything else? Who is ready? Special case is the project who has packages.json file (I even don't know how to create new project in old style).

nvborisenko avatar May 26 '25 19:05 nvborisenko

So I propose to pack SM in different way, meaning:

  • dotnet build will copy all SM binaries to output (it is OK, because I can build on Windows, and run on Linux)
  • dotnet publish will consume only necessary required SM binary per target OS; It allows users to publish theirs applications without "bloat", even as single file!

Let's do it!..

nvborisenko avatar Jul 12 '25 18:07 nvborisenko

Well done, will be available in the next nightly release here: https://github.com/SeleniumHQ/selenium/pkgs/nuget/Selenium.WebDriver

nvborisenko avatar Jul 16 '25 21:07 nvborisenko

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Aug 15 '25 22:08 github-actions[bot]