Non-zero exit code is returned when using kicad-cli with deflate-compressed stpZ file
<!----------Before Creating a New Issue----------- * Limit report to a single issue. * Search the issue tracker to verify the issue has not already been reported. * Complete all instructions between `template comment markers <>. * Keep report contents limited to the necessary information required to fix the issue. * When creating an issue against the stable version of KiCad, make sure the latest available stable version is installed as issues may have already been resolved in later stable versions.--> # Description <!--What is the current behavior and what is the expected behavior?--> <!--If the issue is visual/graphical, please attach screenshots of the problem.--> <!--Add the issue details below this line and before the "Steps to reproduce" heading.--> When using `kicad-cli` on a Kicad project that uses 3D models, I get a bunch of errors that look like this: ``` Adding component C20. failed to decompress '/nix/store/7x5jhgdi2rcv212gf32xvb2xskk3zhcc-kicad-packages3d-6b3a47da07/share/kicad/3dmodels/Capacitor_SMD.3dshapes/C_0603_1608Metric.stpZ'. ``` As a result of these errors I get a non-zero exit code. This makes it difficult to script kicad-cli. This happens for any deflate-compressed stpZ files. First they'll attempt to be decompressed using gzip, and when that fails, it falls back to deflate. The problem is when the gzip fails, it throws the error. # Steps to reproduce <!--If there are multiple steps to reproduce it or it is a visual issue, then providing a screen recording as an attachment to this report is recommended.--> <!--If this issue is specific to a project, please attach the necessary files to this issue.--> <!--Add the steps to reproduce using the numbers below--> <!--Add new step numbers before the "KiCad Version" heading.--> 1. Create a basic Kicad board with a footprint with a 3D model that's a deflate-compressed stpZ file 2. Run this command: ``` kicad-cli pcb export stl -o output.stl -f --grid-origin --subst-models your_board.kicad_pcb ``` 3. Note the errors as above. Also note the output STL file is generated correctly (all models are present) # KiCad Version <!--Copy version information (from main menu Help->About KiCad ->Copy Version Info) and paste it between the triple backticks below to preserve the formatting.--> ``` Application: KiCad x86_64 on x86_64 Version: 9.0.8, release build Libraries: wxWidgets 3.2.9 FreeType 2.13.3 HarfBuzz 12.3.0 FontConfig 2.17.1 libcurl/8.18.0 OpenSSL/3.6.1 zlib/1.3.2 brotli/1.2.0 zstd/1.5.7 libidn2/2.3.8 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.67.1 ngtcp2/1.19.0 nghttp3/1.14.0 mit-krb5/1.22.1 Platform: NixOS 26.05 (Yarara), 64 bit, Little endian, wxGTK, Wayland, , wayland Build Info: Date: Jan 1 1980 00:00:00 wxWidgets: 3.2.9 (wchar_t,wx containers) GTK+ 3.24 Boost: 1.89.0 OCC: 7.6.2 Curl: 8.18.0 ngspice: 45 Compiler: GCC 15.2.0 with C++ ABI 1020 Build settings: KICAD_USE_EGL=ON KICAD_IPC_API=ON Locale: Lang: en_CA Enc: UTF-8 Num: 1,234.5 Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8) ```
issue