Open sgerrand opened 2 months ago
I suspect that this issue may be related in some way to #624 (and others) as I've encountered similar issues when using mix new
to create a new project in the same Replit repo:
$ mix new testapp
* creating README.md
* creating .formatter.exs
* creating .gitignore
* creating mix.exs
* creating lib
* creating lib/testapp.ex
* creating test
* creating test/test_helper.exs
* creating test/testapp_test.exs
Your Mix project was created successfully.
You can use "mix" to compile it, test it, and more:
cd testapp
mix test
Run "mix help" for more commands.
~/Test-Hex-package-fetching-errors$ cd testapp
~/Test-Hex-package-fetching-errors/testapp$ mix deps.fetch
Compiling 1 file (.ex)
** (EXIT from #PID<0.94.0>) an exception was raised:
** (File.Error) could not touch "/home/runner/Test-Hex-package-fetching-errors/testapp/_build/dev/lib/testapp/ebin/Elixir.Testapp.beam": not owner
(elixir 1.16.3) lib/file.ex:631: File.touch!/2
(elixir 1.16.3) lib/kernel/parallel_compiler.ex:334: anonymous fn/3 in Kernel.ParallelCompiler.write_module_binaries/3
(elixir 1.16.3) lib/enum.ex:1264: anonymous fn/3 in Enum.flat_map/2
(stdlib 4.3.1.4) maps.erl:411: :maps.fold_1/3
(elixir 1.16.3) lib/enum.ex:2540: Enum.flat_map/2
(elixir 1.16.3) lib/kernel/parallel_compiler.ex:260: Kernel.ParallelCompiler.spawn_workers/3
(mix 1.16.3) lib/mix/compilers/elixir.ex:1002: anonymous fn/9 in Mix.Compilers.Elixir.compiler_loop/6
If I simulate the underlying calls like @nicbet did earlier, then I have a whole bunch of :undefined
atoms returned:
defmodule XFile do
require Record
Record.defrecord(:file_info, Record.extract(:file_info, from_lib: "kernel/include/file.hrl"))
end
require XFile
finfo = XFile.file_info(mtime: :calendar.universal_time())
iex(4)> finfo = XFile.file_info(mtime: :calendar.universal_time())
{:file_info, :undefined, :undefined, :undefined, :undefined,
{{2024, 9, 18}, {13, 45, 40}}, :undefined, :undefined, :undefined, :undefined,
:undefined, :undefined, :undefined, :undefined}
Can you check with replit to see if they have any ideas on why this might time and how to work around it. If the reason is because they have a filesystem with limited functionality I bet they have ran into this before.
Of course. This was their support team's response to date:
Thank you for contacting Replit Support.
This is a strange one as it looks to be a package issue as opposed to a Replit issue. There are already bugs around this in Elixir, though not exactly this invocation: https://github.com/elixir-lang/elixir/issues/8875
The suggestion in that thread is that mtime was turned off on the filesystem, giving the impression writes were not possible.
Sorry we couldn't be of more help, but you can try posting the issue with Elixir to see if they have solutions or workarounds.
I've asked them for more information about the filesystem that is currently made available for Replit's repls to narrow down the cause(s).
Following up in https://github.com/elixir-lang/elixir/issues/8875.
💁 I've been experiencing strange problems when using Elixir on Replit
Observed behaviour
With the following
mix.exs
(shamelessly stolen from Wojtek'sReq
docs):The following error is returned:
This appears to be caused by the type of filesystem that Replit exposes and I suspect that they're mounting it with things like
mtime
turned off.Source Replit repo
Expected behaviour
Hex fetches dependencies successfully.