42_GradeMe
42_GradeMe copied to clipboard
Compilation Error During Grademe Installation on NixOS (42_EXAM Compilation Error)
Hello,
I encountered a compilation error while trying to install Grademe on NixOS. Initially, I added the necessary dependencies (gcc, gnumake, readline, etc.) to my configuration.nix file, but Grademe failed to detect these dependencies. Then, I temporarily installed the required dependencies using nix-shell -p and ran Grademe, which resulted in the following error:
Operating System: Linux nixos 6.6.72 #1-NixOS SMP PREEMPT_DYNAMIC Fri Jan 17 12:36:27 UTC 2025 x86_64 GNU/Linux
Error Message:
Copy ✔ You have the last version v2.1 ✔ Checking readline library ✗ Compilation of 42_EXAM Oops ! Something went wrong during the compilation... Please make a report on Github repo, make sure to include this :
- Your OS: Linux nixos 6.6.72 #1-NixOS SMP PREEMPT_DYNAMIC Fri Jan 17 12:36:27 UTC 2025 x86_64 GNU/Linux
- The error message:
.system/exercise.cpp: In member function ‘int exam::change_ex()’: .system/exercise.cpp:21:11: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | system("clear"); | ~~~~~~^~~~~~~~~ .system/exercise.cpp: In member function ‘bool exam::prepare_current_ex()’: .system/exercise.cpp:47:11: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 47 | system("mkdir rendu 2> /dev/null"); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ .system/exercise.cpp:48:11: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 48 | system("mkdir subjects 2> /dev/null"); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .system/exercise.cpp:49:11: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 49 | system("mkdir .system/grading 2> /dev/null"); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .system/exercise.cpp:53:11: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 53 | system(cmd_system_call.c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ .system/exercise.cpp:57:11: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 57 | system(cmd_system_call.c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ Steps I Tried:
Added Dependencies to configuration.nix: I added the following packages to the environment.systemPackages section:
nix Copy environment.systemPackages = with pkgs; [ gcc gnumake readline pkg-config ]; However, Grademe failed to detect these dependencies.
Created a Temporary Environment with nix-shell: I installed the necessary dependencies temporarily using:
bash Copy nix-shell -p gcc gnumake readline pkg-config When I ran Grademe in this environment, I encountered the error message above.
Set LD_LIBRARY_PATH Manually: I manually set the library path for readline:
bash
Copy
export LD_LIBRARY_PATH=$(nix-build '
Additional Information:
Since NixOS has a unique structure compared to traditional package managers, such issues can arise.
The warnings about ignoring the return value of system() might be affecting the compilation process.
Do You Have Any Suggestions or Solutions?
If you have any recommendations or solutions for this issue, please let me know. Additionally, would you consider adding official support for NixOS?
Thank you!