Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: [0.7.2a] Validation for filename case sensitivity  (Read 2074 times)

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
[0.7.2a] Validation for filename case sensitivity
« on: March 20, 2017, 05:53:26 AM »

Every so often, some modder references a file somewhere (typically in a .json/.wpn/.ship/etc data file) where the file entry has a case mismatch with the name of the actual file. Windows (and Mac?) don't care, so our mod dev never notices and cheerfully publishes the mod.

Then some poor sap of a Linux user downloads the mod, it CTDs on startup when trying to load the asset(s) and they get to spend 2-5 minutes fixing it manually. Or worse: the error is in the jars section of mod_info, in which case it crashes without explaining why it can't find the class file (recent example). Multiply by every Linux player trying the mod and Torvalds kills a kitten each time this happens. I've managed to do a crash-causing typo myself once (despite dual booting Ubuntu/Win7).

Could we get something that validates file names on case sensitive filesystems, and throws an exception if it finds a mismatch?
(At least make it throw an exception on non-existent .jar references in modinfo)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.7.2a] Validation for filename case sensitivity
« Reply #1 on: March 20, 2017, 08:56:01 AM »

Added for jars. Don't want to do it for other files because there's potentially a lot and I think it could cause loading performance issues, since this test requires reading stuff from the filesystem.

Edit: I wonder if any mods depend on listing jarfiles that may not always exist, in their mod_info? If so, this change would break that.
« Last Edit: March 20, 2017, 08:58:12 AM by Alex »
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: [0.7.2a] Validation for filename case sensitivity
« Reply #2 on: March 20, 2017, 10:21:40 AM »

Edit: I wonder if any mods depend on listing jarfiles that may not always exist, in their mod_info? If so, this change would break that.

I can't fathom what the use case could be.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.7.2a] Validation for filename case sensitivity
« Reply #3 on: March 20, 2017, 10:26:45 AM »

Alright, that's reassuring :)
Logged

Elaron

  • Ensign
  • *
  • Posts: 43
    • View Profile
Re: [0.7.2a] Validation for filename case sensitivity
« Reply #4 on: March 20, 2017, 06:14:41 PM »

Added for jars. Don't want to do it for other files because there's potentially a lot and I think it could cause loading performance issues, since this test requires reading stuff from the filesystem.
Perhaps add an option for checking case on all files, disabled by default, to allow mod devs to do sanity-check test loads?
Logged