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

Add a sokol microui example program. #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thePHTest
Copy link

No description provided.

@floooh
Copy link
Owner

floooh commented Feb 16, 2023

When I try to build the sample from the build directory via:

odin run ../examples/microui --debug

...I get:

/Users/floh/projects/sokol-odin/examples/microui/main.odin(9:1) Syntax Error: Path does not exist: vendor:microui

Odin was installed via brew install odin --HEAD and version is:

odin version dev-2023-02:16262800

...is there a step I'm missing to install the vendor packages?

(PS: same with the "stable" version odin version dev-2023-02:fcc920ed installed via brew install odin (without --HEAD)

@floooh
Copy link
Owner

floooh commented Feb 16, 2023

Apart from the above, could you add the new sample to the GH Action script? (that way compilation is tested on the various platforms):

See the end of file here:

https://github.com/floooh/sokol-odin/blob/main/.github/workflows/main.yml

@thePHTest
Copy link
Author

Sure, I can update that.
vendor is packaged with the compiler so it should be there and able to find it. Reading through here https://odin-lang.org/docs/install/ and from searching discord it may be that it is relying on locating vendor relative to the compiler executable. So I think you either need to make a softlink to odin.exe or put the Odin compiler directory in your path.

@thePHTest
Copy link
Author

Alternatively, it looks like an ODIN_ROOT environment variable can be set to specify where the core and vendor collections live.

@floooh
Copy link
Owner

floooh commented Feb 16, 2023

Aha ok, on Mac homebrew is creating a link to the actual Odin executable, and that link is in the path. Maybe this confuses the compiler... sucks though that it doesn't work out of the box... I guess that would need to be fixed in Odin to first follow links before trying to resolve a relative path.

...but it's still strange that I don't see any traces of the vendor packages in the install directory...

...e.g. at the top level I have 3 directories:

bin                  libexec              share

..under libexex there's two directories: core and shared (and shared is empty).

core looks like it only has stdlib stuff...

...maybe there's something wrong with the homebrew formula?

@floooh
Copy link
Owner

floooh commented Feb 16, 2023

...e.g. here's the tree output of the Odin install dir (when installed with homebrew) for reference:

odin_install_dir.txt

@thePHTest
Copy link
Author

Yeah it should have a vendor directory. I don't have macOS to test anything. Seems like another discord user ran into the same issue and made a fork of that homebrew: https://github.com/esnunes/homebrew-tap/blob/main/Formula/odin.rb#L31

@floooh
Copy link
Owner

floooh commented Feb 16, 2023

Hmm ok... I think it's better to not put any samples in for now which use vendor packages... TBH I looked at the Mac installation instructions on the Odin landing page, realized that this involves installing llvm and building from source, and then checked if there's a homebrew package instead :D

Would be nice if Odin had ready-made downloads like this:

https://ziglang.org/download/

@thePHTest
Copy link
Author

Alright, I'll keep it on a fork until a future date when Odin is at 1.0 and has fully-fledged releases.
There are currently efforts to move off of LLVM which should solve these issues.
This is worth a listen if you are interested: https://www.youtube.com/watch?v=g1qF9LZOoFE

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

Successfully merging this pull request may close these issues.

2 participants