[1.1.68] unknown option should give an error

Bugs that are actually features.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

[1.1.68] unknown option should give an error

Post by mrvn »

When I run this command I get the wrong map preview:

Code: Select all

factorio-1.1.68$ bin/x64/factorio --generate-map-preview ribbon.png ----preset ribbon-world
   0.000 2022-09-09 08:34:53; Factorio 1.1.68 (build 60023, linux64, full)
   0.039 Operating system: Linux (Debian 11)
   0.039 Program arguments: "bin/x64/factorio" "--generate-map-preview" "ribbon.png" "----preset" "ribbon-world" 
   0.039 Read data path: /home/mrvn/factorio/factorio-1.1.68/data
   0.039 Write data path: /home/mrvn/factorio/factorio-1.1.68 [6898/1555846MB]
   0.039 Binaries path: /home/mrvn/factorio/factorio-1.1.68/bin
   0.051 System info: [CPU: AMD Ryzen 5 2400G with Radeon Vega Graphics, 8 cores, RAM: 63331 MB]
   0.051 Environment: DISPLAY=:0.0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=lightdm-xsession XDG_SESSION_DESKTOP=lightdm-xsession XDG_CURRENT_DESKTOP=XFCE __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.051 Running in headless mode
   1.631 Data stage cache loaded in: 1.463160 seconds.
   1.638 Checksum for core: 1720724266
   1.638 Checksum of autobuild: 263396496
   1.638 Checksum of base: 3427191298
   1.638 Checksum of FractalMaps: 266700247
   1.638 Checksum of WideChestsAllTypes: 0
   1.638 Checksum of WireShortcuts: 485725795
   1.638 Checksum of YARM: 830592482
   1.638 Checksum of AutoDeconstruct: 2741496923
   1.638 Checksum of Bottleneck: 2544829823
   1.638 Checksum of DeadlockResearchNotifications: 976355789
   1.638 Checksum of DeleteEmptyChunks: 1603289931
   1.638 Checksum of flib: 2547089668
   1.638 Checksum of FNEI: 3619919004
   1.638 Checksum of helmod: 2709204096
   1.638 Checksum of Infinizoom: 157428712
   1.638 Checksum of InserterFuelLeech: 2689657689
   1.638 Checksum of MapView_NoBlackLines: 2905831165
   1.638 Checksum of research-progress: 0
   1.638 Checksum of Rich_Text_Helper: 3396966298
   1.638 Checksum of rso-mod: 2466986368
   1.638 Checksum of SpeedControl: 2899187544
   1.638 Checksum of WideChests: 2350848085
   1.638 Checksum of LogisticTrainNetwork: 2361607724
   1.638 Checksum of map-tag-generator: 317044236
   1.638 Checksum of LTN_Combinator_Modernized: 82562784
   1.638 Checksum of RailGrid: 3146409276
   1.638 Checksum of LtnManager: 1682584081
   4.235 Prototype list checksum: 1910851089
   4.485 Info PlayerData.cpp:71: Local player-data.json available, timestamp 1662705234
   4.485 Info PlayerData.cpp:78: Cloud player-data.json unavailable
   4.486 Factorio initialised
   4.486 Generating map preview: 1048576 pixels: -512.000000,-512.000000...512.000000,512.000000; 1.000000 meters per pixel
   5.612 Approximate quantities of resources on this map:
   5.612 Map preview generation time: 1.125981 seconds.
   5.710 Wrote map preview image file: ribbon.png
   5.822 Goodbye
ribbon.png
ribbon.png (279.03 KiB) Viewed 914 times
That is not a 128 tiles high ribbon world.
Last edited by mrvn on Fri Sep 09, 2022 7:06 am, edited 1 time in total.

Bilka
Factorio Staff
Factorio Staff
Posts: 3133
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [1.1.68] --preset option is ignored in map preview

Post by Bilka »

You have too many dashes in the param, it should only be 2, not 4.

Code: Select all

./factorio --generate-map-preview ribbon.png --preset ribbon-world
   0.000 2022-09-09 08:53:30; Factorio 1.1.68 (build 60023, linux64, full)
   0.006 Operating system: Linux (openSUSE 20220901)
   0.006 Program arguments: "./factorio" "--generate-map-preview" "ribbon.png" "--preset" "ribbon-world" 
   0.006 Read data path: /home/erik/Games/factorio/data
   0.006 Write data path: /home/erik/Games/factorio [31750/106694MB]
   0.006 Binaries path: /home/erik/Games/factorio/bin
   0.014 System info: [CPU: AMD Ryzen 9 3900X 12-Core Processor, 24 cores, RAM: 32038 MB]
   0.014 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=/usr/share/xsessions/plasma5 XDG_SESSION_DESKTOP=KDE XDG_CURRENT_DESKTOP=KDE __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.014 Running in headless mode
   0.024 Loading mod core 0.0.0 (data.lua)
   0.053 Loading mod base 1.1.68 (data.lua)
   0.274 Loading mod base 1.1.68 (data-updates.lua)
   0.374 Checksum for core: 1720724266
   0.374 Checksum of base: 3427191298
   0.614 Prototype list checksum: 3034860339
   0.662 Info PlayerData.cpp:71: Local player-data.json available, timestamp 1662060439
   0.662 Info PlayerData.cpp:78: Cloud player-data.json unavailable
   0.664 Factorio initialised
   0.664 Generating map preview: 1048576 pixels: -512.000000,-512.000000...512.000000,512.000000; 1.000000 meters per pixel
   1.145 Approximate quantities of resources on this map:
   1.145 Map preview generation time: 0.481362 seconds.
   1.271 Wrote map preview image file: ribbon.png
   1.302 Goodbye
ribbon.png
ribbon.png (63.97 KiB) Viewed 907 times
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [1.1.68] --preset option is ignored in map preview

Post by mrvn »

Ups, how did that get in there?

Then the bug is that factorio does not give an error for unknown options.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.68] unknown option should give an error

Post by boskid »

It was a value that cxxopts library silently ignored (not a flag, not consumed positional so it was put to keep). I do not think we want to dig into that library to change the behavior that will catch your issue.

SoShootMe
Filter Inserter
Filter Inserter
Posts: 476
Joined: Mon Aug 03, 2020 4:16 pm
Contact:

Re: [1.1.68] unknown option should give an error

Post by SoShootMe »

boskid wrote:
Fri Sep 09, 2022 8:58 am
It was a value that cxxopts library silently ignored (not a flag, not consumed positional so it was put to keep). I do not think we want to dig into that library to change the behavior that will catch your issue.
cxxopts is https://github.com/jarro2783/cxxopts? Assuming so, it looks like the default behaviour is to throw an exception on an unrecognised option, which is reasonable.

In any case, either the behaviour is being changed by code outside the library (most likely), or the library is terrible and should be fixed or replaced (maybe just a newer version). Surely at least a minor issue.

As a possible quick fix (though still not generally expected behaviour), I suggest to log a warning if there are any "silently ignored" options.

Post Reply

Return to “Not a bug”