Skip to content

Conversation

@caden-parajuli
Copy link

Certain Linux distributions such as NixOS and Guix System cannot run dynamically linked executables intended for generic Linux systems. Thus the mcpp executable included in Malt will not run on them. With this PR, Malt on Linux will search the system PATH for an installed mcpp executable and will use that instead of the included binary if one is found.

@pragma37
Copy link
Member

Hi! Thanks for the PR.
What kind of error do you get if you try to use the executable distributed with Malt?
Would it be viable to detect the error and only try to find the system mcpp in that case?
Otherwise, we may open the door to other kinds of issues for all Linux platforms.

@caden-parajuli
Copy link
Author

It prints this to stderr on NixOS:

Could not start dynamically linked executable: scripts/PatchDependencies/mcpp-Linux
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

and returns exit status 127. I'm not sure if this is consistent across versions, or what the output on Guix is since I haven't used it in about a year.

I've updated the commit to try the included binary first, and then search for the system mcpp if it returns a nonzero exit status. Does that seem like a good approach?

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