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
Change realpath command to Python realpath function. #6
base: master
Are you sure you want to change the base?
Conversation
Rational: realpath command isn't available natively in all environments (especially macOS) but Python should be as it is required for GPR2 build.
Fixes gpr/#6 TN: VB24-040
For info, |
|
Hello, and thank you for your contribution. First, we apologize for the delay. You are right; realpath seems to be an issue for macOS. However, Python is not required to build gpr2/libgpr2, but only to regenerate the GPR parser from the Langkit grammar. Using Python for realpath would add a new dependency during the build process. Or, we could just remove the out-of-tree Makefile softlink support: realpath is there to detect the case where the dev has an out-of-tree build directory in which he soft-linked the Makefile for ease of use (so typing make there just works). As this causes issues and fixing it with Python adds new dependency, I think we can simply remove this functionality. @Blady-Com, do you want to update the PR yourself, or let us do it ? I will give you some time so you can decide the best option. |
As a workaround for macOS users,
should fix the issue |
Hello there, so as mentioned by @Jicquel, python is currently not needed to build libgpr2 or the gpr2 tools. We currently use python for two specific stages: re-generation of the gpr parser - whose sources are otherwise statically stored in the repo -, and testing. So the proposed change is currently disruptive for our build system that don't have a controlled python install at hand during build, so cannot be accepted right now unfortunately. For the record, this call to realpath is there to handle the case where some developer has a dedicated build directory and symlinked the Makefile in there to just have to type make and have the result there. Particularly useful when you have several makefile.conf to test (those remain local to your build tree). If you fix the MFILE variable to the expected value given by realpath, then the tool should not be called so the build should be fine on MacOS. This being said, python is widely used otherwise for building things at AdaCore, and considering the complexity of maintaining Makefiles compared to maintaining python-based build systems, we intend to move to python at some point: this should make portability of the build much easier... |
I have a feeling that you may not be joking .. your python-based build systems may be fine for you, with colleagues who can explain the undocumented mysteries, but for the rest of us .. not so much. |
I fully agree with @simonjwright. @Jicquel, your proposed workaround is fine for me. Don't forget also the additional fix for SOURCE_DIR. |
Do you have a particular AdaCore project in mind ? Some like gnatcoll-bindings are using very simple scripts that should be easy to understand. The main advantage of not using Makefiles is that this is more friendly on pure Windows development environment. |
Rational: realpath command isn't available natively in all environments (especially macOS) but Python should be as it is required for GPR2 build.