这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mgorny
Copy link
Contributor

@mgorny mgorny commented Nov 14, 2025

PR Checklist:

  • put any other relevant information below

Add a short section that covers Windows-specific install paths and library naming conventions. I suppose other people with primarily POSIX background will find this helpful, especially that these conventions are at least partially specific to conda-forge.

The variables don't seem to be part of the core documentation, but they were documented in conda-build and rattler-build docs separately. I chose to document the intersection of both.

CC @isuruf @h-vetinari

@mgorny mgorny requested a review from a team as a code owner November 14, 2025 15:07
@netlify
Copy link

netlify bot commented Nov 14, 2025

Deploy Preview for conda-forge-previews ready!

Name Link
🔨 Latest commit 620a998
🔍 Latest deploy log https://app.netlify.com/projects/conda-forge-previews/deploys/691857b0d2b1df0008c3417e
😎 Deploy Preview https://deploy-preview-2655--conda-forge-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 67
Accessibility: 96
Best Practices: 100
SEO: 89
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@leofang
Copy link
Member

leofang commented Nov 14, 2025

LGTM

@hmaarrfk
Copy link
Contributor

cc: @tjwilli58 just for information


If a static library is installed as well, it is usually prefixed with `lib` to distinguish it from the import library:

- `lib{name}.lib`, the static library
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use two conventions in conda-forge. lib{name}.lib and {name}-static.lib. The second is a historical artifact IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I said "usually" :-). But I can mention the other convention too, no problem with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, and rebased.

Now I wonder if there are also package using lib{name}.a.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I wonder if there are also package using lib{name}.a.

for stuff built by the m2w64-toolchain, yes. There's even libfoo.dll.a, example

mgorny and others added 4 commits November 14, 2025 18:06
Add a short section that covers Windows-specific install paths
and library naming conventions.  I suppose other people with primarily
POSIX background will find this helpful, especially that these
conventions are at least partially specific to conda-forge.

The variables don't seem to be part of the core documentation, but they
were documented in conda-build and rattler-build docs separately.
I chose to document the intersection of both.

Signed-off-by: Michał Górny <mgorny@quansight.com>
Co-authored-by: Mark Harfouche <mark.harfouche@gmail.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
@mgorny mgorny force-pushed the kb-win-naming-conventions branch from 301b29e to 2ced2c6 Compare November 14, 2025 17:06
Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR; some comments below

Comment on lines 367 to 370
Shared libraries on Windows generally follows the MSVC convention, and therefore are distributed as pairs of two files, usually without a `lib` prefix:

- `{name}.dll`, the actual dynamic library that is used by compiled executables
- `{name}.lib`, the so-called import library that is used to link against the dynamic library when building packages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth mentioning that this is so that -lfoo works in the same way as on unix, provided %LIBRARY_LIB% is on the linker path


- `lib{name}.lib`, the static library

Some packages use `{name}-static.lib` instead, though it is considered a historical artifact.
Copy link
Member

@h-vetinari h-vetinari Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth a larger discussion, but I don't feel like we should soft-deprecate foo-static.lib like that. The reasons I prefer it are principally:

  • import libraries are really effin' weird (for anyone coming from unix at the very least), and using the same file prefix as static libraries is yet another horrible MSVC sin
  • matching foo.dll and foo.lib is an easy enough pattern to remember: a DLL needs its import library, and it just differs by extension
  • remembering that libfoo.lib is supposed to be static is way less likely to sink in than the obvious-because-it's-on-the-tin foo-static.lib.
  • there are cases where (for other historical compatibility reasons) libfoo.lib is not static1. A good example is protobuf, though at least the DLL name matches (libprotobuf.dll & libprotobuf.lib).

Footnotes

  1. also redundant use of "lib" is redundant

Signed-off-by: Michał Górny <mgorny@quansight.com>
@mgorny
Copy link
Contributor Author

mgorny commented Nov 15, 2025

Okay, I expanded a lot on different conventions. Hopefully I didn't make any mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants