Features to solve the problems with dll linking on Windows
See original GitHub issueDescription of the problem / feature request:
Solving the problems with dll on Windows. If a package is dependent on 2 different dlls with the same name but different path, Bazel throw an error because it has to copy 2 dlls into the binary folder which causes name clash. The solution is renaming the dll to name-hash.dll and use a .lib file as an interface library and a .DEF file to actually point to the name-hash.dll
What operating system are you running Bazel on?
Windows 10
Have you found anything relevant by searching the web?
https://github.com/bazelbuild/bazel/issues/11482
Any other information, logs, or outputs that you want to share?
With the guidance of @meteorcloudy , I will implement this feature This is the progress tracker of this issue
- Add a build option to enable this features.
--rename_dll
- Change the dll name on Windows to name-hash.dll, where hash will be calculated based on RepositoryName + the package path the DLL belongs to.
- Add the name to .DEF file by using
LIBRARY name-hash
- Testing and document
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (11 by maintainers)
Top Results From Across the Web
Dynamic link library (DLL) - Windows Client | Microsoft Learn
This article describes what a dynamic link library (DLL) is and the various issues that may occur when you use DLLs.
Read more >How to Fix DLL Not Found or Missing Errors - Lifewire
The only way to permanently fix DLL errors is by fixing the underlying cause of the issue, not by downloading DLL files. Here's...
Read more >2022 Guide on How to fix all DLL Errors in Windows 10/11
In this video, we're going to show you how to fix dll issues with a few easy solutions that you can try in...
Read more >How to fix Missing DLL files errors on Windows 11/10 PC
Fix Missing DLL files error · Run the built-in System File Checker tool to replace missing or corrupted operating system files · Run...
Read more >What is dynamic link library (DLL)? - TechTarget
How do you fix DLL errors? ... DLL errors are common because of the volume of DLL files found on Microsoft Windows systems...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I think you can implement it in one PR. But I’m not sure we should change CcBinary, because the target is defined explicitly by users, so they probably expect the DLL name to just be <name>.dll on Windows. However, the DLL built by cc_library is implicit when other cc_binary depends on it and specifies
linkstatic = 0
.The code will be formatted when we import it into Google, but I don’t think the tools are available outside.
Sorry, I use the bazel 2.0 to build. I use bazelisk and it fix the problem. Thank you