RetroAchievements / RALibretro

RALibretro is a multi-emulator used to develop RetroAchievements.
https://retroachievements.org
GNU General Public License v3.0
179 stars 36 forks source link

RAHasher - 1.4.0 - CHD not supported without HAVE_CHD compile flag #354

Closed RandomNinjaAtk closed 1 year ago

RandomNinjaAtk commented 1 year ago

Describe the bug Error when attempting to use RAHasher 1.4.0 with CHD file

To Reproduce Steps to reproduce the behavior:

  1. Download latest 1.4.0 precompiled binary/zip from github
  2. extract zip
  3. give RAHasher execute permissions
  4. run command RAHasher -v 12 "filename.chd"
  5. See error

Expected behavior I expected the hash as output, similar to what is outputted when hashing non CHD files.

Screenshots Ouput:

root@6d71218333a2:/config# /usr/local/RALibretro/bin64/RAHasher
RAHasher 1.4.0
====================
Usage: RAHasher [-v] systemid filepath

  -v           (optional) enables verbose messages for debugging
  systemid     specifies the system id associated to the game (which hash algorithm to use)
  filepath     specifies the path to the game file
root@6d71218333a2:/config# /usr/local/RALibretro/bin64/RAHasher -v 12 "<test_file>.chd"
CHD not supported without HAVE_CHD compile flag

Desktop (please complete the following information):

Additional context If there is something else I'm supposed to do to get it to work, I would appreciate the information. (quick google search of the error message was not helpful...) Was excited to see that CHD files should be supported in the latest version, so trying to test it out.... Previously I had to unpack the CHD file to hash it, this would streamline my process by making it a few less steps...

Jamiras commented 1 year ago

Have you tried building with make HAVE_CHD=1 as suggested by the error?

RandomNinjaAtk commented 1 year ago

I did not build, I downloaded the precompiled binary for ease of deployment/use.... see below: https://github.com/RandomNinjaAtk/docker-raromprocessor/blob/c1f4a6992f9d7ea837beef23c02aafbecc55f4ca/Dockerfile#L57-L61

I can look at building it alternatively, but maybe the precompiled binary should already have it enabled?

Jamiras commented 1 year ago

Your steps to reproduce say "Make binary executable", which I interpreted as build the executable. You should have linked the docker commands in the first place.

The prebuilt linux executables are managed by a github action. It looks like that's not providing the HAVE_CHD=1 flag.

RandomNinjaAtk commented 1 year ago

Compiled it with the flag, but a new error:

root@02612a87ace1:/config/test2# bin64/RAHasher
RAHasher
====================
Usage: RAHasher [-v] systemid filepath

  -v           (optional) enables verbose messages for debugging
  systemid     specifies the system id associated to the game (which hash algorithm to use)
  filepath     specifies the path to the game file
root@02612a87ace1:/config/test2# bin64/RAHasher -v 12 "/config/file.chd"
Could not locate primary executable
Jamiras commented 1 year ago

I'm not sure what's in file.chd, but this seems to work fine for me:

brian@ubuntu18 master:~/source/RALibretro$ bin64/RAHasher -v 12 ~/roms/Darkstalkers\ 3.chd
Found SYSTEM.CNF at sector 23
Looking for boot executable: SLUS_007.45
Found SLUS_007.45 at sector 24
Hashing SLUS_007.45 title (11 bytes) and contents (514048 bytes) 
Generated hash e9ddaf41a7cf406b5d7fc803c59d4a52
e9ddaf41a7cf406b5d7fc803c59d4a52
RandomNinjaAtk commented 1 year ago

Are there other dependencies? Since I'm using a docker container and may have not accounted for it...

file.chd is a CHD rom file that I changed the file name for posting here. I'll try to do some more testing.

Jamiras commented 1 year ago

There shouldn't be any external dependencies. If you didn't get any compilation errors, it's a functional thing. The git submodule should tie you to the same version of libchd that I used.

"Could not locate primary executable" is a generic error message indicating several things could have gone wrong. Since you don't have a "Found SYSTEM.CNF at sector X" message, it seems like locating that is what failed.

RandomNinjaAtk commented 1 year ago

Fresh build via docker hub and compiling with flag, it now appears to work:

root@700227a77bc8:/config# /usr/local/RALibretro/bin64/RAHasher -v 12 "A-Train - Trains, Power, Money (USA) (En,Ja,Fr,De).chd"
Found SYSTEM.CNF at sector 19492
Looking for boot executable: SLUS_000.03
Found SLUS_000.03 at sector 19403
Hashing SLUS_000.03 title (11 bytes) and contents (182272 bytes)
Generated hash a5242af3db70ea41d4d8aad8511df310
a5242af3db70ea41d4d8aad8511df310
root@700227a77bc8:/config#

So maybe my quick compile without full docker rebuild, it wasn't enough, so this should now be resolved. Also It looks like your fixing the issue with the precompiled binary, and this identified that...

Thanks for all the help!

I'll leave this open for now until you've resolved the precompiled binary issue. Feel free to close though...