-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
Compile issues #232
Comments
Thank you for opening this. Apologies for the difficulties you're having, this is indeed odd. I wasn't able to reproduce with those dependencies in a new project, and there isn't anything out of the ordinary going on in https://github.com/getsentry/sentry-elixir/blob/master/lib/sentry/util.ex with macros, etc. When you have a chance, can you investigate:
I would suspect Sentry has a bug causing this before suspecting Elixir/Erlang, but answers to those questions will help narrow it down. |
Hi again, The only way to actually get this issue was to use elixir version compiled on different OTP then the current one you are using. In our case we've managed to achieve this feat by using asdf version manager with elixir and erlang plugin. One can very easily miss the warning they post here:
so do something like in your .tools-version file:
and you will sometimes get the compile errors.
or
and you are good :) Apologies for wasting your time :) It still baffles me that only sentry had those compilation issues but I think that's just a coincidence. |
@madsheep Thanks for following up, I am glad to hear all was solved, and I've learned to recognize this error. Thank you! |
Sorry to comment on a months-old issue, but I was just able to replicate this error without mismatched OTP versions. Here is the error I got:
I compiled Sentry in this Elixir 1.6.1 Docker image. The image uses Erlang/OTP 20.2.2. Since I'm using that image to compile both Elixir and Sentry, both should be compiled with OTP 20.2.2, as well. When I tried rebuilding the app, everything compiled without errors. EnviromentElixir version: 1.6.1 |
@michaelstalker thanks for the update, hopefully I can get to the bottom of it. Unfortunately, I'm not overly familiar with Docker. Is there a good way for me to reproduce this on my machine? |
I'm not sure. To be honest, I've never reproduced it locally, either. I only get the error in Jenkins, and only intermittently. I know that's not much help 😬 |
I've been looking into Elixir's parallel compiler. It looks like this line is failing to find a file: :elixir_compiler.file(file, dest) and is returning EDIT: Actually, I'd bet it's never getting to the point where it tries to pattern match against {ok, Bin} = file:read_file(File) It looks like Erlang's
|
@michaelstalker Thanks for the effort on researching this. Has this happened with any other libraries that you've seen, or just Sentry? |
Just Sentry. |
Hmm, I will see if I can find someone with more Elixir/Erlang compiler knowledge than myself, as I'm not sure what a solution would look like. |
I posted about the issue on the Elixir Forum, just in case it was a compiler issue. José Valim suggested running |
The only thing I could think of that would justify this behaviour happening for sentry is if you are calling a macro or compiling a file that changes directory. |
@josevalim Thanks for following up! I don't have any file moving/copying in Sentry as I understand it, though we do some Would it be helpful to |
Thanks to @potatosalad we know the cause of the issue and can temporarily make a fix until elixir-lang/elixir#7699 is closed out |
This should be fixed with #285 by defaulting to not including dependencies in reports, so if anyone has issues with the compiler as described in elixir-lang/elixir#7699, please comment here. I'm going to close this issue, and have opened a new issue (#286) to track the upstream Elixir issue and will be evaluating the options once it's fixed. |
Environment
Elixir versions (elixir -v): 1.4.2, 1.4.5
Erlang/OTP versions (erl): 18.2, 19.3, 20.1
Sentry version (mix deps): sentry 6.0.1 (https://github.com/getsentry/sentry-elixir.git) (mix)
locked at 2733e70
Operating system: ubuntu, osx
Description
Every now and then sentry compilation will fail with following error:
On our CI server (circleci) this happens more often then not recently
We see this problem outside our ci server on dev machines as well. It also happened in two different, separate applications (one phoenix, other pure otp) and across different versions of otp and elixir (listed above).
Expected Behavior
It should compile :) the builds are driving one of our devs nuts.
Actual Behavior
It does not compile sometimes. We fail to see any pattern to this.
Steps to Reproduce
The easiest way for me to get this to happen was:
0) On this environment (macbook pro 2016, 8gb, 2Ghz cpu, Sierra)
I'm not 100% sure if this is caused by sentry itself or maybe one of the other deps - however it's only sentry that has those compilation issues.
Let me know what you think.
The text was updated successfully, but these errors were encountered: