Issue #6 resolved

qrc_emitter missing from the Qrc4 builder

dirkbaechle
repo owner created an issue

Originally reported by Gerhard Dirschl:

The (explicit) Qrc4 builder is missing the __qrc_emitter.

--- release_13072010.py 2010-11-05 10:41:24.441051117 +0100 +++ qt4.py 2010-11-10 13:49:55.610526010 +0100 @@ -534,6 +534,7 @@ suffix = '.qm') qrc_builder = SCons.Builder.Builder( action = SCons.Action.CommandGeneratorAction(qrc_generator, {}), + emitter = qrc_emitter, source_scanner = qrcscanner, src_suffix = '$QT4_QRCSUFFIX', suffix = '$QT4_QRCCXXSUFFIX',

Comments (5)

  1. dirkbaechle reporter

    Hi Gerhard,

    I had a first short look at your bug report. Can you please explain, in a little more detail, how the error/bug looks like on your side? What are you trying to do, and how does it fail (exact error message)? It would be awesome if you could prepare a small testcase...

    Best regards,

    Dirk

  2. dirkbaechle reporter

    Gerhard:

    Hi Dirk

    I thought it was obvious so I didn't add more details. I've attached a very short test case which shows the problem (qt4 Tool 0.1 is included). The C++ file generated by env.Qrc4(...) has the wrong suffix. It should be '.cc' but it is '.qrc' (just as the input file). If I stick that output file into an env.Object() Builder (or env.SharedLibrary(), or env.Program()...), the attached qrc source file builder is called again and tries to translate the C++ file (because of the suffix).

    The env.Qrc4(...) uses the wrong filename because it has no emitter attached. Adding qrc_emitter to the builder fixes the problem. The bug applies only to the explicit env.Qrc4(...) builder. The .qrc source file builder (the one attached to env.Object(), env.Program()) is not affected. Passing the input file test.qrc directly to env.Object(...) works perfectly.

  3. dirkbaechle reporter

    Thanks for the test case.... You are right, there is a bug. But it's not in the builder/emitter, it's in the manual: please say

    env.Qrc4('test')

    and you should get what you want. The point is, that the Qrc4 builder sees that only a target (and no source) is specified. Then it simply copies the list of targets to source, so in your test case you effectively get an "env.Qrc4('test.qrc','test.qrc')". Although the proper prefixes and suffixes are specified for the Builder, SCons will not touch the target's name...it already has an extension. One could add the "ensure_suffix" option, but then we would get "test.qrc.cc" as output...not nice. The emitter function is only there for the automatic Qrc action that gets attached to the static/shared object builders, and is needed in this case to ensure the proper names (especially the qrc_ prefix to avoid name clashes) for the resulting files.

    I'll fix the manual and upload a new version as soon as possible.

    Best regards,

    Dirk

  4. dirkbaechle reporter

    Gerhard:

    Thanks for the explanation. I will update my project and revert my "fix". I was using a quite old revision of the qt4 scons tool from one of the different branches. Back then the builder was named env.Qrc and worked when specifying the source file (I don't know if it was meant to work this way but it worked). Then I upgraded to Release 0.1, renamed env.Qrc to env.Qrc4 and ... failure.

  5. Log in to comment