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

Add DEPENDS to recipe? #31

Closed
hpux735 opened this issue Jun 11, 2021 · 7 comments
Closed

Add DEPENDS to recipe? #31

hpux735 opened this issue Jun 11, 2021 · 7 comments

Comments

@hpux735
Copy link

hpux735 commented Jun 11, 2021

Hi!

Is there a way to note required DEPENDS arguments for the recipe? We have a project that requires that the system has openssl, and need to add it manually for each new version by adding:

DEPENDS += " openssl"

to the recipe.

Is there any way we can add into some file (maybe cargo.toml) that we need some extra arguments in the recipe file?

@kraj
Copy link
Contributor

kraj commented Jun 11, 2021

perhaps you can add it via BASE_DEFAULT_DEPS += "openssl" in local.conf

@hpux735
Copy link
Author

hpux735 commented Jun 11, 2021

While that technically would work as a work-around, it's not really an idiomatic solution. Recipe files should be atomic in that they contain all the information they need to be built. I don't expect cargo to necessarily know what system packages are required to compile all the packages, so a reasonable model could be to add some kind of flag either in cargo.toml, or elsewhere, to add those.

@kraj
Copy link
Contributor

kraj commented Jun 11, 2021

Requiring a package to link to every recipe is not
Normal except system packages like libc and tools so It is not clear to me and if there
Is an advantage of having this tooled but it’s f there is another place which it is already encoded the reading and expressing it into depends is fine

@hpux735
Copy link
Author

hpux735 commented Jun 11, 2021

I think I'm confused by what you're saying...

Are you saying that recipes aren't expected to list their build dependencies in the recipe? We might be talking past one another, if you're talking about rust dependencies then you don't often have to mess with it, because there are almost always native implementations. However, rarely, they depend on system libraries.

I think having those statements in the .inc file is probably the right answer, and I didn't notice that those includes are down there at the bottom of the file. That way it's consistent between version bb files.

@kraj
Copy link
Contributor

kraj commented Jun 11, 2021

The initial ask came out that there is a need to add one package to all or lot of generated recipes but per recipe depends are unique and they need to be set explicitly

so now question is if that information is already present in toml files somehow then it could be used to synthesize depends how if not then perhaps editing it by hand would be next best option

@hpux735
Copy link
Author

hpux735 commented Jun 11, 2021

Oh, no it certainly wouldn't be all of them. I think, in this example, some dependency of reqwest depends on openssl. Unfortunately, I don't believe there is a way in cargo.toml to codify these dependencies. Swift, for example, does have a notion of this in their manifest format.

I've looked a bit in the cargo book, and I don't believe it's a tractable problem without resorting to some heroics.

@srwalter
Copy link
Contributor

This is a good use of the foo.inc file that the generated recipe sources. You can add to DEPENDS from there, and that way your change is not lost when you regenerate the .bb file

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

No branches or pull requests

3 participants