`contract build` can expose an empty wasm to concurrent builds
Mantenedores costumam responder em até 1 dia
@leighmcculloch já está trabalhando nisso.
Desde 15/10/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
What version are you using?
28.1.0 (main at d95abbc).
What did you do?
Ran two stellar contract build (or contract deploy/upload auto-build) processes at the same time on the same cargo workspace.
Note that this also happens in the auto_build integration tests and causes builds to fail sometimes. e.g. deploy_workspace_with_package_auto_builds in this run.
What did you expect to see?
Both builds succeed, with each reader seeing either the previous complete wasm or the new complete wasm.
What did you see instead?
The second build fails with ❌ error: unexpected end-of-file (at offset 0x0) after cargo reports Finished. Perhaps writing each rewrite to a temp file in the same directory and renaming it over the target could avoid the empty window while still breaking the deps/ hard link, though there may be other options worth weighing.
Thoughts
After cargo releases its build lock, inject_meta and filter_spec in cmd/soroban-cli/src/commands/contract/build.rs each rewrite the output wasm in place with fs::remove_file followed by fs::write, and fs::write creates an empty file before writing the bytes, so another process reading the same path in that window sees zero bytes. The remove-then-write pattern came from #1896 to break the hard link cargo keeps to deps/ (#1694), and the only step that writes to a temp file and renames into place today is --optimize, while the --out-dir copy uses fs::copy, which is also not atomic.
The file would not exist as a zero length file for a brief period if it was written to a temp directory, or with a random filename in the current directory, then renamed into place after the write is complete. So this is probably the ideal fix.
- Linguagem predominante
- Rust
- Estrelas
- 129
- Forks
- 153
- Merge médio
- 1d 14h
- PRs com merge (30d)
- 11
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de stellar/stellar-cli
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
stellar/stellar-cli#2887 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
stellar/stellar-cli#2880 ·
Mantenedores costumam responder em até 1 dia
-
arg_value_union panics on zero-arity union tuple case (unchecked type_[0] index)Talvez já em andamento @hvoi assumiu há 22 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
stellar/stellar-cli#2806 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
contract extend panics on single-change resultMetaXdr (index out of bounds at extend.rs:306)Talvez livre de novo @duongynhi000005-oss assumiu há 18 dias e não há nenhum pull request aberto. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
stellar/stellar-cli#2796 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Document stellar-cli's RPC trust boundaryTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
stellar/stellar-cli#2781 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de stellar/stellar-cli
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
stellar/rs-stellar-xdr#621 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Pin `scope.options.variant` on the `status-light` "Semantic (Dot)" / "Non-semantic (Dot)" relationshipsTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertadesign-data-spec
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
adobe/spectrum-design-data#1755 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia