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

Build/host dependency of header-only C++ packages #3796

Closed
sdebionne opened this issue Nov 4, 2019 · 8 comments
Closed

Build/host dependency of header-only C++ packages #3796

sdebionne opened this issue Nov 4, 2019 · 8 comments
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@sdebionne
Copy link

sdebionne commented Nov 4, 2019

When a C++ header-only package foo depends on another header only-package bar, is there a way to ensure that the downstream project get both installed as host requirements?

foobar <--depends-- foo <--depends-- bar

with

package:
  name: foobar

requirements:
  host:
    - foo
package:
  name: foo

requirements:
  host:
    - bar

With the current implementation, only foo gets installed.

Is there any way to export the build/host requirements of a package to the downstream projects transitively, maybe something like build_export?

@marcelotrevisani
Copy link
Member

If you add the run requirements on the bar project
everything which is there will be at the host section as well.

@marcelotrevisani
Copy link
Member

Did it solve your problem?

@sdebionne
Copy link
Author

sdebionne commented Nov 4, 2019

Well I thought of using runtime requirements briefly but then the headers would be installed with the dowstream project foobar, no?

What I think might be needed is the twin of run_exports:

# meta.yaml of foo 
build:
  host_exports:
    - bar

so anyone using foo as a host dependency would automatically get bar installed in the host environment.

My workaround is to list both foo and bar as host requirements:

# meta.yaml of foobar 
requirements:
  host:
    - foo
    - bar # this should not be needed

@sdebionne
Copy link
Author

I had a quick look on how this situation is handled in Vcpkg:

Build-Depends

Vcpkg does not distinguish between build-only dependencies and runtime dependencies.

I guess it's the same for Conda. Maybe I should rename this issue to make it clear it is about build-only dependencies (and actually not specific to header-only libraries).

@msarahan
Copy link
Contributor

msarahan commented Nov 7, 2019

It's counterintuitive for sure, but here if you add a run requirement on bar for foo, them it will be present in the host section for foobar, but will not be a run dependency for foobar. You can think of the host section as using the run requirements for all of the specs on the host section. If foo and bar both had run_exports, foo's run exports would be in foobar, but bar's would not necessarily, because run exports are not transitive.

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Mar 13, 2023
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Apr 13, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to 🏁 Done in 🧭 Planning Apr 13, 2023
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 12, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2024
@jakirkham
Copy link
Member

Just a note, to discuss adding host_exports, filed issue: conda/ceps#77

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
Archived in project
Development

No branches or pull requests

4 participants