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

[Nexus] Getting mix setup error for :crc dependency on first run. #76

Open
jaspervanbrian opened this issue Dec 18, 2024 · 3 comments
Open

Comments

@jaspervanbrian
Copy link

Seems renaming of crc_algorithm fails on the first try.
Can confirm I both have gcc and make, but it's giving errors on the first mix setup

Second run of mix setup, seems the app is fine though.

Error message:

==> ex_stun                                                                                                                                                                                                                                   
Compiling 16 files (.ex)                                                                                                                                                                                                                      
warning: 0..(2 <<< 14) - 1 inside guards requires an explicit step, please write 0..(2 <<< 14) - 1//1 or 0..(2 <<< 14) - 1//-1 instead
  lib/ex_stun/message/type.ex:51: ExSTUN.Message.Type.from_value/1                                                     

Generated ex_stun app                                      
==> elixir_make                                            
Compiling 8 files (.ex)                                    
Generated elixir_make app                                  
==> crc                                                    
 C      checksum_xor.c                                     
 C      crc_8.c                                            
 C      crc_algorithm.c                                    
Rename failed: /Users/user/Projects/phoenix-projects/apps/nexus/_build/dev/lib/crc/obj/crc_algorithm-dc3af234.o.tmp -> /Users/user/Projects/phoenix-projects/apps/nexus/_build/dev/lib/crc/obj/crc_algorithm.o: No such file or directory
error: unable to rename temporary '/Users/user/Projects/phoenix-projects/apps/nexus/_build/dev/lib/crc/obj/crc_algorithm-dc3af234.o.tmp' to output file '/Users/user/Projects/phoenix-projects/apps/nexus/_build/dev/lib/crc/obj/crc_algorithm
.o': 'No such file or directory'                           
1 error generated.                                         
make: *** [/Users/user/Projects/phoenix-projects/apps/nexus/_build/dev/lib/crc/obj/crc_algorithm.o] Error 1            
could not compile dependency :crc, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile crc --force", update it with "mix deps.update crc" or clean it with "mix deps.clean crc"
==> nexus                                                  
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs                                                  
are not installed, you will be prompted to install them.
@mickel8
Copy link
Member

mickel8 commented Dec 18, 2024

That's interesting. We didnt notice any problems with crc so far. What's your os, erlang and Elixir versions?

@jaspervanbrian
Copy link
Author

jaspervanbrian commented Dec 18, 2024

@mickel8 I'm on Sonoma, macOS 14.5 23F79 arm64

erl and elixir

Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Elixir 1.17.3 (compiled with Erlang/OTP 27)

@mickel8
Copy link
Member

mickel8 commented Dec 30, 2024

Sorry for the late response. It looks like the problem lies in crc itself, especially looking at their issues(TattdCodeMonkey/crc#32 TattdCodeMonkey/crc#49 TattdCodeMonkey/crc#46 TattdCodeMonkey/crc#39). I am not sure what we can do with this. Erlang crc function (which is a wrapper on zlib) does not allow for specifying custom poly (we need 0x04C11DB7). OpenSSL does not offer crc functions (we already depend on OpenSSl so we could switch to it). The only option I can see is to either contribute to the crc library or move to the Rust library link but this would require other people to install Rust 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants