MagicStack / MagicStack/httptools

Guide/Troubleshooting for vendor/build?

Offen
#120 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
1.3k
Forks
107
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

After digging through the source for a while and trying to see if httptools might meet my needs I decided it was time to add a test case to tests/test_parser.py

I was attempting to follow the Development instructions https://github.com/MagicStack/httptools?tab=readme-ov-file#development and got an error during pip install -e .[test].

      httptools/parser/parser.c:1260:10: fatal error: llhttp.h: No such file or directory
       1260 | #include "llhttp.h"
            |          ^~~~~~~~~~
      compilation terminated.

Ubuntu doesn't have a node-llhttp-dev package and node-llhttp doesn't help; that's about where my C build knowledge ends sadly.

I was so confused until I found the vendor directory with some anemic submodules; apparently the --recursive in the git clone step is kind of important 😉 In my case the alternative solution was git submodule update --init after the fact; whoops!

Then I remembered how desperately modern python's are trying to get rid of setuptools:

(.venv) clayg@ThinkStation:~/Workspace/scratch/httptools$ make
python3 setup.py build_ext --inplace
Traceback (most recent call last):
  File "/mnt/c/Users/cgerrard/Workspace/scratch/httptools/setup.py", line 10, in <module>
    from setuptools import setup, Extension
ModuleNotFoundError: No module named 'setuptools'
make: *** [Makefile:9: compile] Error 1

... but I eventually got to write my test (surprise: llhttp does NOT allow for non-ascii bytes in header names or values: https://gist.github.com/clayg/174d8e427c4263230b3cdf6591f3365f)

Anyway; would you find it helpful to include some expanded notes/guide/troubleshooting on the build requirements/process (or how to update the vendored submodules?) added to the existing README development section or would it be better to keep that as simple as possible and make a new/different file?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Entwicklungsabschnitt in README und vergleiche ihn mit den Befehlen in setup.py und Makefile. Überprüfe die gemeldeten Pfade pip install -e .[test] und make, und dokumentiere die erforderlichen Build-Schritte, die rekursiven vendor-Submodule und die setuptools-Anforderung. Erledigt ist die Aufgabe, wenn ein neuer Beitragender dem Entwicklungs-Setup folgen kann, ohne auf die gemeldeten Fehler zu stoßen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, python
Bereich
build-system, documentation
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.