Closed if1live closed 1 year ago
@gleam-lang/elixir-team does this sound familiar to anyone?
I just made a fresh copy of basic_project
from this repository, added rad
(which has a priv
dir) to mix.exs
, then ran mix deps.get
. After that, mix compile
worked without issue.
Locally I have MixGleam v0.6.0
and gleam
compiled from its main
branch.
I have this issue too on a newly generated Phoenix project.
The issue seems to be that the link to priv
directory has already been created by mix.
It works if skipping priv
when copying files, e.g. changing this line from
File.cp_r!(out, Mix.Project.app_path())
to
app_path = Mix.Project.app_path()
for path <- File.ls!(out), path != "priv" do
from = Path.join(out, path)
to = Path.join(app_path, path)
File.cp_r!(from, to)
end
Great find, thank you!
It seems File.cp_r!
should just replace the priv
link when it already exists in the dest dir, but in my case (on Windows 10) it fails and returns {:error, :eperm}
. I'm not sure if it works fine on Linux though.
@xhh can you confirm that this issue is fixed? Much appreciated.
The path to check if is symlink should be the src path, not dest. I've made a pull request: #29, and then the bug is confirmed to be fixed with the changes.
@xhh, why check src
?
The problem occurs when priv
already exists in dest
; moreover, we want to ensure that priv
actually does exist in dest
, no?
Why would it matter if priv
is a symlink in src
?
@tynanbe I tried with a newly created Phoenix project, there's already a priv
directory in the dest, which I think was created by mix/phoenix. And in the src directory there's a priv
symlink:
Thanks!
mix compile.gleam error message
reason
gleam v0.20.0-rc1 release note
mix compile.gleam
build/dev/erlang/<app>/priv
ifpriv
existsFile.cp_r!
invoked https://github.com/gleam-lang/mix_gleam/blob/v0.6.0/lib/mix/tasks/compile/gleam.ex