-
-
Notifications
You must be signed in to change notification settings - Fork 306
KB: add a section on Windows install paths and naming conventions #2655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for conda-forge-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
LGTM |
|
cc: @tjwilli58 just for information |
docs/maintainer/knowledge_base.md
Outdated
|
|
||
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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>
301b29e to
2ced2c6
Compare
h-vetinari
left a comment
There was a problem hiding this 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
docs/maintainer/knowledge_base.md
Outdated
| 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 |
There was a problem hiding this comment.
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
docs/maintainer/knowledge_base.md
Outdated
|
|
||
| - `lib{name}.lib`, the static library | ||
|
|
||
| Some packages use `{name}-static.lib` instead, though it is considered a historical artifact. |
There was a problem hiding this comment.
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.dllandfoo.libis an easy enough pattern to remember: a DLL needs its import library, and it just differs by extension - remembering that
libfoo.libis supposed to be static is way less likely to sink in than the obvious-because-it's-on-the-tinfoo-static.lib. - there are cases where (for other historical compatibility reasons)
libfoo.libis not static1. A good example is protobuf, though at least the DLL name matches (libprotobuf.dll&libprotobuf.lib).
Footnotes
-
also redundant use of "lib" is redundant ↩
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
Okay, I expanded a lot on different conventions. Hopefully I didn't make any mistakes. |
PR Checklist:
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