mkxp-z / mkxp-z

Open-source cross-platform player for (some) RPG Maker XP / VX / VX Ace games. A very heavily modified fork of mkxp. RGSS on steroids with a stupid name.
https://github.com/mkxp-z/mkxp-z/wiki
GNU General Public License v2.0
140 stars 39 forks source link

Build path is hardcoded in rbconfig.rb #170

Open enumag opened 4 months ago

enumag commented 4 months ago

I just found another strange issue, this time with stdlib. The location of the file is different on each platform. For instance in a windows build it's stdlib/x64-mingw32/rbconfig.rb while on linux it's stdlib/x86_64-linux/rbconfig.rb. In that file there is a line like this:

Windows:

CONFIG["prefix"] = (TOPDIR || DESTDIR + "D:/a/mkxp-z/mkxp-z/windows/build-mingw64")

Linux:

CONFIG["prefix"] = (TOPDIR || DESTDIR + "/home/runner/work/mkxp-z/mkxp-z/linux/build-x86_64")

Somehow the build process ends up hardcoding the directory where mkxp-z is built on GitHub Actions into this file which shouldn't be the case.

It actually ended up causing an issue for one of our players because the directory is used deep inside Gem::Specification.load_defaults which is called in stdlib/rubygems.rb but of course the directory does not exist.

I'm not sure what the correct CONFIG["prefix"] would be but it most certainly isn't the path from GitHub Actions.

Splendide-Imaginarius commented 3 months ago

Thanks for reporting this. From a build system cleanliness standpoint, it's pretty much never appropriate for the build paths to show up in the binaries, even if it doesn't affect the behavior of the binaries. If there's a configure flag I can pass to Ruby's build system that will fix this, I'd be happy to take a PR. If there isn't any such configure flag, then I suspect someone should send a PR to Ruby. If someone does so, feel free to link to that PR from here so that we can track the status.