Skip to content

Conversation

@yadij
Copy link
Contributor

@yadij yadij commented Oct 13, 2025

This option now required to generate documentation.

Make documentation-specific tools optional depending on whether
documentation is being generated.

Small refactoring to ensure that generated documentation
(including release notes) absence does not break anything.

@yadij yadij added the feature maintainer needs documentation updates for merge label Oct 13, 2025
@kinkie
Copy link
Contributor

kinkie commented Oct 13, 2025

I'm not entirely sure it's beneficial to not automatically build man pages. What is the problem you'd like to solve and for whom?

SQUID_EMBED_BUILD_INFO

AC_ARG_ENABLE(documentation,
AS_HELP_STRING([--enable-documentation],[
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels wrong for the default Squid installation to have no manual pages (in environments where we can build those manual pages).

Please either keep the old "automated" default approach (i.e. enable the feature if we found the right tools) OR enable by default (breaking build in environments that do not supply those tools).


AC_ARG_ENABLE(documentation,
AS_HELP_STRING([--enable-documentation],[
Build optional documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Most readers will not know what documentation we consider optional. This should be spelled out.

## contributions from numerous individuals and organizations.
## Please see the COPYING and CONTRIBUTORS files for details.
##

Copy link
Contributor

Choose a reason for hiding this comment

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

PR description: This option now required to generate documentation.

The above assertion is false because we still generate some documentation (e.g., squid.conf.documented) even when building with --disable-documentation. Please be more precise when describing the scope of this PR and the effect of the new configure parameter.

Once sufficient precision is achieved, we can discuss the best name for the new configure parameter(s).

Make documentation-specific tools optional depending on whether documentation is being generated.

Those tools were optional before this PR, right? Please rephrase to clarify what has changed in that regard.

Small refactoring to ensure that generated documentation (including release notes) absence does not break anything.

Changes to release notes generation should wait for the conclusion of the discussion at #2261 (comment)

AC_MSG_WARN([pkg-config not found. Many optional features with external dependencies will not be enabled by default, usually without further warnings.])
])


Copy link
Contributor

Choose a reason for hiding this comment

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

Please avoid out-of-scope formatting changes.

AS_IF([test "x$enable_documentation" = "xyes"],[
AC_CHECK_TOOL([LINUXDOC],[linuxdoc],[:])
AS_IF([test "$LINUXDOC" = ":"],[
AC_MSG_FAILURE([linuxdoc is required to compile Squid documentation. Please install linuxdoc tools and then re-run configure.])
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAICT, Autoconf documentation implies that we should use AC_MSG_ERROR() here because this is not a compilation error that is likely to be detailed in config.log. Please test and adjust if needed.

SQUID_YESNO([$enableval],[--enable-documentation])
])
AS_IF([test "x$enable_documentation" = "xyes"],[
AC_CHECK_TOOL([LINUXDOC],[linuxdoc],[:])
Copy link
Contributor

Choose a reason for hiding this comment

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

Unlike AC_CHECK_PROG() that Squid already uses, AC_CHECK_TOOL() implies that we are dealing with some cross-compilation concerns here. Do we have to use that function for linuxdoc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should use this macro for these tools because they are only applicable for the build host. This avoids incorrectly finding target machine binaries in PATH and trying to use them.

Also, Squid is definitely cross-compiled on at least four OS. We should be using macros that sorts those problems out for all checks. But that is a wider problem out of scope here.

linuxdoc -B html -T 2 --split=0 $<
perl -i -p -e "s%$@%%" $@
cp -p $@ $(top_builddir)/RELEASENOTES.html
$(LINUXDOC) -B html -T 2 --split=0 $< && $(PERL) -i -p -e "s%$@%%" $@
Copy link
Contributor

Choose a reason for hiding this comment

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

To keep this code more readable and simpler, please keep these two commands on their separate/dedicated lines.

.sgml.html:
linuxdoc -B html -T 2 --split=0 $<
perl -i -p -e "s%$@%%" $@
cp -p $@ $(top_builddir)/RELEASENOTES.html
Copy link
Contributor

Choose a reason for hiding this comment

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

With this RELEASENOTES.html action removed, do we no longer install that file (when the tools to generate it are available, etc.)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The install is done by make dist when packaging. It does not need to be done here as well.

@yadij yadij added the M-ignored-by-merge-bots https://github.com/measurement-factory/anubis/blob/master/README.md#pull-request-labels label Nov 25, 2025
@yadij yadij marked this pull request as draft November 25, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature maintainer needs documentation updates for merge M-ignored-by-merge-bots https://github.com/measurement-factory/anubis/blob/master/README.md#pull-request-labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants