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 local builds of feedstock submodules #1826

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

jakirkham
Copy link
Member

@jakirkham jakirkham commented Jan 5, 2024

Fixes #1825

In conda-smithy version 3.28.0 logic was added to store metadata about CI ( #1577 ) like the sha of the feedstock that was used to build. As the sha variable may not be set when running locally, logic was added with the container to determine this by running git rev-parse to fill in this value

if [[ "${sha:-}" == "" ]]; then
pushd ${FEEDSTOCK_ROOT}
sha=$(git rev-parse HEAD)
popd
fi

While this works in the simple case of cloning a feedstock directly, it does not work in the case of building a feedstock from a submodule as is the case with the feedstocks repo. This is due to the fact that the .git repo information is not full available within the Docker container as it does not exist in the feedstock that is mounted (and is not otherwise provided for).

However this information is available before spinning up the Docker container. So this PR moves the logic to fill in sha to precede spinning up the Docker container. This is equivalent to the behavior already present in the local macOS builds, which don't use containers

if [[ "${sha:-}" == "" ]]; then
sha=$(git rev-parse HEAD)
fi

Closes conda-forge/ca-certificates-feedstock#64 (used for testing these changes)


Checklist

  • Added a news entry

As the content mounted in the Docker image may be insufficient to
determine the commit SHA (as is the case of feedstock submodules), fill
in the missing `sha` variable before the container is spun up. This
should ensure `sha` is set one way or another in the container.
@jakirkham
Copy link
Member Author

Tested these changes with the ca-certificates feedstock by building on CI and locally (using the feedstocks submodule for ca-certificates). Both seem to work ok

xref: conda-forge/ca-certificates-feedstock#64

@isuruf isuruf merged commit ae188fb into conda-forge:main Jan 5, 2024
1 check passed
@isuruf
Copy link
Member

isuruf commented Jan 5, 2024

Thanks

@jakirkham jakirkham deleted the simp_sha_config branch January 5, 2024 10:11
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

Successfully merging this pull request may close these issues.

python build-locally.py fails with feedstocks repo submodules
2 participants