Initales Laden von Projekt schlägt fehl, generieren html header files

Hallo zusammen,

ich bekommen beim initlane Laden des Projektes in VSCode mit PlatformIO einen Fehler bei dem ich nicht mehr weiter komme. Ich hoffe das einer von euch mir dabei weiterhelfen kann.
Das Projekt habe ich nach der Anleitung erstellt/integriert. Kompilieren müsste es ja auf jeden Fall.
Ich konnte den Fehler schon soweit eingrenzen, dass ich sagen kann, dass er in der processHtml.py ist. Bei mir die Zeile 100. Die prints sind meine Debug-Ausgaben.
Ein Versuch mit der dev-Branche schlug auch fehl.
Die 4 bei dem Reiter Problems sind nur Warnings und sollten, glaube ich kein Problem darstellen.


Processing lolin_d32_pro_sdmmc_pe (board: lolin_d32_pro; platform: espressif32@^6.8.1; framework: arduino, espidf)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
GENERATING GIT REVISION HEADER FILE
  "deb90f0-dirty" -> C:\Users\neo_h\Documents\PlatformIO\Projects\ESPuino\.pio\build\lolin_d32_pro_sdmmc_pe\generated\gitrevision.h
GENERATING HTML HEADER FILES
  C:\Users\neo_h\Documents\PlatformIO\Projects\ESPuino\html\management.html -> C:\Users\neo_h\Documents\PlatformIO\Projects\ESPuino\.pio\build\lolin_d32_pro_sdmmc_pe\generated\HTMLbinary.h
_process_binary_file-HelloWorld#########################################
Vor

thread '<unnamed>' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\minify-js-0.6.0\src\minify\pass1.rs:331:13:
assertion failed: cons_expr.returns && alt_expr.returns
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
PanicException: assertion failed: cons_expr.returns && alt_expr.returns:
  File "C:\Users\neo_h\.platformio\penv\Lib\site-packages\platformio\builder\main.py", line 167:
    env.SConscript(env.GetExtraScripts("pre"), exports="env")
  File "C:\Users\neo_h\.platformio\packages\tool-scons\scons-local-4.8.1\SCons\Script\SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\neo_h\.platformio\packages\tool-scons\scons-local-4.8.1\SCons\Script\SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\neo_h\Documents\PlatformIO\Projects\ESPuino\processHtml.py", line 181:
    HtmlHeaderProcessor().process()
  File "C:\Users\neo_h\Documents\PlatformIO\Projects\ESPuino\processHtml.py", line 165:
    info = cls._process_binary_file(HTML_DIR / binary_file, binary_header, info)
  File "C:\Users\neo_h\Documents\PlatformIO\Projects\ESPuino\processHtml.py", line 100:
    content = minify_html.minify(content, minify_js=True, minify_css=True,
=============================================================================== [FAILED] Took 2.50 seconds ===============================================================================

Environment             Status    Duration
----------------------  --------  ------------
lolin_d32_pro_sdmmc_pe  FAILED    00:00:02.496
========================================================================== 1 failed, 0 succeeded in 00:00:02.496 ==========================================================================

 *  The terminal process "C:\Users\neo_h\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'lolin_d32_pro_sdmmc_pe'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.

Ich kann noch als Info hinzufügen…
Beim Auskommentieren der Zeile ;pre:processHtml.py in der platformio.ini kommt der Fehler nicht. Da beginnt er das komilieren und beschwert sich dann das die HTMLbinary.h fehlt (verständlich).

@yschroeder hat mir eben netterweise den Tipp gegeben, dass es Probleme mit minify_html in processHtml.py gibt und empfohlen, diese Lib auf 0.15.0 zu pinnen. Habe ich gemacht und jetzt läuft das Kompilieren aus meiner Sicht durch.
Hab’s commited.

@tueddy Vermutlich löst das auch das Problem bei Github. Mal schauen. Mittels „Full clean“ und anschließendem Build habe ich das Problem nachvollziehen können.

1 „Gefällt mir“

Hallo,

super. Danke das du da so schnell reagiert hast. :+1:
Ich kann jetzt ohne Probleme kompilieren.

1 „Gefällt mir“

Hallo zusammen,
ich bekommen leider trotz dem Fix auf dem aktuellen Master und Dev-Branch fast die selbe Fehlermeldung (Nur die Codezeile im processHtml.py ist unterschiedlich).

 Executing task: C:\Users\Laptop\.platformio\penv\Scripts\platformio.exe run --environment lolin_d32_pro_sdmmc_pe 

Processing lolin_d32_pro_sdmmc_pe (board: lolin_d32_pro; platform: espressif32@^6.10.0; framework: arduino, espidf)
--------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
GENERATING GIT REVISION HEADER FILE
  "55f7edd" -> C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\.pio\build\lolin_d32_pro_sdmmc_pe\generated\gitrevision.h
GENERATING HTML HEADER FILES
  C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\html\management.html -> C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\.pio\build\lolin_d32_pro_sdmmc_pe\generated\HTMLbinary.h

thread '<unnamed>' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\minify-js-0.6.0\src\minify\pass1.rs:331:13:
assertion failed: cons_expr.returns && alt_expr.returns
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
PanicException: assertion failed: cons_expr.returns && alt_expr.returns:
  File "C:\Users\Laptop\.platformio\penv\Lib\site-packages\platformio\builder\main.py", line 167:
    env.SConscript(env.GetExtraScripts("pre"), exports="env")
  File "C:\Users\Laptop\.platformio\packages\tool-scons\scons-local-4.8.1\SCons\Script\SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Laptop\.platformio\packages\tool-scons\scons-local-4.8.1\SCons\Script\SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\processHtml.py", line 176:
    HtmlHeaderProcessor().process()
  File "C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\processHtml.py", line 160:
    info = cls._process_binary_file(HTML_DIR / binary_file, binary_header, info)
  File "C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\processHtml.py", line 96:
    content = minify_html.minify(content, minify_js=True, minify_css=True,
===================================================== [FAILED] Took 2.06 seconds =====================================================

Klicke mal auf „full clean“ und dann auf build.

Bei mir schlagen leider alle Aktionen (clean, full clean, build,…) mit der selben Fehlermeldung fehl:

Executing task: C:\Users\Laptop\.platformio\penv\Scripts\platformio.exe run --target fullclean --environment lolin_d32_pro_sdmmc_pe 

Processing lolin_d32_pro_sdmmc_pe (board: lolin_d32_pro; platform: espressif32@^6.10.0; framework: arduino, espidf)
--------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
GENERATING GIT REVISION HEADER FILE
  "55f7edd" -> C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\.pio\build\lolin_d32_pro_sdmmc_pe\generated\gitrevision.h
GENERATING HTML HEADER FILES
  C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\html\management.html -> C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\.pio\build\lolin_d32_pro_sdmmc_pe\generated\HTMLbinary.h

thread '<unnamed>' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\minify-js-0.6.0\src\minify\pass1.rs:331:13:    
assertion failed: cons_expr.returns && alt_expr.returns
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
PanicException: assertion failed: cons_expr.returns && alt_expr.returns:
  File "C:\Users\Laptop\.platformio\penv\Lib\site-packages\platformio\builder\main.py", line 167:
    env.SConscript(env.GetExtraScripts("pre"), exports="env")
  File "C:\Users\Laptop\.platformio\packages\tool-scons\scons-local-4.8.1\SCons\Script\SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Laptop\.platformio\packages\tool-scons\scons-local-4.8.1\SCons\Script\SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\processHtml.py", line 176:
    HtmlHeaderProcessor().process()
  File "C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\processHtml.py", line 160:
    info = cls._process_binary_file(HTML_DIR / binary_file, binary_header, info)
  File "C:\Users\Laptop\Documents\Tanja\Toniebox\Repo\ESPuino_neu\ESPuino\processHtml.py", line 96:
    content = minify_html.minify(content, minify_js=True, minify_css=True,
============================================================== [FAILED] Took 1.78 seconds ==============================================================

Habe das Repo nochmal komplett neu geklont, ohne Erfolg. Irgendwelche Ideen wo ich mit der Fehlersuche starten könnte?

Also ich kann’s nicht nachstellen. Auf Github läuft das Build jetzt auch durch.
Was ist denn in settings.h konfiguriert?

Hallo,

das Problem hatte ich auch und habe es gelöst, indem ich die Unterordner und Dateien in den nachfolgenden Ordnern gelöscht habe (VSCode vorher schließen):

  • C:\Users<user>.platformio\packages
  • C:\Users<user>.platformio\penv
  • C:\Users<user>.platformio\platforms

Anschließend VSCode erneut öffnen und das Projekt wird neu aufgebaut.
Danach hat es bei mir funktioniert.

Vielen vielen Dank. Hatte das gleich Problem mit der minify_html. :+1:
Der Befehl zum installieren der Version 0.15.0 lautet

C:\Users\%username%\.platformio\penv\Scripts\python.exe -m pip install minify_html==0.15.0

Vielleicht sollte/könnte das in der processHtml.py [Zeile 27] gleich so hinterlegt werden :thinking:? Oder tritt das Problem nicht bei allen auf?

Das ist schon passiert im Repository.

1 „Gefällt mir“

hilft leider nicht, bei mir war minify_html 0.16.x installiert, ich musste von Hand 0.15 mit dem Befehl von @Alphastar installieren

Full Clean und .pio Ordner löschen hat nichts gebracht

PR ist offen: Bugfix: Pinning minify_html not working by JanHBade · Pull Request #361 · biologist79/ESPuino · GitHub

Die Fehlermeldung erscheint bei mir:
michael@Linux:~$ sudo pip install minify_html==0.15.0
[sudo] Passwort für michael:
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

leider sind da meine Linux-Kenntnisse am Ende kann mir jemand weiterhelfen

VG
Michael

Geh mal in deinem Userverzeichnis in .platformio. Dort drin müssen die Sachen installiert werden.
Kannst ja mal

find ./ |grep minify

eingeben. Dort müsste das gefunden werden. Wenn du in .platformio drin bist, dann klappt die Installation vielleicht mit:

penv/bin/pip3 install minify_html==0.15.0

Eigentlich sollte das richtige Pakt jetzt automatisch installiert werden, du brauchst da nix mehr von Hand machen.

Bist du auf dem aktuellen dev oder main?

Wie ist der Output von dir wenn du „Build“ drückst?

Das hat geklappt, aber die Fehlermeldung bleibt die gleiche .

du könntest jetzt ein

penv/bin/pip3 install pkg_resources

probieren (an gleicher Stelle)

Aber warum klappt das nicht? das sollte doch eigentlich mit dabei sein, komisch das Ganze

das klappt leider nicht:

Esetze pip…pkg… durch pip install setuptools

1 „Gefällt mir“