nodejs / nodejs/node

Tracking issue: `std::filesystem::path` headaches, and breakage on Windows with non-ASCII paths

Aperta
#58,768 20 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

fs never-stale windows
Lingua principale
JavaScript
Stelle
122k
Fork
37.3k
Merge medio
4g 2h
PR unite (30g)
283

Descrizione

Version

v24.1.0

Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem

No response

What steps will reproduce the bug?

Couldn't find a tracking issue for this one.

There are places in the source that handle std::filesystem::path objects, and on Windows, this involves conversion between UTF-8 strings and wchar-based paths. This can lead to path corruption, as previously discussed.

One example of this is #56049, which has an open PR to fix this specific usage. However, #58764 has just been reported, which affects a completely different area of the API. There are other examples of usage elsewhere in the source.

It feels like this probably needs a library-wide approach – even if not removing std::filesystem::path entirely as previously discussed, then at least some sort of internal wrapper API to abstract out potential footguns.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando #56049 e #58764, quindi cerca nel codice sorgente altri utilizzi di std::filesystem::path. L’attività sarà considerata completata quando sarà stato concordato un approccio a livello dell’intera libreria per gestire le conversioni dei percorsi Windows e risolvere gli utilizzi interessati, inclusi questi esempi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
operating-systems
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.