python / python/cpython

Make COMPILER definition in getcompiler.c optionally static for reproducible builds

Aberta
#144,121 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

build type-feature
Linguagem predominante
Python
Estrelas
77.2k
Forks
35.9k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

Feature or enhancement

Proposal:

SUSE (both for SLE and openSUSE) have been using for a long time (the name of the patchfile starts with python-3.3.0b1 ;)) similar patch to avoid having dynamically generated symbols in the build binaries (version of compilers in this case).

---
 Makefile.pre.in |    5 +++++
 1 file changed, 5 insertions(+)

Index: Python-3.15.0a3/Makefile.pre.in
===================================================================
--- Python-3.15.0a3.orig/Makefile.pre.in	2025-12-19 02:26:23.594002103 +0100
+++ Python-3.15.0a3/Makefile.pre.in	2025-12-19 02:26:28.185444105 +0100
@@ -1926,6 +1926,11 @@
 	      -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
 	      -o $@ $(srcdir)/Modules/getbuildinfo.c
 
+Python/getcompiler.o: $(srcdir)/Python/getcompiler.c Makefile
+	$(CC) -c $(PY_CORE_CFLAGS) \
+		-DCOMPILER='"[GCC]"' \
+		-o $@ $(srcdir)/Python/getcompiler.c
+
 Modules/getpath.o: $(srcdir)/Modules/getpath.c Python/frozen_modules/getpath.h Makefile $(PYTHON_HEADERS)
 	$(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
 		-DPREFIX='"$(host_prefix)"' \

I have discussed upstreaming of this patch on
https://discuss.python.org/t/unversioned-compiler-symbol-for-getcompiler-c/91735 and it seems to me that in order to give this issue some momentum, I have to just file PR here.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs
  • gh-144124

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece com Python/getcompiler.c e suas regras de build em Makefile.pre.in; em seguida, analise o trabalho relacionado em gh-144124. Confirme como a definição de COMPILER é construída e torne opcional sua forma estática sem introduzir símbolos do compilador gerados dinamicamente; verifique se o build continua reproduzível.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
c
Domínio
build-system
Tipo de issue
Funcionalidade
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.