gleam-lang/gleam

Compilation breaks when renaming project directory

開放

#5,430 建立於 2026年3月5日

 (3 則留言) (0 個反應) (0 位負責人)Rust (960 個分叉)batch import
help wanted

倉庫指標

星標
 (21,417 顆星)
PR 合併指標
 (平均合併 10天 19小時) (30 天內合併 69 個 PR)

描述

Renaming a gleam project directory causes a compilation error. Running the following shell commands (on Arch Linux):

gleam new repro
cd repro
gleam add lustre
gleam build
cd ..
mv repro repro_broken
cd repro_broken
gleam build

Result in the following error:

error: File IO failure

An error occurred while trying to link this file:

    /tmp/tmp.QzSnQdYrRy/repro_broken/build/dev/erlang/lustre/priv

The error message from the file IO library was:

    File exists (os error 17)

Running gleam build a second time seems to fix the error.

I routinely run into this because I run gleam projects via bind mounts in various development containers. It's a bit of a weird setup :D

I didn't do a super deep investigation but it seems related to the symlinks to priv, e.g. in build/dev/erlang/lustre:

ll build/dev/erlang/lustre
Permissions Size User   Group  Date Modified Name
...
lrwxrwxrwx     - rafael rafael  5 Mär 11:50  priv -> /tmp/tmp.QzSnQdYrRy/repro/build/packages/lustre/priv

Would it be an option to use relative links instead? Or to find broken symlinks and recreate them?

In both cases, this seems like an easy issue to fix, if someone is interested in giving some hints I'd like to make a PR :)

貢獻者指南