Skip to content

[3.14] reinstate _OPTIMIZED & LTO_CFLAGS for correct flag handling in install_base.sh - #914

Merged
isuruf merged 1 commit into
conda-forge:3.14from
h-vetinari:3.14
Sep 2, 2026
Merged

[3.14] reinstate _OPTIMIZED & LTO_CFLAGS for correct flag handling in install_base.sh#914
isuruf merged 1 commit into
conda-forge:3.14from
h-vetinari:3.14

Conversation

@h-vetinari

Copy link
Copy Markdown
Member

Fix-up for #894 (noticed while working on #913), because the following code actually requires _OPTIMIZED to be set

declare -a _FLAGS_REPLACE=()
if [[ ${_OPTIMIZED} == yes ]]; then
_FLAGS_REPLACE+=(-O3)
_FLAGS_REPLACE+=(-O2)
_FLAGS_REPLACE+=("-fprofile-use")
_FLAGS_REPLACE+=("")
_FLAGS_REPLACE+=("-fprofile-correction")
_FLAGS_REPLACE+=("")
_FLAGS_REPLACE+=("-L.")
_FLAGS_REPLACE+=("")
for _LTO_CFLAG in "${LTO_CFLAGS[@]}"; do
_FLAGS_REPLACE+=(${_LTO_CFLAG})
_FLAGS_REPLACE+=("")
done
fi
SYSCONFIG=$(find ${_buildd_static}/$(cat ${_buildd_static}/pybuilddir.txt) -name "_sysconfigdata*.py" -print0)
cat ${SYSCONFIG} | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \
"${_FLAGS_REPLACE[@]}" \
> ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG})

@conda-forge-admin

conda-forge-admin commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipe/meta.yaml:

  • ℹ️ The recipe is not parsable by parser conda-souschef (grayskull). This parser is not currently used by conda-forge, but may be in the future. We are collecting information to see which recipes are compatible with grayskull.
  • ℹ️ The recipe is not parsable by parser conda-recipe-manager. The recipe can only be automatically migrated to the new v1 format if it is parseable by conda-recipe-manager.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/33570485145. Examine the logs at this URL for more detail.

@h-vetinari h-vetinari changed the title [3.14] reinstate _OPTIMIZED for correct flag handling in install_base.sh [3.14] reinstate _OPTIMIZED & LTO_CFLAGS for correct flag handling in install_base.sh Sep 1, 2026
…l_base.sh

deleted in 636474b without noticing remaining use
@h-vetinari

Copy link
Copy Markdown
Member Author

6d161cc is a glimpse (though for 3.12) of how 636474b should have looked.

@h-vetinari

Copy link
Copy Markdown
Member Author

@isuruf, this is an attempt at a minimal fix for the sysconfig data, which is not getting populated as before due to missing variables after splitting the build scripts (as an aside, we could add a check for undefined variables if you'd like).

However, we may want to improve the situation beyond the minimal fix. When everything was part of a single build_base.sh this wasn't an issue, but after the split it's IMO not very attractive to duplicate the LTO_CFLAGS & _FLAGS_REPLACE logic on both the build & install side. Perhaps we should move it to CBC?

@isuruf
isuruf merged commit e786cf8 into conda-forge:3.14 Sep 2, 2026
31 checks passed
@isuruf

isuruf commented Sep 2, 2026

Copy link
Copy Markdown
Member

I think it's fine to duplicate for now

@itamarst

itamarst commented Sep 2, 2026

Copy link
Copy Markdown

I'm seeing errors compiling Python extensions because of gcc being called with a non-existent -partition=none argument.

It kinda seems like -flto-partition=none got turned into -partition=none in Python source code (e.g. in lib/python3.14/_sysconfigdata__linux_x86_64-linux-gnu.py).

Would that be fixed by this PR, or caused by this PR? This just started happening recently in CI, I reproduced locally using:

libpython                   3.14.7           hdc7f604_105_cp314    conda-forge
python                      3.14.7           hcd007b5_105_cp314    conda-forge

Looking at the PR it kinda seems like it might be caused by this but I don't understand enough bash so before I go further figured I'd ask.

@isuruf

isuruf commented Sep 2, 2026

Copy link
Copy Markdown
Member

Fixed in #919

@h-vetinari
h-vetinari deleted the 3.14 branch September 2, 2026 20: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.

4 participants