Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elixir 1.5.1 dialyzer_test.exs fails on GNU Guix #6586

Closed
pjotrp opened this issue Sep 20, 2017 · 7 comments
Closed

elixir 1.5.1 dialyzer_test.exs fails on GNU Guix #6586

pjotrp opened this issue Sep 20, 2017 · 7 comments

Comments

@pjotrp
Copy link

pjotrp commented Sep 20, 2017

I am trying to update the installation of elixir 1.5.1 GNU Guix. The following dialyzer tests fail with

  1) test no warnings on with/else (Kernel.DialyzerTest)
     test/elixir/kernel/dialyzer_test.exs:108
     ** (File.CopyError) could not copy from "/tmp/guix-build-elixir-1.5.1.drv-0/elixir-1.5.1/lib/elixir/tmp/dialyzer/Elixir.Dialyzer.With.beam" to "/tmp/guix-build-elixir-1.5.1.drv-0/elixir-1.5.1/lib/elixir/tmp/dialyzer/line108/Elixir.Dialyzer.With.beam": no such file or directory
     code: copy_beam! context, Dialyzer.With
     stacktrace:
       (elixir) lib/file.ex:631: File.cp!/3
       test/elixir/kernel/dialyzer_test.exs:109: (test)



  2) test no warnings on for falsey check that always boolean (Kernel.DialyzerTest)
     test/elixir/kernel/dialyzer_test.exs:102
     ** (File.CopyError) could not copy from "/tmp/guix-build-elixir-1.5.1.drv-0/elixir-1.5.1/lib/elixir/tmp/dialyzer/Elixir.Dialyzer.ForBooleanCheck.beam" to "/tmp/guix-build-elixir-1.5.1.drv-0/elixir-1.5.1/lib/elixir/tmp/dialyzer/line102/Elixir.Dialyzer.ForBooleanCheck.beam": no such file or directory
     code: copy_beam! context, Dialyzer.ForBooleanCheck
     stacktrace:
       (elixir) lib/file.ex:631: File.cp!/3
       test/elixir/kernel/dialyzer_test.exs:103: (test)



  3) test no warnings on defmacrop (Kernel.DialyzerTest)
     test/elixir/kernel/dialyzer_test.exs:114
     ** (File.CopyError) could not copy from "/tmp/guix-build-elixir-1.5.1.drv-0/elixir-1.5.1/lib/elixir/tmp/dialyzer/Elixir.Dialyzer.Defmacrop.beam" to "/tmp/guix-build-elixir-1.5.1.drv-0/elixir-1.5.1/lib/elixir/tmp/dialyzer/line114/Elixir.Dialyzer.Defmacrop.beam": no such file or directory
     code: copy_beam! context, Dialyzer.Defmacrop
     stacktrace:
       (elixir) lib/file.ex:631: File.cp!/3
       test/elixir/kernel/dialyzer_test.exs:115: (test)

The GNU Guix build environment is restricted and I disabled these tests. Is there a way to fix them?

@josevalim
Copy link
Member

In what ways GNU Guix is restricted? Some tests require us to work with temporary directories and if those are not available, disabling the tests is the way to go.

@pjotrp
Copy link
Author

pjotrp commented Sep 20, 2017

Restrictions apply to using files outside the build tree and there should be no outside network access. All with reproducibility in mind (deterministic builds). Creating files in the build tree should be OK.

Above tests want to copy to, for example,

lib/elixir/tmp/dialyzer/line114/Elixir.Dialyzer.Defmacrop.beam

The directory $src/lib/elixir/tmp does not exist at test time. Any idea why?

I have more failing tests, but would like to resolve them one by one. Or disable them, as you say, but I think we should only disable when there is no other way. Patches are hard to maintain. Note that Erlang has no patches against its source tree and tests in GNU Guix. It is possible. And getting it to work with Guix will make it bullet proof in other environments.

@josevalim
Copy link
Member

@pjotrp sure. But how being unable to create a temporary directory is going to help us? A lot of our tests are asserting we are able to perform some operations against the file system. After all, we need to assert we can create directories, files, links, etc.

@pjotrp
Copy link
Author

pjotrp commented Sep 20, 2017

No worries, you can create temporary directories in the build tree. But not outside. What is not clear to me is how it is getting done in above case. I guess I have to dig a little deeper.

@josevalim
Copy link
Member

@pjotrp thank you, I understand it now. I misread the original report, it seems it is trying to create something in /tmp, which we likely shouldn't do, instead of using a tmp inside the build tree. Please do investigate!

@pjotrp
Copy link
Author

pjotrp commented Sep 20, 2017

Actually the build system is in /tmp. It is not that bad. Looks like mkdir_p! misses out on creating the dir. I'll check why this is. Maybe it is a permission thing.

@pjotrp
Copy link
Author

pjotrp commented Sep 21, 2017

I am closing this issue because it is a Guix environment thing and I have trouble replicating it outside the Guix build system. I will look into it again and post a fix when there is one.

@pjotrp pjotrp closed this as completed Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants