Skip to content

experiment: allow nimony compile projects outside compiler folder#466

Closed
mrgaturus wants to merge 3 commits intonim-lang:masterfrom
mrgaturus:nifcache
Closed

experiment: allow nimony compile projects outside compiler folder#466
mrgaturus wants to merge 3 commits intonim-lang:masterfrom
mrgaturus:nifcache

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

@Araq
Copy link
Member

Araq commented Feb 17, 2025

I did it my way, sorry.

@Araq Araq closed this Feb 17, 2025
@mrgaturus
Copy link
Contributor Author

no problem, it wasn't supposed to be merged just an experiment

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