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

Resolve paths from project root #411

Open
zachallaun opened this issue Aug 5, 2023 · 2 comments
Open

Resolve paths from project root #411

zachallaun opened this issue Aug 5, 2023 · 2 comments
Milestone

Comments

@zachallaun
Copy link

First off, congrats on the 0.10 release! Huge update and some extremely cool and novel stuff here.

I ran against a somewhat sharp edge trying to work with an included lib. It seems that, currently, paths to e.g. included libs or c_src are all resolved relative to the current file, which means co-locating in lib/my_project/.... In my case, that means needing to put a git submodule in lib, which means all contents are included in packages by default, etc.

What do you think about resolving paths relative to the project root by default, and relative to the current module if the path uses ./?

# resolves to PROJECT_ROOT/includes
use Zig, include_dir: "includes"

# resolves to __DIR__/includes
use Zig, include_dir: "./includes"
@ityonemo ityonemo added this to the 0.11.0 milestone Aug 7, 2023
@ityonemo
Copy link
Collaborator

ityonemo commented Aug 7, 2023

I think I like this, let's call it provisional since I don't know if the zig build will play nice with it (sometimes it wants things in the project root) but I think it will be ok.

@lessless
Copy link

I want to chip with a pattern I recently encountered: using hex dependency management to pull a C library off the GitHub:

 {:libmagic, git: "https://github.com/file/file", tag: "FILE#{filelib_tag()}", app: false, compile: false}

and being able to add deps/file in the include path would come in handy.

@ityonemo ityonemo modified the milestones: 0.11.0, 0.11.1 Nov 14, 2023
@ityonemo ityonemo modified the milestones: 0.11.1, 0.12.0 Feb 9, 2024
@ityonemo ityonemo modified the milestones: 0.12.0, 0.14.0 Jul 7, 2024
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

No branches or pull requests

3 participants