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

Fix index.json:"platform" in cross-platform builds #4124

Merged
merged 3 commits into from
Nov 13, 2020

Conversation

mbargull
Copy link
Member

If we cross-build on different platforms and not just different architectures of the same platform, the platform key in index.json is not set to the target platform.
refs:

@anaconda-issue-bot anaconda-issue-bot added the cla-signed [bot] added once the contributor has signed the CLA label Nov 13, 2020
@mbargull
Copy link
Member Author

(Adding the actual fix and news entry after seeing the CI fail for the reported issue.)

@mbargull
Copy link
Member Author

mbargull commented Nov 13, 2020

=================================== FAILURES ===================================
________________________ test_cross_info_index_platform ________________________
[gw1] darwin -- Python 3.8.3 /Users/runner/work/1/a/miniconda/bin/python
Traceback (most recent call last):
  File "/Users/runner/work/1/s/tests/test_api_render.py", line 173, in test_cross_info_index_platform
    assert metadata.config.host_platform == info_index['platform']
AssertionError: assert 'win' == 'osx'
  - osx
  + win
=================================== FAILURES ===================================
________________________ test_cross_info_index_platform ________________________
[gw0] linux -- Python 3.8.3 /usr/share/miniconda/bin/python
Traceback (most recent call last):
  File "/home/vsts/work/1/s/tests/test_api_render.py", line 173, in test_cross_info_index_platform
    assert metadata.config.host_platform == info_index['platform']
AssertionError: assert 'win' == 'linux'
  - linux
  + win
================================== FAILURES ===================================
_______________________ test_cross_info_index_platform ________________________
[gw0] win32 -- Python 3.8.5 C:\Users\VssAdministrator\Miniconda3\python.exe
Traceback (most recent call last):
  File "D:\a\1\s\tests\test_api_render.py", line 173, in test_cross_info_index_platform
    assert metadata.config.host_platform == info_index['platform']
AssertionError: assert 'linux' == 'win'
  - win
  + linux

🎉 (as intended).

@mbargull mbargull changed the title Add test_cross_info_index_platform Fix index.json:"platform" in cross-platform builds Nov 13, 2020
@mbargull
Copy link
Member Author

NB: Of course there are more hurdles for general purpose "Windows on Unix" building (linking, prefix replacement, ...).
The intend from me is to use it for "simple" cases, i.e., only-text-file packages and completely statically linked binaries with no prefix references in them.
refs: conda-forge/containers-common-feedstock#1 , conda-forge/skopeo-feedstock#9

@mbargull
Copy link
Member Author

(Failures on macOS are unrelated, something storage-related or the like.)

@mingwandroid mingwandroid merged commit 363010b into conda:master Nov 13, 2020
@mingwandroid
Copy link
Contributor

Thanks @mbargull

mingwandroid pushed a commit to mingwandroid/conda-build that referenced this pull request Nov 26, 2020
@github-actions
Copy link

github-actions bot commented Mar 6, 2022

Hi there, thank you for your contribution!

This pull request has been automatically locked because it has not had recent activity after being closed.

Please open a new issue or pull request if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Mar 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants