Few hours ago heard about zig from YT and immediately started learning. I am on arch-linux wayland. Installed zig with pacman. I have a remote windows(ntfs) directory mounted on my local arch linux with SSHFS. I mostly code in C/C++ and all my projects are inside this remote directory. I can read-write-execute from this remote directory. So I created a new sub-directory inside that remote directory and ran “zig init” which went well. But then I tried “zig build run” and there is a LLVM error
I am new to the zig environment and build system. Need some help here.
I tried the whole build setup in one of my local directory and it worked. no LLVM error now. But I wanna use the SSHFS, it’s my primary project folder. All my c/c++ code with gcc,make executes well inside that. Unable to understand what is LLVM’s problem.
I know that the compiler sometimes has issues when it is on a different filesystem from the files you are trying to compile. There are a few other threads here with similar issues. The fact that you were able to compile fine on your local points to this being the issue.
Can you try moving the zig binary to the sshfs and see if that works?
I don’t use Arch myself, but it’s worth pointing out that they’re obsessed with dynamic linking. At least in the past, they distributed a dynamically-linked version of Zig, which might also be problematic.
What do you mean by “Dynamically linked version of Zig”? Do you mean the Zig binary itself was dynamically linked and the package manager doesn’t download some of the dynamic libs to run zig binary OR, do you mean the libraries that Zig provide are dynamically linked?
I meant that the Zig compiler itself is normally a static executeable, but Arch distributes/ed dynamically-linked one. Generally Zig ships libraries with no dependecies, all statically linked, not even libc, unless you wish otherwise.
So that might have been the reason for failiure. Either because they linked wrong llvm or because the enviroment has no/wrong one.
As you already found out the issue in the message above, its not directy it, but was worth pointing out.
As a workaround I created local directory for zig builds and synced with remote directory using rsync for the time being.
If someone want the script i can share it here.