-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
REF: Split libraries into separate outputs #74
base: main
Are you sure you want to change the base?
Conversation
…nda-forge-pinning 2024.03.05.22.33.10
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipe:
For recipe:
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( I do have some suggestions for making it better though... For recipe:
|
outputs: | ||
|
||
# Everything needed to build against libcairo | ||
- name: cairo |
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.
Because the "everything minus static libs" package is named "cairo" existing downstream packages should not break. Newly built packages will only recieve exports of the numbered shared libraries. (I believe cairo-trace is a dev package that does not need to be exported).
Hi! This is the friendly automated conda-forge-linting service. I was trying to look for recipes to lint for you, but it appears we have a merge conflict. Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug. |
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( I do have some suggestions for making it better though... For recipe:
|
@conda-forge-admin, please rerender |
…nda-forge-pinning 2024.04.03.08.04.29
@conda-forge-admin please restart ci |
- pkg-config --cflags cairo-gobject | ||
|
||
# Only what's needed for run_exports downstream | ||
- name: libcairo{{ so_name_major }} |
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.
If it isn't co-installable, why include the major version in the name?
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 assume you are referring to the Windows build variant because the unix packages would be coinstallable with other ABI major version.
The reason is to keep consistency between Windows and Unix package names.
@@ -0,0 +1,167 @@ | |||
# This is free and unencumbered software released into the public domain. |
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.
You have used this probably before/somewhere else? I'm a bit confused we need such a lengthy script. In most other cases, I either installed the shared libraries explicitly or had a script which deletes some files from the PREFIX again and then uses conda-build's host deduplication.
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.
You have used this probably before/somewhere else? I'm a bit confused we need such a lengthy script.
Yes. The length is because I want to use this same script in multiple feedstocks without changing it too much, so it needs to be generic (long).
In most other cases, I either installed the shared libraries explicitly or had a script which deletes some files from the PREFIX again and then uses conda-build's host deduplication.
Could you please explain better the approach you are describing here? I don't see how deleting files from the prefix is helpful for package splitting.
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.
See the script in https://github.com/conda-forge/glib-feedstock/blob/2896c82bbbe09c898d3d1bd9f5668bfb22571b00/recipe/install.sh#L1 There we install everything as usual and remove afterwards the files that should not go into the respective output.
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.
This is an interesting approach which we can call split-by-subtraction. It is the opposite of my approach which is split-by-addition. split-by-subtraction relies on a behavior of conda-build that the state of PREFIX is reset between generating each output (i.e. that the files which have been deleted are restored). The advantage is that hardcoded PREFIX paths in the installed artifacts do not need patching because they are installed directly to the PREFIX instead of to a staging area as in split-by-addition. I could modify my install script to use split-by-subtraction instead since the main purpose of my script is to enable easy splitting of the artifacts using glob.
However, this restoration behavior between generating each output is undocumented, so relying on it as the primary package splitting method is (in my opinion) not a good idea because it could break at any time without warning. In fact, the only documented methods are pattern matching via glob and moving files into the prefix (split-by-addition).
I have an open PR to improve the glob (pattern matching) functionality in conda-build which will make both split-by-subtraction and split-by-addition obsolete, so I can refactor this PR to use that feature if/when it is merged and released.
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.
split-by-subtraction relies on a behavior of conda-build that the state of PREFIX is reset between generating each output (i.e. that the files which have been deleted are restored).
However, this restoration behavior between generating each output is undocumented
The behaviour is clearly documented. Each output has its own set of host
and build
dependencies and thus gets its own environments during the build. We also never delete any files during a build phase that we have no copied into the PREFIX some lines above in the build script.
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.
My mistake, I misread the glib install scripts. I thought that meson install
was called inside build.sh
, but that is not the case.
I was thinking this:
build.sh : build everything; install everything
install.sh : for each output, depending on the package name, remove things
but it's actually this:
build.sh : build everything; no installing
install.sh : for each output, install everything, then depending on the package name, remove things
I'll have to think about how to adapt this approach to make it more generic.
Co-authored-by: Uwe L. Korn <xhochy@users.noreply.github.com>
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)Hi maintainers!
It looks like this feedstock is still shipping static libraries. It has been our channel's policy since 2020 that static libraries are not shipped or are separated into their own output. For more information about our static library policy, please read CFEP-18.
In this PR, I have restructured the recipe into multiple outputs including separating the static libraries and dev files from necessary run_exports (the shared objects). The method I am using is to "build everything, then split". Everything is built in the top-level section and installed to a staging directory. Then a custom python install script is used to selectively install the artifacts based on the name of each output.
My motivation for this PR is to reduce the size of artifacts in my packages dependency trees starting from packages with the largest artifacts to the smallest.
Checklist for multi-output transition