Closed theunkn0wn1 closed 2 years ago
Looks like this is caused by Explosive Excavation
calling itself with a space but Seablock
defines its dependency without one (ExplosiveExcavation
). strangely Factorio has no trouble with this discrepancy and successfully installs Explosive Excavation
.
If i symlink the zip, Draftsman crashes with an (seemingly?) unrelated exception. Unfortunately, this symlink does cause a Factorio game assertion to fail.
~/.factorio/mods ⌚ 16:16:02
$ ln -s Explosive\ Excavation_1.1.8.zip ExplosiveExcavation_1.1.8.zip
Traceback (most recent call last):
File "/home/orion/projects/cractorio/.venv/bin/draftsman-update", line 8, in <module>
sys.exit(main())
File "/home/orion/projects/cractorio/.venv/lib/python3.8/site-packages/draftsman/env.py", line 1777, in main
update(verbose=args.verbose, show_logs=args.log, no_mods=args.no_mods)
File "/home/orion/projects/cractorio/.venv/lib/python3.8/site-packages/draftsman/env.py", line 1718, in update
load_stage(lua, mods, mod, stage)
File "/home/orion/projects/cractorio/.venv/lib/python3.8/site-packages/draftsman/env.py", line 259, in load_stage
lua.execute(mod.data[stage])
File "lupa/_lupa.pyx", line 308, in lupa._lupa.LuaRuntime.execute
File "lupa/_lupa.pyx", line 1324, in lupa._lupa.run_lua
File "lupa/_lupa.pyx", line 1333, in lupa._lupa.call_lua
File "lupa/_lupa.pyx", line 1359, in lupa._lupa.execute_lua_call
File "lupa/_lupa.pyx", line 1295, in lupa._lupa.raise_lua_error
lupa._lupa.LuaError: .../factorio-data/core/lualib/circuit-connector-sprites.lua:15: attempt to perform 'n%0'
stack traceback:
.../factorio-data/core/lualib/circuit-connector-sprites.lua:15: in local 'get_frame'
.../factorio-data/core/lualib/circuit-connector-sprites.lua:24: in upvalue 'make_circuit_connector_sprites'
.../factorio-data/core/lualib/circuit-connector-sprites.lua:80: in field 'create'
[string "prototypes/entity/circuitconnectors"]:31: in main chunk
[C]: in upvalue 'old_require'
[string "<python>"]:173: in global 'require'
[string "prototypes/entity/railloader"]:1: in main chunk
[C]: in upvalue 'old_require'
[string "<python>"]:173: in global 'require'
[string "<python>"]:2: in main chunk
That is indeed strange. Changing the mod name to automatically trim spaces completely fixes the problem:
mod_name = m.group(1).replace(" ", "")
Reading mods from: D:\SourceCode\repos\Python\factorio-draftsman\draftsman\factorio-mods
...
Load order:
['base', 'ExplosiveExcavation', 'FNEI', 'KS_Power', 'bobenemies', 'bobinserters', 'boblibrary', 'flib', 'helmod', 'bobequipment', 'bobores', 'bobtech', 'ScienceCostTweakerM', 'bobplates', 'bobassembly', 'bobelectronics', 'bobpower', 'bobrevamp', 'boblogistics', 'bobwarfare', 'bobmining', 'bobmodules', 'angelsrefining', 'LandfillPainting', 'SpaceMod', 'angelspetrochem', 'reskins-library', 'angelsaddons-storage', 'angelssmelting', 'angelsbioprocessing', 'CircuitProcessing', 'reskins-bobs', 'SeaBlock', 'reskins-angels', 'reskins-compatibility', 'SeaBlockMetaPack']
SETTINGS.LUA:
mod: bobenemies
mod: bobinserters
mod: boblibrary
mod: flib
mod: helmod
mod: bobores
mod: bobtech
mod: ScienceCostTweakerM
mod: bobplates
mod: bobassembly
mod: bobelectronics
mod: bobpower
mod: bobrevamp
mod: boblogistics
mod: bobwarfare
mod: bobmining
mod: bobmodules
mod: angelsrefining
mod: LandfillPainting
mod: SpaceMod
mod: angelspetrochem
mod: reskins-library
mod: angelsaddons-storage
mod: angelsbioprocessing
mod: CircuitProcessing
mod: reskins-bobs
mod: SeaBlock
mod: reskins-angels
mod: reskins-compatibility
SETTINGS-UPDATES.LUA:
mod: angelsrefining
mod: angelspetrochem
mod: reskins-library
mod: angelsaddons-storage
mod: angelssmelting
mod: angelsbioprocessing
mod: CircuitProcessing
mod: reskins-bobs
mod: SeaBlock
mod: reskins-angels
mod: reskins-compatibility
SETTINGS-FINAL-FIXES.LUA:
mod: reskins-library
DATA.LUA:
mod: base
mod: ExplosiveExcavation
mod: FNEI
mod: KS_Power
mod: bobenemies
mod: bobinserters
mod: boblibrary
mod: flib
mod: helmod
mod: bobequipment
mod: bobores
mod: bobtech
mod: ScienceCostTweakerM
mod: bobplates
mod: bobassembly
mod: bobelectronics
mod: bobpower
mod: bobrevamp
mod: boblogistics
mod: bobwarfare
mod: bobmining
mod: bobmodules
mod: angelsrefining
mod: LandfillPainting
mod: SpaceMod
mod: angelspetrochem
mod: reskins-library
mod: angelsaddons-storage
mod: angelssmelting
mod: angelsbioprocessing
mod: CircuitProcessing
mod: reskins-bobs
mod: SeaBlock
mod: reskins-angels
mod: reskins-compatibility
DATA-UPDATES.LUA:
mod: base
mod: KS_Power
mod: bobenemies
mod: bobinserters
mod: bobequipment
mod: bobores
mod: bobtech
mod: ScienceCostTweakerM
mod: bobplates
mod: bobassembly
mod: bobelectronics
mod: bobpower
mod: bobrevamp
mod: boblogistics
mod: bobwarfare
mod: bobmining
mod: bobmodules
mod: angelsrefining
mod: LandfillPainting
mod: angelspetrochem
mod: reskins-library
mod: angelsaddons-storage
mod: angelssmelting
mod: angelsbioprocessing
mod: CircuitProcessing
mod: reskins-bobs
mod: SeaBlock
mod: reskins-angels
mod: reskins-compatibility
DATA-FINAL-FIXES.LUA:
mod: boblibrary
mod: bobtech
mod: ScienceCostTweakerM
mod: bobplates
mod: bobpower
mod: angelsrefining
mod: LandfillPainting
mod: SpaceMod
mod: angelspetrochem
mod: reskins-library
mod: angelssmelting
mod: reskins-bobs
mod: SeaBlock
mod: reskins-angels
mod: reskins-compatibility
Extracted mods...
Extracted entities...
Extracted instruments...
Extracted items...
Extracted modules...
Extracted recipes...
Extracted signals...
Extracted tiles...
Update finished.
hella slick; nothing broke!
As to when this normalization takes place in the actual Factorio load process, I have no idea; only the dependency list actually trims the whitespace. From this page I was under the impression that such filenames were prohibited from loading in Factorio, though clearly this is not the case. The only downside to doing this is that you would have to query the mod data from Draftsman as "ExplosiveExcavation"
instead of "Explosive Excavation"
. Of course, this fix will only work for spaces as well.
The reason creating a symlink of the actual zip files doesn't work is because Draftsman preloads all archive files first before it resolves their dependencies, caching them. It loads a mod with the name "Explosive Excavation" internally; then, when it tries to resolve the dependencies, the name is listed as "ExplosiveExcavation", which doesn't match any of the cached mods.
Clever idea using a symlink to relate the Draftsman folder with the install folder. In this discussion I tossed out an idea for a method of specifying the mod folder path as an argument to draftsman-update
; would that be more or less convenient for your particular situation?
Clever idea using a symlink to relate the Draftsman folder with the install folder. In https://github.com/redruin1/factorio-draftsman/discussions/36 discussion I tossed out an idea for a method of specifying the mod folder path as an argument to draftsman-update; would that be more or less convenient for your particular situation?
Yes, It would be more convenient for me to pass your tool a path to the mod directory than symlinking it. And put another way, what if the user has multiple factorio mod directories? the factorio executable itself supports it with a CLI argument, it would be beneficial if this tool did as well.
As for architecture-specific path oddities, most of those can be mitigated by using a platform-agnostic filesystem API like stdlib's pathlib.
And put another way, what if the user has multiple factorio mod directories? the factorio executable itself supports it with a CLI argument, it would be beneficial if this tool did as well.
Good point; I had no idea that Factorio itself let you do so. I'm convinced, I'll add this feature to the 1.0.2
release.
Closing this for now; getting rid of the spaces might cause problems further down the line, but it seems uncommon enough to patch like so right now. I'll reopen/mention this issue if any future problems crop up.
Factorio Version 1.1.65 (build 59990, linux64) Modpack: Seablock
Actions taken:
created virtual environment in project path
.venv
and installed factorio-draftsman. sourced venvsource .venv/bin/activate
Set draftstmanfactorio-mods
folder to be a symlink to factorio installVerified path resolves and contains the offending mod:
Attempted
draftsman-update
from within the venv: