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

Use cwd when running haxelib path #1107

Merged
merged 1 commit into from
May 10, 2024

Conversation

tobil4sk
Copy link
Member

If a local haxelib repo is being used, then moving out of the cwd will break library resolution.

This was presumably done in case haxelib is not in PATH, but in that situation HAXEPATH is unlikely to have been set either.

Fixes: HaxeFoundation/haxelib#618

If a local haxelib repo is being used, then moving out of the cwd will break library resolution.

This was presumably done in case `haxelib` is not in `PATH`, but in that situation `HAXEPATH` is unlikely to have been set either.
@Simn
Copy link
Member

Simn commented May 10, 2024

Shouldn't this use Sys.getEnv ("HAXEPATH") ?? "" instead? It might be unlikely that HAXEPATH is set, but it's still possible.

@tobil4sk
Copy link
Member Author

It might be unlikely that HAXEPATH is set, but it's still possible.

The problem is that we don't want it to change directories, otherwise if there is a local repo in the project directory it will change directory and so the local repo won't get used, like in HaxeFoundation/haxelib#618.

I think originally it changed directory to HAXEPATH in case haxelib isn't found in PATH. But what I was saying is that if haxelib is not found in PATH, then something probably went wrong in the installation process, so in that case HAXEPATH probably won't have been set anyway. So changing CWD to HAXEPATH doesn't seem to solve the problem it was trying to address, so it seem safe to change it to "" which will just keep it in the project directory. This way it respects the project's local repo.

@Simn Simn merged commit fa8e537 into HaxeFoundation:master May 10, 2024
6 checks passed
@Simn
Copy link
Member

Simn commented May 10, 2024

Thanks for the explanation, makes sense!

@tobil4sk tobil4sk deleted the fix/haxelib-path branch May 10, 2024 08:37
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.

Local repositories break with libraries which use native C++ files
2 participants