Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add application-help-to-doxygen #533

Merged
merged 6 commits into from Jan 20, 2017
Merged

Add application-help-to-doxygen #533

merged 6 commits into from Jan 20, 2017

Conversation

eile
Copy link
Member

@eile eile commented Jan 16, 2017

See screenshot for example output. Runs all non-GUI applications with
--help and pipes the output into a new doxygen section 'Application
help'

See screenshot for example output. Runs all non-GUI applications with
--help and pipes the output into a new doxygen section 'Application
help'
@eile
Copy link
Member Author

eile commented Jan 16, 2017

screen shot 2017-01-16 at 17 50 52

Copy link

@rdumusc rdumusc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice ouput, good idea!

#
# Arguments:
# * GUI: if set, build cross-platform GUI application
# * EXAMPLE: install all sources in share/Project/examples/Name
# * DOXYGEN: opt into doxygen help extraction for GUI applications
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it not non-GUI applications?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, non-GUI applications have to do it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I didn't pay enough attention that it was always on. But now I realize, if it fails silently, why is it not on for all apps including GUI apps? If --help is not implemented, the risk of undefined behaviour is the same for a command line application than for a gui app, right? And I can see it being useful for Brayns for instance. Maybe it should be an opt-out instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It does not fail silently
  2. Some GUI apps (livreGUI) start and stay open even with --help. muy bad.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussions, will make opt-out for all applications. Internal devs using it for non-GUI applications shall be temporarily shot during PR.

get_property(__help GLOBAL PROPERTY ${PROJECT_NAME}_HELP)
if(__help)
set(__index "${PROJECT_BINARY_DIR}/help/applications.md")
file(WRITE ${__index} "Application Help {#apps}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applications in plural ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik that is frenglish.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, my bad then :-)

DEPENDS ${Name}
COMMENT "Creating help for ${Name}")
add_custom_target(${Name}-help ALL DEPENDS ${_doc})
add_dependencies(${PROJECT_NAME}-all ${Name}-help)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this runs all the applications with --help when building Brion-all? If so, that does not look correct, it should be ${PROJECT_NAME}-doxygen, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -all target is run before doxygen. We could also attach it to -doxygen, but this feels more consistent, and will make sure it does get fixed since not everybody does verify this stuff during release.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it should be attached to the doxygen target, since that's where it is used. It does not make sense to run it every time we build. The argument that it has more chances of being fixed is not a valid reason, people won't notice if this breaks in any case unless they look at the documentation output...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. It does fail, and it will show up earlier (ie in a PR). Experience shows that people won't notice. It also does not affect build performance.

@tribal-tec, what's your opinion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fail early is good in principal, but I agree that building 'help' everytime you build 'all' is wrong, also annoying as I personally do 'all' quite often. Moreover, doxygen dependes on install, not on 'all'!

To fight problems being not noticed we could run doxygen as part of CI and report the errors from error. Now we actually have sometimes doxygen errors/warnings going unnoticed. We catch them only from time to time by checking the documentation CI plans...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I agree, if we fear that it might break unnoticed, then we should add a doxygen build to all Jenkins plans.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will attach to project-doxygen.

For the record, I still think this is a bad idea since it makes the dependency chain even more entangled. As @tribal-tec shows, it's already not well understood:

  • all is an internal, inaccessible CMake target
  • project-all is our target to which all project dependencies are attached, now also used by people during dev work
  • project-install depends on project-all (for obvious reasons)
  • project-doxygen depends on project-install since it works on the installed headers only
  • new: project-doxygen depends also on all project-help-targets

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here I clicked send to quick: I can't do the above: the project-doxygen target does not exist here. It's the whole raison de etre for the project-all target to collect all dependencies for doxygen.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding:

  • the "all" target is the default target when one does just "make", and it should just build everything (not install or do anything fancy).
  • the project-all target is the equivalent of the "all" target for each subproject, in the same way that project-install is the equivalent of the global "install" target.
  • the project-doxygen is our own concept and can do whatever it likes to produce documentation.
    If the project-doxygen is not available at this point, then the solution is to reverse the dependency order, exactly like it is done with the ${PROJECT_NAME}-coverage target. Which is also run by project-doxygen and not by project-all...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "all" target is the default target when one does just "make", and it should just build everything (not install or do anything fancy).

Yes.

the project-all target is the equivalent of the "all" target for each subproject, in the same way that project-install is the equivalent of the global "install" target.

Now it is. Originally it was created for project-doxygen.

the project-doxygen is our own concept and can do whatever it likes to produce documentation.

Yes.

If the project-doxygen is not available at this point, then the solution is to reverse the dependency order, exactly like it is done with the ${PROJECT_NAME}-coverage target. Which is also run by project-doxygen and not by project-all...

So now I have to create a project-help target to be able to attach it to project-doxygen?

Will do, but as a side note this is pretty demotivating for future work. For some reason it always feels like a ton of work for very little improvement. Somehow I would have less problems if this felt like an effort shared by all. Let's discuss f2f.

@@ -88,6 +88,19 @@ if(NOT COMMON_ORGANIZATION_NAME)
set(COMMON_ORGANIZATION_NAME Unknown)
endif()

# collect application help page
get_property(__help GLOBAL PROPERTY ${PROJECT_NAME}_HELP)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about file(GLOB __help "${PROJECT_BINARY_DIR}/help/*.md") instead of a global property? Potentially a bit more flexible and decoupled (for someone who wants to add his own help files in there).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it would pick up stale files (see above for manual checks during release...)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release is made by a Jenkin plan which does a clean build, and anyone doing a manual release will (should) do the same... But I see your point, as you prefer. ${PROJECT_NAME}_HELP should be documented as an IN variable here for consistency, and as an OUT variable in CommonApplication.cmake normally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we document this if the user is not supposed to use them?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair question. My take on this is to try to document every in/out variable of each CMake file, because it makes the interdependence between different files explicit. Having hidden global variables is not good for maintenance in the long run. Regarding this specific case, I am not sure if there is a reason users should be discouraged to add their own help file for a python application for instance (tide, rtneuron-app.py, ...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@eile
Copy link
Member Author

eile commented Jan 18, 2017

Do not merge due to opt-out needed for many targets now.

eile pushed a commit to eile/Servus that referenced this pull request Jan 18, 2017
eile pushed a commit to eile/Lexis that referenced this pull request Jan 18, 2017
eile pushed a commit to eile/Brion that referenced this pull request Jan 18, 2017
Copy link

@rdumusc rdumusc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two last detail then good to go!

# Raphael.Dumusc@epfl.ch

# Configures the build for a simple application:
# common_application(<Name> [GUI] [EXAMPLE])
# common_application(<Name> [GUI] [EXAMPLE] [DOXYGEN])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOXYGEN should be NOHELP

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -25,6 +25,10 @@
# * ${PROJECT_NAME}_VERSION_(MINOR|MAJOR) The project's major/minor version,
# generally set by the project() command in the top-level CMakeLists.txt.
#
# Input Global Properties
# * ${PROJECT_NAME}-HELP a list of doxygen page anchors to add to the
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_HELP

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

eile pushed a commit to eile/Deflect that referenced this pull request Jan 18, 2017
eile pushed a commit to eile/Deflect that referenced this pull request Jan 18, 2017
eile pushed a commit to eile/Brion that referenced this pull request Jan 19, 2017
eile pushed a commit to HBPVIS/Servus that referenced this pull request Jan 19, 2017
eile pushed a commit to eile/Lexis that referenced this pull request Jan 19, 2017
eile pushed a commit to BlueBrain/Deflect that referenced this pull request Jan 19, 2017
eile pushed a commit to HBPVIS/Lexis that referenced this pull request Jan 19, 2017
eile pushed a commit to eile/Brion that referenced this pull request Jan 19, 2017
eile pushed a commit to BlueBrain/Brion that referenced this pull request Jan 19, 2017
eile pushed a commit to eile/Equalizer that referenced this pull request Jan 20, 2017
eile pushed a commit to eile/Equalizer that referenced this pull request Jan 20, 2017
eile pushed a commit to eile/Livre that referenced this pull request Jan 20, 2017
eile pushed a commit to eile/Equalizer that referenced this pull request Jan 20, 2017
eile pushed a commit to Eyescale/Equalizer that referenced this pull request Jan 20, 2017
eile pushed a commit to eile/Livre that referenced this pull request Jan 20, 2017
eile pushed a commit to eile/Monsteer that referenced this pull request Jan 20, 2017
eile pushed a commit to eile/Fivox that referenced this pull request Jan 20, 2017
eile pushed a commit to eile/Livre that referenced this pull request Jan 20, 2017
eile pushed a commit to eile/Monsteer that referenced this pull request Jan 20, 2017
eile pushed a commit to BlueBrain/Livre that referenced this pull request Jan 20, 2017
eile pushed a commit to BlueBrain/Monsteer that referenced this pull request Jan 20, 2017
@eile eile merged commit d86f669 into Eyescale:master Jan 20, 2017
rdumusc pushed a commit to rdumusc/Tide that referenced this pull request Jan 20, 2017
tribal-tec pushed a commit to BlueBrain/Fivox that referenced this pull request Jan 23, 2017
rdumusc pushed a commit to rdumusc/Tide that referenced this pull request Jan 23, 2017
rdumusc pushed a commit to rdumusc/Tide that referenced this pull request Jan 26, 2017
rdumusc pushed a commit to BlueBrain/Tide that referenced this pull request Jan 26, 2017
eile pushed a commit to eile/Equalizer that referenced this pull request Feb 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants