Repository: conda-forge/conda-smithy

Issue:
Windows 32-bit using 64-bit install
It appears the 64-bit Miniconda install is being used for 32-bit builds. For example, please see [this log]( https://ci.appveyor.com/project/conda-forge/python-snappy-feedstock/build/job/ccgk75m1kwcflu1j ). This is causing the build to fail.


Discussion:
cc @msarahan
If you are talking about this: https://ci.appveyor.com/project/conda-forge/python-snappy-feedstock/build/1.0.21/job/ccgk75m1kwcflu1j#L72

That's expected.  The outer root environment (the one running conda-build) is expected to be win-64.  The build env is also expected to be win-64.  The host env is what may vary depending on target_platform.  I don't really think any sort of cross-compiling (which is technically what you're doing here) is going to work without using the new compiler syntax, and without splitting build and host prefixes.
Good to know.

Yeah would expect we need to update [these lines in the template]( https://github.com/conda-forge/conda-smithy/blob/v3.0.0.rc2/conda_smithy/templates/appveyor.yml.tmpl#L31-L34 ) and [these lines in the code]( https://github.com/conda-forge/conda-smithy/blob/v3.0.0.rc2/conda_smithy/configure_feedstock.py#L522 ) to select between either 32-bit or 64-bit.

We use to have some code like this, but I think it got swept away with the move to `conda-build` 3 in `conda-smithy`. This is completely fine as this code would need to be retooled for `conda-build` 3 anyways.

Is there a good way for us to check whether a build will target 32-bit or 64-bit? It's set in `conda-forge-pinning` AFAICT. Just not sure how we can get at this info in `conda-smithy`.
So I tried to use the compiler packages, but it appears to be picking up VS 2015 in a Python 2.7 build as seen in [this log]( https://ci.appveyor.com/project/conda-forge/numcodecs-feedstock/build/1.0.41/job/pah0n36j6if7n6bl ). Guessing I'm doing something wrong, but not really sure what.
You appear to be missing any form of zip_keys, which is what keeps the python-VS version association.  Are you using conda-forge-pinning?  If not, I wouldn't really expect things to work.
Yes. Though guess another re-rendering is needed after the compiler packages are added, which I wasn't aware of.

That said, it appears to have added combinations of Python and VS that aren't suppose to combined (e.g. Python 3.5 and VS 2008 or Python 2.7 and VS 2015). Are we missing something from the pinning file or are my recipes missing something?
Did you see [this comment]( https://github.com/conda-forge/python-snappy-feedstock/pull/12#issuecomment-372146224 ), @msarahan? Something funny is happening with the 32-bit builds. Tried adding the compiler as a build requirement for the wheel, but it doesn't seem to help.

More generally confused about why `zip_keys` isn't effectively avoiding problematic combinations of python-VS despite using the latest version of the pinning file.
Yes, I see that comment.  I'll look at it when I can.  Unfortunately, I'm a little sick right now, and my head is molasses.  I suspect that the key trimming in conda-smithy is being overzealous.
No worries. Just wanted to make sure it wasn't lost in the noise since it seems to indicate a more general problem than building wheels.

Hope you get better. This can certainly wait. :)

> ...suspect that the key trimming in conda-smithy is being overzealous.

We may want to take a look at this ourselves. (cc @isuruf)

Resolving patch:
diff --git a/conda_smithy/configure_feedstock.py b/conda_smithy/configure_feedstock.py
--- a/conda_smithy/configure_feedstock.py
+++ b/conda_smithy/configure_feedstock.py
@@ -124,7 +124,7 @@ def _trim_unused_zip_keys(all_used_vars):
     """Remove unused keys in zip_keys sets, so that they don't cause unnecessary missing value
     errors"""
     groups = all_used_vars.get('zip_keys', [])
-    if groups and not isinstance(groups[0], list):
+    if groups and not any(isinstance(groups[0], obj) for obj in (list, tuple)):
         groups = [groups]
     used_groups = []
     for group in groups:
@@ -187,8 +187,9 @@ def _collapse_subpackage_variants(list_of_metas):
     preserve_top_level_loops = set(top_level_loop_vars) - set(all_used_vars)
 
     # Add in some variables that should always be preserved
-    all_used_vars.update(set(('zip_keys', 'pin_run_as_build', 'MACOSX_DEPLOYMENT_TARGET',
-                              'macos_min_version', 'macos_machine')))
+    always_keep_keys = set(('zip_keys', 'pin_run_as_build', 'MACOSX_DEPLOYMENT_TARGET',
+                            'macos_min_version', 'macos_machine'))
+    all_used_vars.update(always_keep_keys)
     all_used_vars.update(top_level_vars)
 
     used_key_values = {key: squished_input_variants[key]
@@ -623,7 +624,8 @@ def check_version_uptodate(resolve, name, installed_version, error_on_warn):
     if installed_version is None:
         msg = "{} is not installed in root env.".format(name)
     elif VersionOrder(installed_version) < VersionOrder(most_recent_version):
-        msg = "{} version in root env is out-of-date.".format(name)
+        msg = "{} version in root env ({}) is out-of-date ({}).".format(
+            name, installed_version, most_recent_version)
     else:
         return
     if error_on_warn:


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -53,6 +53,12 @@ def config_yaml(testing_workdir):
         f.write('target_platform:\n')
         f.write('- win-64   # [win]\n')
         f.write('- win-32   # [win]\n')
+        f.write('c_compiler:\n  # [win]')
+        f.write('- vs2008\n  # [win]')
+        f.write('- vs2015\n  # [win]')
+        f.write('zip_keys:\n  # [win]')
+        f.write('- c_compiler\n   # [win]')
+        f.write('- python\n   # [win]')
     # dummy file that needs to be present for circle ci.  This is created by the init function
     os.makedirs(os.path.join(testing_workdir, '.circleci'))
     with open(os.path.join(testing_workdir, '.circleci', 'checkout_merge_commit.sh'), 'w') as f:
@@ -123,7 +129,9 @@ def py_recipe(config_yaml, request):
     name: py-test
     version: 1.0.0
 requirements:
-    build:
+    build:                      # [win]
+        - {{ compiler('c') }}   # [win]
+    host:
         - python
     run:
         - python
@@ -159,6 +167,7 @@ def skipped_recipe(config_yaml, request):
                                                exclusive_config_file=os.path.join(config_yaml,
                                                                                   'config.yaml')))
 
+
 @pytest.fixture(scope='function')
 def python_skipped_recipe(config_yaml, request):
     os.makedirs(os.path.join(config_yaml, 'recipe'))
diff --git a/tests/test_configure_feedstock.py b/tests/test_configure_feedstock.py
--- a/tests/test_configure_feedstock.py
+++ b/tests/test_configure_feedstock.py
@@ -87,7 +87,8 @@ def test_py_matrix_appveyor(py_recipe, jinja_env):
     assert py_recipe.config['appveyor']['enabled']
     matrix_dir = os.path.join(py_recipe.recipe, '.ci_support')
     assert os.path.isdir(matrix_dir)
-    # 2 python versions, 2 target_platforms
+    # 2 python versions, 2 target_platforms.  Recipe uses c_compiler, but this is a zipped key
+    #     and shouldn't add extra configurations
     assert len(os.listdir(matrix_dir)) == 4