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

Corrected the premake binary search functionality #2292

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hd-genius
Copy link
Contributor

@hd-genius hd-genius commented Dec 19, 2024

Currently the build premake step is failing on linux due to a dependency issue in premake. This issue propmpted me to add a prebuilt premake to my local project but I noticed that it was not being acknowledge during the xb build process. These changes fix the executable search logic in the xb and premake python scripts so that drop in prebuilt binaries can be used.

@hd-genius hd-genius changed the title Corrected the binary search functionality Corrected the premake binary search functionality Dec 19, 2024
@nullequal
Copy link

nullequal commented Dec 19, 2024

due to commit fe71eb7 you would have to fork the xenia-project fork and rebase to premake master then build
so it would be better if the devs updated the fork and let xb setup build the executable
(also while this idea is good for windows, for linux its more intuitive to search for the executable installed by the package manager)

@hd-genius
Copy link
Contributor Author

I totally agree, it would be much better to build from the source and use the distribution's binary as a fall back instead. I'm working on adding that functionality into the code. The original code was a mix of searching locally in the code base and looking globally in the PATH. I'm currently adding another fallback check for the global path. This PR just corrects the original intent of the checks.



self_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.join(self_path, '..', '..')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was doing a literal concatenation and resulting in /path_to_user/xenia/tools/build/../... After the change to use the parent attribute of the path instead it is now resulting in the correct path /path_to_user/xenia instead.

@@ -54,15 +56,15 @@ setup_premake_path_override()
def main():
# First try the freshly-built premake.
premake5_bin = os.path.join(premake_path, 'bin', 'release', 'premake5')
if not has_bin(premake5_bin):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The has_bin function searches for the binary globally in the PATH. The code here builds a path to the expected premake location xenia/third_party/premake-core/bin/release/premake5 which is not in the user's PATH. This change just checks to see if the binary is available at that location instead.

@hd-genius
Copy link
Contributor Author

I just pushed an update that will also check for a globally installed version in the PATH.

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