You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Odin: dev-2025-01:1613728a6
OS: Windows 10 Professional (version: 22H2), build 19045.5371
CPU: Intel(R) Core(TM) i7-6950X CPU @ 3.00GHz
RAM: 32674 MiB
Backend: LLVM 18.1.8
Expected Behavior
Putting this in .bat file should produce a valid value for ODIN_ROOT:
for /f "delims=" %%i in ('odin.exe root') do set "ODIN_ROOT=%%i"
Current Behavior
If you run odin compiler after doing the above, then:
Error:
Invalid ODIN_ROOT, directory does not exist, got c:\SDK\Odin\
Odin compiler uses ODIN_ROOT, but it only works if there is no slash at the end. But slash at the end is how odin root writes it! So if you set ODIN_ROOT equals to the value of odin root then your environment is broken until you restart cmd.exe or similar.
Failure Information (for bugs)
Build a hellope program using this batch script:
@echo off
for /f "delims=" %%i in ('odin.exe root') do set "ODIN_ROOT=%%i"
rem Useful for stuff like this:
rem copy "%ODIN_ROOT%\core\sys\wasm\js\odin.js" "odin.js"
odin build .
The text was updated successfully, but these errors were encountered:
I think there's a bit of a misunderstanding how it works here. What you do here doesn't make much sense to do. ODIN_ROOT is used to overwrite the default path. if you want Odin to use the output of odin root as the root, you don't set ODIN_ROOT (because it's evidently already the right path).
Doing ODIN_ROOT=$(odin root) means you are basically saying set ODIN_ROOT to what is already the root.
That being said, we should allow the ODIN_ROOT environment variable to have a slash or not have one.
@laytan I've seen build scripts from a few people that do this. ODIN_ROOT is a common variable name to choose in a batch script, since the command is odin root, so you just turned the command into screaming snake case. One can do this without being aware of what ODIN_ROOT is for, but then the compiler is for very unclear reasons suddenly broken.
I even did it myself in the wgpu example :p , but my lack of experience with batch/Powershell meant I didn't know that would automatically be an environment variable.
Context
Expected Behavior
Putting this in .bat file should produce a valid value for ODIN_ROOT:
Current Behavior
If you run odin compiler after doing the above, then:
Error:
Odin compiler uses ODIN_ROOT, but it only works if there is no slash at the end. But slash at the end is how
odin root
writes it! So if you setODIN_ROOT
equals to the value ofodin root
then your environment is broken until you restart cmd.exe or similar.Failure Information (for bugs)
Build a hellope program using this batch script:
The text was updated successfully, but these errors were encountered: