cleartonic / arch_ffvcd

1 stars 3 forks source link

Cannot Generate on Linux (File path not correct) #2

Closed jokermage closed 6 months ago

jokermage commented 8 months ago

Tested on ffvcd v.042. OS is Linux Mint 21.1; Archipelago version 0.4.3

When trying to generate a Career Day archipelago game locally, I get FileNotFoundError: [Errno 2] No such file or directory: '/home/jokermage/Archipelago/lib/worlds/ffvcd/ffvcd_arch/utilities/data/home/jokermage/Archipelago/lib/worlds/ffvcd/ffvcd_arch/utilities/data/tables/json/areas.json'

According to a previous discussion on this, the Sys.args is not correctly passing the file path to pkgutil.py /home/jokermage/Archipelago/lib/worlds/ffvcd/ffvcd_arch/utilities/data and /home/jokermage/Archipelago/lib/worlds/ffvcd/ffvcd_arch/utilities/data/tables/json/areas.json are two distinct paths but the Sys.args is combining them into a single path.

I used the yaml provided in the release 042 zip file to test this. Generate_78769423021440782470_2024_01_15_14_42_14.txt

jokermage commented 8 months ago

After some further testing changing self.files['areas'] = load_json_data(os.path.join(THIS_FILEPATH, 'tables', 'json','areas.json')) to self.files['areas'] = load_json_data(os.path.join('tables', 'json','areas.json')) allows the script to proceed. It appears that pkgutil wants relative paths (at least in Linux).

Is there some way to ensure that the path passed pkgutil can be adjusted based on which OS is detected?

jokermage commented 8 months ago

Can confirm this problem is still occurring in v0.52 with Archipelago 0.4.4

cleartonic commented 8 months ago

I have this on my list to fix before the next update (Edit: A future update will have this, I need to set up an linux environment to test)

Cybrou commented 7 months ago

It seems the path also does not work with Windows if you use a builded version instead of running from source. I integrated the world (also tested as a non-apworld just in case) in a custom Archipelago builded version and the json files were not found during generation. I am not too familiar with python so I don't know how to fix this, let me know if you want more information about it.

Another thing Linux/OSX will not like:

https://github.com/cleartonic/arch_ffvcd/blob/3fe0630df1ac48888518a4ca7c7cb9e1e53493ef/ffvcd_arch/utilities/data/patcher.py#L30

copy does not exist in Unix world, you could use cp instead but I think it would be better to just use a python function like shutil.copy or shutil.copy2.

cleartonic commented 7 months ago

Noted, I'll be reviewing all the windows/linux command line stuff soon

jokermage commented 7 months ago

This seems to be resolved after the apworld update. TY for the fix and feel free to close if no one else is having issues.