MagicStack / MagicStack/httptools

Guide/Troubleshooting for vendor/build?

Aberta
#120 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Linguagem predominante
Python
Estrelas
1.3k
Forks
107
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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?

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece pela seção de desenvolvimento do README e compare-a com os comandos em setup.py e Makefile. Verifique os caminhos relatados `pip install -e .[test]` e `make`, depois documente as etapas de build necessárias, os submódulos vendor recursivos e o requisito de setuptools. Está concluído quando um novo colaborador puder seguir a configuração de desenvolvimento sem encontrar os erros relatados.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
c, python
Domínio
build-system, documentation
Tipo de issue
Documentação
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.