Skip to content
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

pin_run_as_build for boost, boost-cpp #58

Merged
merged 2 commits into from
May 11, 2018
Merged

Conversation

djsutherland
Copy link
Contributor

Boost breaks the ABI with minor versions.

I think this is the right behavior: we don't want run_exports because you don't want to require it at run if it's used header-only, but this allows people to list just - boost in the run reqs rather than having to do {{ pin_compatible('boost', max_pin='x.x.x') }} (and look up how many xs you need).

@conda-forge-linter
Copy link

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 (recipe) and found it was in an excellent condition.

@@ -46,6 +46,10 @@ zip_keys:
pin_run_as_build:
arpack:
max_pin: x.x
boost:
max_pin: x.x.x
Copy link
Member

Choose a reason for hiding this comment

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

How about just boost-cpp?.

Copy link
Member

Choose a reason for hiding this comment

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

What about Python/C++ binding code that uses Boost?

Copy link
Member

Choose a reason for hiding this comment

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

Got it. Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

This is why we have split up the boost package. We have libboost for explicitly compiling things against boost. We have py-boost for python usage. Ideally, I think we'd also have a boost-includes or something like that for strictly header-only components.

With current conda-forge recipes, I believe it is safest to use the setting you have here, but I would encourage everyone to move towards packages that are only used one way (linking, or python, or only headers).

Copy link
Member

Choose a reason for hiding this comment

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

I though boost python was a C++ library and not a python package.

Copy link
Member

Choose a reason for hiding this comment

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

You are right. We split it up so that we only build the core libraries once, then compile only the python part by itself. So yes, you are correct to have pin_run_as_build for boost and boost-cpp, and we would need it for libboost and py-boost.

@jakirkham
Copy link
Member

cc @conda-forge/core @conda-forge/boost-cpp @conda-forge/boost

@@ -46,6 +46,10 @@ zip_keys:
pin_run_as_build:
arpack:
max_pin: x.x
boost:
max_pin: x.x.x
boost_cpp:
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the package called "boost-cpp"?

Copy link
Contributor Author

@djsutherland djsutherland May 10, 2018

Choose a reason for hiding this comment

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

Yeah, but yaml doesn't allow that (I think?) so it's translated. Also see r_base.

Copy link
Member

Choose a reason for hiding this comment

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

I thought you could do something like:

"boost-cpp":
    max_pin: x.x.x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, maybe, and that would be nicer. Not sure how that works, can investigate later....

Copy link
Member

Choose a reason for hiding this comment

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

Think we have to use _. The parser got messed up with - for me previously.

Copy link
Member

Choose a reason for hiding this comment

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

oof that is annoying. That means that - and _ should always be interchangeable, then

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 conda-build when trying to re-render a feedstock.

TBH don't think this is that bad in practice. Don't think we have packages that differ only by -/_ and if we do we are bound to run into tons of issues from our users, which is incentive enough to steer clear.

Copy link
Member

Choose a reason for hiding this comment

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

@isuruf described it correctly. - and _ are treated as equivalent for the purposes of matching package names to variable names (the foundation of what gets looped over).

If this is not desirable, you can make the key in CBC.yaml any arbitrary string, and then use it explicitly wherever you need it.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like @scopatz was right. If it's a top level key you need _, but for pin_run_as_build you need the exact package name. Very confusing. https://github.com/conda-forge/postgis-feedstock/pull/8/files/#r187479333

Copy link
Member

Choose a reason for hiding this comment

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

That is an annoying detail that grew out of pin_run_as_build being implemented completely differently (and in a different part of the source) from run_exports and the jinja2 functions. PRs to fix it would be welcome. Sorry you guys have been the pin_run_as_build guinea pigs. That's a feature that we just haven't really used much in defaults. With r-base, it was easy enough for us to hack around. With all of your packages, it is a much bigger problem.

@isuruf isuruf requested a review from msarahan May 10, 2018 23:02
Copy link
Member

@msarahan msarahan left a comment

Choose a reason for hiding this comment

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

Approving this with the caveat that we should move away from our packages that currently serve multiple roles.

#58 (comment)

@scopatz
Copy link
Member

scopatz commented May 12, 2018

Ultimately, I don't think it makes sense to have to split up packages. To me, a lot of the value of conda comes from having packages that can serve multiple interfaces

@jakirkham
Copy link
Member

Yeah I'm less clear on why boost usage needs to be adapted for header only cases. Seems like we could just as easily not list boost as a run dependency with our current pinning scheme. In the future one could also add it to build/ignore_run_exports to avoid having boost added as a dependency. IOW it feels like the header only case for boost is already well solved with existing options.

@msarahan
Copy link
Member

boost libraries are small enough that it doesn't really matter. What this is all about is helping conda-build get your dependencies right for you. Does it take one thing in the recipe to have your dependencies right, or two? This is really all about run_exports, and the ugliness of needing ignore_run_exports. Yes, it works. No, you are not encoding as much information as you could be about how you're using boost, and thus conda-build won't be able to help you get your dependencies right. With multi-purpose packages and ignore_run_exports being the approach, at worst, you'll end up with unnecessary dependencies, which are a concern for size and for introducing more constraints that may make some environments hard or impossible to create due to version conflicts.

If you split the package, it takes more work upstream, but less work downstream. If a library is used many times, the balance is in favor of the split packages.

@mingwandroid
Copy link
Contributor

Ultimately, I don't think it makes sense to have to split up packages.

Can you please explain exactly what you mean by this? Users don't care, if you install boost-cpp from the split package set you get exactly the same files and interfaces as if you'd installed boost-cpp from the unsplit package.

Forcing people to install two or three almost exact copies of the same core boost libraries because they use two or three different py-boosts is not a good thing to do. Also the 'almost exact' is problematic. You introduce more DSOs and more DSOs is more things to go wrong and reduced usage and testing of what should be the exact same DSOs.

@mingwandroid
Copy link
Contributor

mingwandroid commented May 15, 2018

And at present, without split packages, installing boost forces python to be installed and that's not good for people who use e.g. R and have no interest in python, now they can install libboost and not worry. Also, minimising your requirements to what you actually require makes your environment smaller and reduces things such as CI build time (and env creation in general).

@isuruf
Copy link
Member

isuruf commented May 16, 2018

@mingwandroid, your explanation is for boost and boost-cpp, but I don't see any explanation in your post for splitting up boost-cpp into the libraries and header files.

@mingwandroid
Copy link
Contributor

Boost is frequently used in a headers-only way and we should take care that unnecessary pinned boost dependency does not get forced onto packages that do not need it.

This should be obvious though, and to me you are arguing against common sense.

@mingwandroid
Copy link
Contributor

@isuruf
Copy link
Member

isuruf commented May 16, 2018

Boost is frequently used in a headers-only way and we should take care that unnecessary pinned boost dependency does not get forced onto packages that do not need it.

Can you please explain to me the difference between the following?

requirements:
  host:
     - boost-cpp
  run:
requirements:
  host:
     - boost-headers
  run:

This should be obvious though, and to me you are arguing against common sense.

Please don't insinuate that I don't have common sense.

@msarahan
Copy link
Member

The former should use run_exports to ensure binary compatibility. It implies that you are linking against some library. The latter should not use run_exports, because it is clear that it is header-only.

@isuruf
Copy link
Member

isuruf commented May 16, 2018

I thought we agreed not to use run_exports right? If we used pin_run_as_build for boost-cpp without run_exports, there's no difference two packages right?

@msarahan
Copy link
Member

We intend to use run_exports in our recipes. You are right, though, that without boost-cpp in both host and run, it is equivalent. We feel that having run_exports will be more explicit and more clear than whether or not there is a boost-cpp run dep.

@isuruf
Copy link
Member

isuruf commented May 16, 2018

We feel that having run_exports will be more explicit and more clear than whether or not there is a boost-cpp run dep.

Does conda-forge get a chance to say how we feel or is this set in stone and conda-forge has to follow defaults?

@msarahan
Copy link
Member

We can put it up for a vote. You are not conda-forge, and Anaconda is not conda-forge. I will say that I have much less intention to maintain pin_run_as_build since we don't like it much, so you may want to factor some of your time picking that up into any decision you make to depend on pin_run_as_build in the future.

@jakirkham
Copy link
Member

Could someone please add this to the next agenda (possibly creating one if doesn't exist)?

@mingwandroid
Copy link
Contributor

I don't understand why you shouldn't user run_exports, they are one of the most useful and powerful conda build 3 features. Can you explain?

@mingwandroid
Copy link
Contributor

Please don't insinuate that I don't have common sense.

I did not in any way insinuate this, I am explicitly stating that I consider not using run_exports as a nonsensical thing to contemplate because they are such a powerful feature, you should not use this as an opportunity to take offence.

maresb pushed a commit to maresb/conda-forge-pinning-feedstock that referenced this pull request Nov 1, 2022
maresb pushed a commit to maresb/conda-forge-pinning-feedstock that referenced this pull request Nov 1, 2022
maresb pushed a commit to maresb/conda-forge-pinning-feedstock that referenced this pull request Nov 1, 2022
Revert "REF remove binutils constraint (conda-forge#58)"
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.

None yet

7 participants