Pjotr Prins writes: > On Mon, Jul 25, 2016 at 08:13:33AM +0200, Ricardo Wurmus wrote: >> > + (native-inputs >> > + `(("patch" ,patch) >> > + ("patch/elixir-disable-failing-tests" >> > + ,(search-patch "elixir-disable-failing-tests.patch")) >> > + ("patch/elixir-disable-mix-tests" >> > + ,(search-patch "elixir-disable-mix-tests.patch")))) >> >> This has been mentioned already and I’d like to move these to the >> “source” field after identifying the reason why the build fails >> otherwise. I see that you’re doing this in order to patch after the >> build phase. Let’s see if this can be avoided. > > I tried and failed. Elixir people do not know either: > > https://github.com/elixir-lang/elixir/issues/5043 > > I think it is Mix magic. Probably tracking files in some way. The reason seems to be that Elixir doesn’t compile files when the timestamp is the epoch. There is a staleness check before compilation. When you patch files in a build phase their timestamps are changed, and that leads to successful compilation. To fix this when patching in the “source” expression I added a phase to change the timestamps of all files to something more recent, recent enough to also pass the staleness tests that check against a date of Jan 1, 2000. >> Note we are talking a rather small minority of tests. 11 out of 2000+ >> for Elixir. For Mix 10% fails, mostly because of git. The Elixir >> people wrote there should be no network access involved. This one is weird and I haven’t been able to track it down. During the testing phase the “git_repo” fixture seems to be missing. This causes all the git tests to fail. I don’t know at what point it is generated and at what point it disappears, but I documented that this appears to be the problem, so that it can be fixed at a later point. >> > +diff --git a/lib/elixir/test/elixir/node_test.exs b/lib/elixir/test/elixir/node_test.exs >> > +index d1f1fe6..5c2d469 100644 >> > +--- a/lib/elixir/test/elixir/node_test.exs >> > ++++ b/lib/elixir/test/elixir/node_test.exs >> > +@@ -6,8 +6,10 @@ defmodule NodeTest do >> > + doctest Node >> > + >> > + test "start/3 and stop/0" do >> > +- assert Node.stop == {:error, :not_found} >> > +- assert {:ok, _} = Node.start(:hello, :shortnames, 15000) >> > +- assert Node.stop() == :ok >> > ++ IO.puts "Skipping test because GNU Guix does not allow the HOME environment variable." >> > ++ >> > ++ # assert Node.stop == {:error, :not_found} >> > ++ # assert {:ok, _} = Node.start(:hello, :shortnames, 15000) >> > ++ # assert Node.stop() == :ok >> > + end >> > + end >> >> This was already addressed earlier. We can probably just setenv HOME >> before the tests. >> >> Some of the remaining tests don’t seem to have any obvious fixes, so >> I’ll get to them after making the above changes first. Maybe the >> failures disappear then. >> >> Thanks again for the patch. I hope you are willing to provide some >> guidance when I have some problems understanding certain bits of the >> build. > > I am happy to help out if you take the lead. I documented the most common test errors, but there don’t seem to be any quick fixes. Attached is a new patch based on yours. If this looks good to you I’ll push it with you as the commit author and with a “Co-authored-by: Ricardo Wurmus” line in the commit summary. What do you think? ~~ Ricardo