MagicStack / MagicStack/httptools

Guide/Troubleshooting for vendor/build?

Abierto
#120 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
1.3k
Forks
107
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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
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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la sección de desarrollo de README y compárala con los comandos de setup.py y Makefile. Comprueba las rutas indicadas `pip install -e .[test]` y `make`, y documenta los pasos de build necesarios, los submódulos vendor recursivos y el requisito de setuptools. La tarea está terminada cuando un nuevo colaborador puede seguir la configuración de desarrollo sin encontrarse con los errores indicados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
c, python
Área
build-system, documentation
Tipo de issue
Documentación
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.