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

experiment: allow nimony compile projects outside compiler folder #466

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mrgaturus
Copy link
Contributor

@mrgaturus mrgaturus commented Feb 5, 2025

  • remove hardcoded nifcache path prefixes
  • make nimony be able compile projects outside compiler folder
  • allow locate a custom nifcache path using a --nifcache:PATH command line argument (nimony only)
  • makefiles, nif files, and c files have paths relative to nifcache folder (ideal for tests)

this is an experiment so i don't think this would be a proper solution right now, at least this experiment could be useful to a proper implementation of this in a future.

@mrgaturus mrgaturus changed the title experiment: make nimony compile projects outside compiler folder experiment: allow nimony compile projects outside compiler folder Feb 5, 2025
@Araq
Copy link
Member

Araq commented Feb 8, 2025

Bring this over the finish line please.

@mrgaturus
Copy link
Contributor Author

mrgaturus commented Feb 10, 2025

updated to the latest commit.
i made it be relative to nifcache using setCurrrentDir(<nifcache path>) in nimony main command because that is how meson generate ninja stuff, a common pattern of a meson project is:

meson build
cd build
ninja

and all paths inside build.ninja are relative to the build folder
i don't know if you want this behavior so that's why this is an experiment for now

@Araq
Copy link
Member

Araq commented Feb 10, 2025

i don't know if you want this behavior so that's why this is an experiment for now

I usually go into the opposite direction, see how for example nim c -r tools/gen_tags simply works, but not if you cd'ed to tools/ first.

@mrgaturus
Copy link
Contributor Author

mrgaturus commented Feb 10, 2025

in this experiment you don't need cd to nifcache first, your example works as well. i mean the fact all paths inside nifcache files are relative to the nifcache path, so running for example nimony c tests/nimony/ffi/theader.nim you will see ../tests/nimony/ffi/theader.nim in the nifcache files instead tests/nimony/ffi/theader.nim

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