Fractal Softworks Forum
June 28, 2017, 05:13:19 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New blog post: Drawing [REDACTED] Battlestations, part 1 (6/24/17); Starsector 0.8.1a is out!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [0.7.2a] Validation for filename case sensitivity  (Read 284 times)
Histidine
Admiral
*****
Posts: 1560



View Profile Email
« 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: 10841


View Profile
« 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: 2255



View Profile WWW Email
« 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: 10841


View Profile
« Reply #3 on: March 20, 2017, 10:26:45 AM »

Alright, that's reassuring Smiley
Logged
Elaron
Ensign
*
Posts: 42


View Profile
« 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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2011, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!