#how to use path?/how to install zig?

1 messages · Page 1 of 1 (latest)

finite temple
#

fresh install of fedora kde, trying to install a specific version of zig for a game, and I've been trying tutorials from ziglang and zig.guide just for them not to really do anything? I'm pretty new to linux so idk what's going on sorry

mystic token
#

Open another terminal and see if the zig command worked

finite temple
#

uhhnope

tepid ice
#

what is inside of the directory you tried to add to your path. Does zig the binary have executable permissions?
ls -l will show the permissions

opening a new terminal wont inherit the modification you made to your path
I didn't see you added it to your bashrc originally that should make it work in a new terminal

finite temple
#

here's the directory, here's ls -l, but idk how to check the binary permissions

tepid ice
#

i meant ls -l inside of that extracted zig path it will show the binary permissions

finite temple
#

does this work?

tepid ice
#

does running zig inside of that directory work?

#

I assume the problem is that ~/ is not getting expanded in how your added zig to your path

regal vale
#

as in ./zig to run the file, zig on its own will still search the path and will still probably fail

finite temple
#

looks promising but idk about that error lol 😭

regal vale
#

good, at least we know its not an issue with zig itself

modest sleet
#

you have ~/home/lucia which would technically expand to/home/lucia/home/lucia
and in the second $HOME/.. you're missing the Downloads directoryy

tepid ice
#

I assume the problem is that ~/ is not getting expanded in how your added zig to your path
when adding to your path use /home/lucia/Downloads/<keep-going> the path is not getting expanded

or that above, bash can be a bit weird on when it chooses to expand paths its generally simpler to use the full path

modest sleet
#

but yes, use full path

regal vale
#

looking at what you originally added to path ~/home is incorrect, the resolves to /home/home.
and your seccond attempt, whihc you added to bashrc, is also incorrect, assuming you didnt move the zig folder out of your downloads?

finite temple
#

nope didn't move it from downloads at all

modest sleet
#

type pwd in the zig extracted directory and use that in PATH

regal vale
#

right, so in your bashrc, just add /Downloads between $HOME and /zig-...
and it should work, will have to restart your terminal, or just copy and run the export command.

finite temple
#

I'll try what vei said though hold on

modest sleet
#

; -> :, don't include the ~

tepid ice
#

also ~/home/lucia is not correct like noted above that turns into /home/lucia/home/lucia if its expanded

finite temple
#

sorry went on a detour to try out vei's idea

regal vale
#

mising closing '

modest sleet
#

this is fun :)

regal vale
#

so it thought you wanted to continue on a new line

#

also you'd want to make sure you include the current path, so you dont overwrite it and make your shell unusable

#

PATH=$PATH:....

finite temple
#

oh lemme try what u just said too

modest sleet
#

where the >> ~/.bashrc XD

regal vale
#

remove the echo and enclosing ''.
if it works, then copy it into your ~/.bashrc using a text editor, so you can remove the one you added previously, and also so you dont accidentally overwrite the whole file incase anything else is in there

finite temple
#

thouight i had messed up

regal vale
#

you should probably go find some introduction to using a terminal/bash on linux
so you can understand what you are doing, and not just run what strangers on the internet tell you

finite temple
#

yeah that's true

#

sorry for wasting u guys' time

regal vale
#

nah, I am bored anyway :3

carmine scarab
#

You could also try checking the value of PATH when it doesn't work, and look for problems:

echo $PATH

then edit your ~/.bashrc if needed