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
Updates for dual compiler output mode under travis and circle #836
Conversation
@@ -0,0 +1,27 @@ | |||
# This file was generated automatically from conda-smithy. To update this configuration, |
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 should be done in the upload script itself. There's no need to have 2 scripts where one calls the other.
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.
The issue is mostly that we need to have the jinja templates around
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 mean the ${CONFIG}
env variable?
@@ -0,0 +1,30 @@ | |||
# This file was generated automatically from conda-smithy. To update this configuration, | |||
# update the conda-forge.yml and/or the recipe/meta.yaml. |
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 file can be moved to conda-forge-ci-setup
as well.
import sys | ||
|
||
global_config = json.loads(''' | ||
{{ channels | tojson }}''') |
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 the jinja render that that we include here. This provides the fallback for recipes that do not have the channel_targets / channel_sources in their conda_build_config files.
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.
Can we read .conda-forge.yml and get this value?
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.
We don't presently persist this anywhere. I guess we could
227dfbc
to
c4d7f1f
Compare
LGTM |
Simplified utility script
Okay ready for another review |
def make_build_number(args): | ||
specific_config = safe_load(open(args.config_file)) | ||
build_number_inc = specific_config.get("build_number_increment", [0])[0] | ||
rendered_recipe = subprocess.check_output(['conda', 'render', '-m', args.config_file, args.recipe_root]) |
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.
What happens when you have multiple outputs?
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.
Would we expect them to all share a build number? Or can that vary per output?
try: | ||
build_number = int(rendered['build']['number']) | ||
except KeyError: | ||
build_number = 0 |
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.
In this case, clobbered file should be removed
Reworked the build number bump to deal with multiple outputs. |
|
||
def mangle_compiler(args): | ||
"""Try hard to break the compilers for osx""" | ||
# TODO |
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.
What are some good suggestions for things to do here to break compilers?
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.
What do you mean by this?
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.
Basically something we can do to make osx NOT have compilers that are found. Essentially this is so that we don't accidentally build with system compilers when we want to build with the Anaconda ones.
This is easy on linux since its just a docker switch
I don't think there are any recipes with different build numbers for different outputs. Therefore clobber file is fine, but we should make rendering of the output of |
I did some tests and there is nothing intrinsically preventing you from having different build numbers per output. The alternative approach would be to use the |
|
we also use them as markers for things like |
Those have different build numbers, but one build number per variant. Thats' fine. What I'm asking is, is there a use case where one variant (one .yaml in .ci_support) have multiple outputs with different build numbers? |
Mentioned those because clobbering the build number in those cases will require some finesse. Don’t think there are that many split packages. Also can’t see a good reason for them to deviate in this way (assuming it is possible) |
A clobber file is better because you are dealing with a rendered recipe. Regexes like what we do in the last commit is error prone. |
However it doesn’t seem to let us add to the build number. It simply replaces it, which doesn’t seem flexible enough. Though if someone can prove me wrong, that would be good. |
Should add it is worth keeping in mind this code is transient. We want it to work, but perfecting is probably not worthwhile in the long run. |
What are you suggesting here? Are you saying regex replacement is better than clobber file which changes the build number for each variant? |
clobber files do not work for this case. build:
number: 8
outputs:
- name: foo
build:
number: 10
- name: foo2 When rendered with a clobber file this makes the |
import argparse | ||
|
||
global_config = json.loads(''' | ||
{{ channels | tojson }}''') |
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.
Can this be read from the conda-forge.yml
file instead of a jinja template?
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.
After that we don't need to vendor this file in every feedstock
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.
yep, that could be done. Right now we only use that for storing tokens right?
|
||
if build_number_int < 1000: | ||
if not use_legacy_compilers: | ||
raise ValueError("Only legacy compilers only valid with build numbers < 1000") |
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.
Instead of erroring, can we remove new compiler configuration?
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 will catch the situation where we want to turn on new compilers but forgot to bump the build_number.
Is this ready to go in now? |
Nope not yet |
This environment variable is used for rendering variants with the dual compiler stack.
This should be ready to go in now. Let me know if i need to squash-rebase some things down |
@mariusvniekerk - I am not sure I understand where |
@scopatz |
Oh I see. This looks good then. It simplifies the logic here a lot. I'll merge tomorrow if no-one beats me to it. |
Thanks @mariusvniekerk! |
try: | ||
config['channel_targets'] = [config['channel_targets'][0]] | ||
except KeyError: | ||
config['channel_targets'] = ['conda-forge main'] |
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.
Should this have a /
or something between these two?
try: | ||
config['channel_sources'] = [config['channel_sources'][0]] | ||
except KeyError: | ||
config['channel_sources'] = ['conda-forge,defaults'] |
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.
It looks like this is a comma separated list within a YAML list. Should this also be a YAML list?
Sorry for the very late review comments. Noticed a few really minor things during re-rendering, which are noted above. |
@@ -29,6 +29,9 @@ if [ -z "$CONFIG" ]; then | |||
exit 1 | |||
fi | |||
|
|||
pip install shyaml |
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.
Would it make sense to add this to conda-forge
?
This ties with conda-forge/conda-forge-pinning-feedstock#92