Giter Club home page Giter Club logo

Comments (9)

tomreyn avatar tomreyn commented on May 21, 2024

We should either add --help output to these tools (preferred) or not run help2man (to automatically generate man pages) on those (only).

from megaglest-source.

titiger avatar titiger commented on May 21, 2024

@akien-mga: 3.11.0 had a bug in the map editor which crashes it on startup on some systems, depending on the wxwidget version which was used. Maybe thats why you got no output for --help?
Or was the output not sufficient enough ? In this case, what would you expect to be the output of --help ?

from megaglest-source.

akien-mga avatar akien-mga commented on May 21, 2024

Well I've just tried and it's true that megaglest_editor crashes on my system with wxWidgets 2.8.12. I'll try to build against wxWidgets 3.0 and see if that fixes the issue.

For the --help output, I don't have particular wishes, I'm just reporting that the default buildsystem seems to fine it incompatible with the generation of a manpage via help2man.
With the installed binary, the --help output is:

megaglest_editor --help
Using wxWidgets version [2.8.12.0]
MegaGlest map editor v1.6.1 [Using wxWidgets 2.8.12]

glest_map_editor [GBM OR MGM FILE]

Creates or edits glest/megaglest maps.
Draw with left mouse button (select what and how large area in menu or toolbar)
Pan trough the map with right mouse button
Zoom with middle mouse button or mousewheel

from megaglest-source.

akien-mga avatar akien-mga commented on May 21, 2024

The bug is still valid with megaglest 3.11.1.

I confirm that megaglest_editor and megaglest_g3dviewer both have a valid --help output, but for some reason help2man doesn't like it during the build. I checked the advice given in the build error, both files redirect their --help stream to stdout, so it's not a stdout vs. stderr issue.

from megaglest-source.

akien-mga avatar akien-mga commented on May 21, 2024

Ok, the funny thing is that this bug happens only when I try to build a megaglest RPM. If I build without the RPM spec file but using the exact same CMake and make arguments, I get no issue with help2man...

I don't know why it would behave differently when run through a RPM spec file, maybe the shell environments differs and something funny happens?

My guess would be that something delays the generation/copy of the linked executable, but make still goes on and gives the hand to the manpage generation too early. I've confirmed that trying to run help2man on a non-existing target gives the same error as in my initial post:

$ help2man --name='blabla' --section=6 -N -o test.6 ./ThisFileDoesNotExist
help2man: can't get `--help' info from ./ThisFileDoesNotExist
Try `--no-discard-stderr' if option outputs to stderr

A workaround could be to add some delay between the linking step and the step which generates the man page. Do you know how I could achieve that?

from megaglest-source.

akien-mga avatar akien-mga commented on May 21, 2024

I've dug in some more, and it seems help2man fails even if I call it myself in the RPM spec file, so this whole issue is about an RPM issue. IMO you can close it as invalid.

from megaglest-source.

akien-mga avatar akien-mga commented on May 21, 2024

Actually the --no-discard-stderr advised by the error message was not a bad tip, I've patch the CMakeLists.txt files to add this argument to the two problematic targets (no idea why it works fine for glest_game), and it does the trick:

Index: megaglest-3.11.1/source/glest_map_editor/CMakeLists.txt
===================================================================
--- megaglest-3.11.1/source/glest_map_editor/CMakeLists.txt
+++ megaglest-3.11.1/source/glest_map_editor/CMakeLists.txt 2015-03-12 20:17:34.644512947 +0100
@@ -168,11 +168,11 @@
            MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} about to build manpage with it.")

            add_custom_target(${TARGET_NAME_MANPAGE} ALL
-                   COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770 ${HELP2MAN} --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
+                   COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770 ${HELP2MAN} --no-discard-stderr --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
                DEPENDS ${TARGET_NAME})
        ELSE()
            add_custom_target(${TARGET_NAME_MANPAGE} ALL
-                   COMMAND ${HELP2MAN} --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
+                   COMMAND ${HELP2MAN} --no-discard-stderr --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
                DEPENDS ${TARGET_NAME})
        ENDIF()
    ENDIF()
Index: megaglest-3.11.1/source/g3d_viewer/CMakeLists.txt
===================================================================
--- megaglest-3.11.1/source/g3d_viewer/CMakeLists.txt
+++ megaglest-3.11.1/source/g3d_viewer/CMakeLists.txt   2015-03-12 20:17:04.468858390 +0100
@@ -175,11 +175,11 @@
            MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} about to build manpage with it.")

            add_custom_target(${TARGET_NAME_MANPAGE} ALL
-                   COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770 ${HELP2MAN} --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
+                   COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770 ${HELP2MAN} --no-discard-stderr --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
                DEPENDS ${TARGET_NAME})
        ELSE()
            add_custom_target(${TARGET_NAME_MANPAGE} ALL
-                   COMMAND ${HELP2MAN} --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
+                   COMMAND ${HELP2MAN} --no-discard-stderr --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
                DEPENDS ${TARGET_NAME})
        ENDIF()
    ENDIF()

The fact that one target is working and the other two don't makes me wonder if there would be a difference in the way those --help methods are coded (maybe for the editor and g3dviewer it's handled somehow by wxgtk?) that could explain why some seem to send their output to stderr when in a RPM build environment...

from megaglest-source.

tomreyn avatar tomreyn commented on May 21, 2024

So this seems to be a bug in some software we depend on. We might still try to work around it.

from megaglest-source.

softcoder avatar softcoder commented on May 21, 2024

This patch is applied

from megaglest-source.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.