The exdev error is Linux's way of saying that a file cannot be renamed between different file systems (or mount points). I do have the /tmp mounted as tmpfs:
So the problem probably stems from the fact that ExUnit generates tmp dirs inside the Elixir app's directory while the ElectricCli.Migrations.sync_down_migrations() function creates its own tmp dir using System.tmp_dir().
More info about my system:
$ uname -a
Linux fedora 6.2.9-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:31:57 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ iex
Erlang/OTP 25 [erts-13.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.14.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> System.tmp_dir()
"/tmp"
Looking into second test failure, I learned that it's caused by the
{:error, :exdev}
being returned from theinit_migrations()
function in https://github.com/electric-sql/cli/blob/1147ea802332c71a747b304f8b2533a6bd4e9f2f/apps/electric_cli/lib/electric_cli/commands/init.ex#L134-L139I added a call to
IO.inspect
on line 134 and got this output:The
exdev
error is Linux's way of saying that a file cannot be renamed between different file systems (or mount points). I do have the/tmp
mounted astmpfs
:So the problem probably stems from the fact that ExUnit generates tmp dirs inside the Elixir app's directory while the
ElectricCli.Migrations.sync_down_migrations()
function creates its own tmp dir usingSystem.tmp_dir()
.More info about my system: