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

Support more robust determination of the executable location #13

Closed
tunniclm opened this issue Mar 11, 2017 · 5 comments
Closed

Support more robust determination of the executable location #13

tunniclm opened this issue Mar 11, 2017 · 5 comments

Comments

@tunniclm
Copy link
Collaborator

tunniclm commented Mar 11, 2017

Using CommandLine.arguments[0] is problematic for the case where the executable is run via a relative rather than absolute path, or when it is run via PATH. This causes problems loading config files in Bluemix.

Bundle.main.executableURL and friends offer a more robust solution is my testing. However, it is not yet supported on Linux Foundation. However,
URL(fileURLWithPath: "/proc/self/exe").resolvingSymlinksInPath() provides a fallback for Linux.

@tunniclm
Copy link
Collaborator Author

tunniclm commented Mar 11, 2017

I have provided a PR #11 that implement both this and #12

@tunniclm
Copy link
Collaborator Author

The new tests I added fail on macOS because the executable is the test runner when you are running tests. These tests fail with the old way of getting the executable as well.

I will see if there's a way to fix that, or else I can remove the test. Either way this method of finding the executable is no worse than before in this respect, and better in the ways noted above.

@tunniclm
Copy link
Collaborator Author

I have added 2 more PRs, based on #11

@tunniclm
Copy link
Collaborator Author

tunniclm commented Mar 11, 2017

NOTE: the merge order matters here. For example, If we want all 3 PRs, then the merge order would be:

@youming-lin youming-lin mentioned this issue Mar 13, 2017
Merged
@youming-lin
Copy link
Collaborator

Closed by PR #16.

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

2 participants