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

Pass data between tools / recipes #17

Open
bburgin opened this issue Dec 10, 2019 · 6 comments
Open

Pass data between tools / recipes #17

bburgin opened this issue Dec 10, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@bburgin
Copy link

bburgin commented Dec 10, 2019

For passing data between, here are some basic cases:
a. A compiler tool may output its path to downstream recipes, for the downstream recipes to
call the tool
b. A build recipe may output some paths to downstream recipes, for the downstream recipes to
use
c. A build recipe may output some scripts to downstream recipes, for the downstream recipes to
parameterize and call
d. A test recipe may run a test and output the path to a performance data file.
Then in my external sequencer, I could run Mussels again passing in the path to a graph
render recipe.

@bburgin bburgin changed the title Pass data out of and into tools / recipes Pass data between tools / recipes Dec 10, 2019
@micahsnyder
Copy link
Contributor

I like this idea, but am unsure how to implement it, or what it would look like in the tool yaml and recipe yaml files.
I am thinking about a related issue where a tool may define a variable that would be available to any recipes that use the tool.
For example, a visualstudio 2017 tool yaml may define cmake_generator to "Visual Studio 15 2017" while the 2019 yaml would define it to "Visual Studio 16 2019". Then in a recipe which needs to specify the generator, it could do so with -G "{cmake_generator}".

I wonder if there's an elegant way to combine these two features or if they should be separate.

@micahsnyder
Copy link
Contributor

or maybe it should be referenced like this, {visualstudio.cmake_generator} so that any tool/recipe could define variables that could be used downstream... Still not sure how to set it though... Some magic format characters in the build scripts, perhaps?

@bburgin
Copy link
Author

bburgin commented Feb 27, 2021

I like your idea of namespacing data, #include msvc14.yaml and then reference msvc14.cmake_gen

@micahsnyder
Copy link
Contributor

msvc14.yaml + msvc14.cmake_gen certainly is easier on the fingers.

I'll play around with it a bit today to see what I can come up with.

@micahsnyder
Copy link
Contributor

Ok here's a PR to pass static variables from tools to the recipes that use them: #29

It doesn't really solve the whole feature request. I still don't have a good idea of how to set variables dynamically in a recipe to be used by downstream recipes. If you have any good ideas, lemme know.

@bburgin
Copy link
Author

bburgin commented Feb 28, 2021

Looks good to me. For recipes passing data to downstream recipes, could a recipe have its own namespace?

recipeA
msvc_bin = call some script

recipeB
#include recipeA and then recipeA.msvc_bin

@micahsnyder micahsnyder added the enhancement New feature or request label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants