-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
--cwd in --each/--next causes errors if there is a --cwd outside of --each #11354
Comments
Reading this makes my head hurt... I don't even understand how your example is supposed to work from the project directory because Haxe resets the cwd to the original directory when coming across I think we'll need a standalone project demonstrating the issue. |
Sorry! My wife says I have that affect on people... :)
Actually it doesn't, and I think that's the issue. I would expect Haxe to reset cwd to the directory it was in before the
Unzip and change to the proj subfolder: I also included build files up one level that better mimics what I was trying to do originally; these are copies of the hxml files in proj that have a
This was all observed on a 2021 MacBook Pro 14" M1 Max, using Haxe 4.3.2 installed thru home-brew. Does that help? |
Thanks, that makes it clearer! So the trick here is that there's a |
Awesome; sorry for the initial confusion! That is definitely the issue I tried to report originally, but I now think it's actually a bit bigger than that. The first part of my standalone project description doesn't include a It looks like your fix definitely addresses the Thanks! |
Yes, but good call, I've added a test for this case as well to make sure. |
Reopening because the tests for this issue expose a problem related to the compilation server. I think what happens is that the server is unaware of the cwd change, and then resolves a module path There are some checks already for when the directories themselves change, but the current working directory seems untracked. I'm not sure how it should react either because in theory a cwd change could affect the entire cache, but essentially disabling caching on |
Is it reasonable that the cache would just be bucketed by cwd? It would be safe, at the potential cost of inefficiencies on startup (since you'd have to fill n caches for n |
tl;dr
If you use a haxe hxml file that contains a --each/--next, and inside those build steps you include -C to change the working folder for that step, it will fail with a
Invalid Directory
error if haxe is invoked with a -C outside the build.hxml. I think this is because it attempts to apply the outer -C to each build step, wherein it will only succeed before the first one.Details:
This may be an issue that is specific to my setup, but it feels like a bug or gap all the same.
I am using Vscode/vshaxe in a large mono repo with many different apps and libraries
My haxe.configurations setting has several entries that look something like
["-C", "lib/platform", "build.hxml"],
["-C", "app/widget", "build.hxml"],
which enables me to switch the active configuration in Vscode and build/develop/debug each library or app separately. I was trying to reorganize my apps folder so they would contain a server component and a client component, e.g.
each of which has a build.hxml
and so my hxml file looks like:
When I run
haxe build.hxml
from the project folder, everything works fine.If go up a directory and then run
haxe -C widget build.hxml
, the first build step runs and then it fails with aError: Invalid Directory: widget.
error. This therefore means that my strategy for maintaining haxe.configurations does not work in this case, even though it feels like it should.The text was updated successfully, but these errors were encountered: