cargo builds can corrupt consumer git repos due to env vars
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- git, rust
- Ambito
- build-system
Direzione di ricerca
Inizia in boring-sys/build/main.rs, concentrandoti sui due punti in cui viene chiamato git e sull’uso esistente di git rev-parse --local-env-vars. Verifica in che modo il buildscript invoca git quando Cargo viene eseguito da un hook o da un worktree. Il lavoro è completato quando tali invocazioni non ereditano più variabili d’ambiente di Git che possano influire sul repository consumer.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
The buildscript in boring-sys/build/main.rs calls out to git to set up the BoringSSL sources. When a project using this crate runs cargo from a git hook, git has already set variables like GIT_DIR for the hook. The buildscript here doesn't sanitize those variables, so git init re-initializes the consumer's repo, rather than the BoringSSL repo the buildscript intended.
Normally that's harmless, but when the build is running from a worktree rather than the main checkout, a surprising git interaction causes it to write core.bare = true into the main checkout's config, breaking most git commands in that main checkout until the config is fixed. Unexpected behaviour from git, for sure, but definitely not something we want to trigger from our build.
Proposed fix
Before invoking git in boring-sys/build/main.rs (2 call sites), strip env vars that would alter git's behaviour. git rev-parse --local-env-vars prints a list of those vars; for me, it gives:
GIT_ALTERNATE_OBJECT_DIRECTORIES
GIT_CONFIG
GIT_CONFIG_PARAMETERS
GIT_CONFIG_COUNT
GIT_OBJECT_DIRECTORY
GIT_DIR
GIT_WORK_TREE
GIT_IMPLICIT_WORK_TREE
GIT_GRAFT_FILE
GIT_INDEX_FILE
GIT_NO_REPLACE_OBJECTS
GIT_REPLACE_REF_BASE
GIT_PREFIX
GIT_SHALLOW_FILE
GIT_COMMON_DIR
- Lingua principale
- Rust
- Stelle
- 526
- Fork
- 178
- Merge medio
- 16h 47m
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudflare/boring
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
cloudflare/boring#526 ·
-
SLH-DSA supportForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
cloudflare/boring#522 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
cloudflare/boring#517 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
cloudflare/boring#500 · 2 commenti ·
-
v4 -> v5 upgrade pathApertav5
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
cloudflare/boring#442 · 1 commento · 2 reazioni ·
Tutte le issue di cloudflare/boring
Issue simili
-
ai_p1 comp-message-queues
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ClickHouse/ClickHouse#125890 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
storytold/photocraft#5710 ·
I maintainer di solito rispondono entro 1 giorno
-
Two tests fail on a Windows checkout: a CRLF parse in feature_walk_tests, an 8.3 TEMP path in libraries_testsForse già presa @CamWight l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bherbruck/solvecraft#1186 · 1 commento ·
-
area: screenshot audit bug good first issue priority: P3 security severity: info type: correctness
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pierruno-labs/prowl#31 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
limitlessprojects/Go-Hybrid#50 ·
I maintainer di solito rispondono entro 1 giorno