boostorg / boostorg/build

Generator source validation?

Abierto
#98 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
251
Forks
63
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

The following scenario occurred (simplified for brevity):

```
# in a jamfile
alias MY_ALIAS ;
lib LIB : MY_ALIAS ;
```

Then, trying to build the `LIB` target:

```
*** argument error
* rule class@archive-generator.run ( project name ? : property-set : sources + )
* called with: ( object(project-target)@3272 LIB : object(property-set)@7510 : )
* missing argument sources
```

The source for the `LIB` target ends up producing an empty source list (user error). I can clearly tell that has happened from the error message, but I can't tell _where_ it occurred.

**Note**: we use the convention of specifying a single `LIB` target per library and in a project that uses multiple libraries, there are multiple `LIB` targets which is why it's not entirely clear _which_ `LIB` target the error message is referring to.

I have a couple of ideas that could be used to help the end user solve this problem.
1. For the base generator class, the `run` signature could be updated to use `*` instead of `+` and then check to see if `sources` is empty and print a better error message (target name, location, etc).
2. The Jam interpreter and the class implementations could be modified to support a "to string" or "repr" method and those would be called in the above error message. This would also be a benefit in several other places like `--debug-building` and `--debug-generators`.

The problem with the second idea is that it doesn't help the Python port.

Thoughts?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.