boostorg / boostorg/build

Generator source validation?

Offen
#98 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
251
Forks
63
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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