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

Broken link errors #105

Closed
alandefreitas opened this issue Oct 20, 2021 · 18 comments
Closed

Broken link errors #105

alandefreitas opened this issue Oct 20, 2021 · 18 comments

Comments

@alandefreitas
Copy link
Member

Description

The quickbook file generated by docca has a few warnings, such as Error: no ID for constraint linkend: "utility.ref.boost__base_from_member_lt__MemberType_&,_UniqueID__gt_.base_from_member"..

Preview

This output generated from these docs.

Replicating the issue

git clone -b docca_ref https://github.com/alandefreitas/utility.git
cd utility/doc
b2

I'm still coming up with a smaller example to replicate the issue.

@vinniefalco
Copy link
Member

(base) alandefreitas@alandefreitass-MacBook-Pro doc % b2
Performing configuration checks

    - default address-model    : 64-bit (cached) [1]
    - default architecture     : x86 (cached) [1]
    - symlinks supported       : yes (cached)

[1] clang-12
...patience...
...found 859 targets...
...updating 6 targets...
saxonhe.saxonhe_dir ../../../bin.v2/libs/utility/doc/_reference-dir/stage1/results
saxonhe.saxonhe_dir ../../../bin.v2/libs/utility/doc/_reference-dir/stage2/results
saxonhe.saxonhe ../../../bin.v2/libs/utility/doc/reference.qbk
quickbook.quickbook-to-boostbook ../../../bin.v2/libs/utility/doc/utility_doc.xml
Generating output file: ../../../bin.v2/libs/utility/doc/utility_doc.xml
xslt-xsltproc ../../../bin.v2/libs/utility/doc/utility_doc.docbook
xslt-xsltproc-dir html/utility_HTML.manifest
Error: no ID for constraint linkend: "utility.ref.boost__base_from_member_lt__MemberType_&,_UniqueID__gt_.base_from_member".
Error: no ID for constraint linkend: "utility.ref.boost__base_from_member_lt__MemberType_&,_UniqueID__gt_.member".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_ref.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_view.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__call_traits_lt__T_&__gt_.const_reference".
Error: no ID for constraint linkend: "utility.ref.boost__call_traits_lt__T_&__gt_.param_type".
Error: no ID for constraint linkend: "utility.ref.boost__call_traits_lt__T_&__gt_.reference".
Error: no ID for constraint linkend: "utility.ref.boost__call_traits_lt__T_&__gt_.value_type".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_type.overload1boost__compressed_pair.first_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_type.overload1boost__compressed_pair.first_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_type.overload1boost__compressed_pair.first_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_type.overload1boost__compressed_pair.first_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_type.overload1boost__compressed_pair.second_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_type.overload1boost__compressed_pair.second_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_type.overload1boost__compressed_pair.second_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_type.overload1boost__compressed_pair.second_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_param_type.overload1boost__compressed_pair.first_param_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_param_type.overload1boost__compressed_pair.first_param_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_param_type.overload1boost__compressed_pair.first_param_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_param_type.overload1boost__compressed_pair.first_param_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_param_type.overload1boost__compressed_pair.second_param_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_param_type.overload1boost__compressed_pair.second_param_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_param_type.overload1boost__compressed_pair.second_param_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_param_type.overload1boost__compressed_pair.second_param_type.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_reference.overload1boost__compressed_pair.first_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_reference.overload1boost__compressed_pair.first_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_reference.overload1boost__compressed_pair.first_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_reference.overload1boost__compressed_pair.first_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_reference.overload1boost__compressed_pair.second_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_reference.overload1boost__compressed_pair.second_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_reference.overload1boost__compressed_pair.second_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_reference.overload1boost__compressed_pair.second_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_const_reference.overload1boost__compressed_pair.first_const_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_const_reference.overload1boost__compressed_pair.first_const_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_const_reference.overload1boost__compressed_pair.first_const_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first_const_reference.overload1boost__compressed_pair.first_const_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_const_reference.overload1boost__compressed_pair.second_const_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_const_reference.overload1boost__compressed_pair.second_const_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_const_reference.overload1boost__compressed_pair.second_const_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second_const_reference.overload1boost__compressed_pair.second_const_reference.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload1boost__compressed_pair.compressed_pair.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload1boost__compressed_pair.compressed_pair.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload2boost__compressed_pair.compressed_pair.overload5".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload2boost__compressed_pair.compressed_pair.overload5".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload3boost__compressed_pair.compressed_pair.overload6".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload3boost__compressed_pair.compressed_pair.overload6".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload1boost__compressed_pair.compressed_pair.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload1boost__compressed_pair.compressed_pair.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload2boost__compressed_pair.compressed_pair.overload5".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload2boost__compressed_pair.compressed_pair.overload5".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload3boost__compressed_pair.compressed_pair.overload6".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.compressed_pair.overload3boost__compressed_pair.compressed_pair.overload6".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first.overload1boost__compressed_pair.first.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first.overload1boost__compressed_pair.first.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first.overload2boost__compressed_pair.first.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first.overload2boost__compressed_pair.first.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first.overload1boost__compressed_pair.first.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first.overload1boost__compressed_pair.first.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first.overload2boost__compressed_pair.first.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.first.overload2boost__compressed_pair.first.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second.overload1boost__compressed_pair.second.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second.overload1boost__compressed_pair.second.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second.overload2boost__compressed_pair.second.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second.overload2boost__compressed_pair.second.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second.overload1boost__compressed_pair.second.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second.overload1boost__compressed_pair.second.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second.overload2boost__compressed_pair.second.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.second.overload2boost__compressed_pair.second.overload4".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.swap.overload1boost__compressed_pair.swap.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.swap.overload1boost__compressed_pair.swap.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.swap.overload1boost__compressed_pair.swap.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair.swap.overload1boost__compressed_pair.swap.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first_const_reference".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first_param_type".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first_reference".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first_type".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second_const_reference".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second_param_type".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second_reference".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second_type".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.compressed_pair".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.swap".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.compressed_pair.overload1".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.compressed_pair.overload1".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.compressed_pair.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.compressed_pair.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.compressed_pair.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.compressed_pair.overload3".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first.overload1".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first.overload1".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.first.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second.overload1".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second.overload1".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__compressed_pair_lt__T,_T__gt_.second.overload2".
Error: no ID for constraint linkend: "utility.ref.boost__initialized.operator_T_const_&".
Error: no ID for constraint linkend: "utility.ref.boost__initialized.operator_T&".
Error: no ID for constraint linkend: "utility.ref.boost__value_initialized.operator_T_const_&".
Error: no ID for constraint linkend: "utility.ref.boost__value_initialized.operator_T&".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_view.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_view.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_view.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_view.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_ref.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_ref.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_ref.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_ref.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
...updated 6 targets...
(base) alandefreitas@alandefreitass-MacBook-Pro doc % 

@evanlenz
Copy link
Contributor

Looking more closely at this, these are actually not Quickbook warnings. (We do have issue #76 regarding some Quickbook warnings.)

The above errors are emitted by the DocBook stylesheets signifying broken links. I believe we're generating some invalid links like this:

image

I believe the comma in the ID is causing the problem. (The DocBook stylesheets apparently don't like this.)

Adding this to common.xsl fixed the few examples I reproduced. I'll have to check to see if there are other characters causing the problem (e.g. ampersands):

     <replace pattern="," with="_comma_"/>

@evanlenz evanlenz changed the title Quickbook warnings Broken link errors Oct 22, 2021
@evanlenz
Copy link
Contributor

@alandefreitas I'm still working on identifying other causes of the broken links in the other projects using docca, but I'm having trouble reproducing with the utility library, because I'm getting a different error:

evanl@THINKPAD-T480 ~/boost/libs
$ git clone -b docca_ref https://github.com/alandefreitas/utility.git
Cloning into 'utility'...
remote: Enumerating objects: 7134, done.
remote: Counting objects: 100% (256/256), done.
remote: Compressing objects: 100% (137/137), done.
Receiving objects: remote: Total 7134 (delta 143), reused 198 (delta 105), pack-reused 6878
Receiving objects: 100% (7134/7134), 2.33 MiB | 1.42 MiB/s, done.
Resolving deltas: 100% (3744/3744), done.

evanl@THINKPAD-T480 ~/boost/libs
$ cd utility/doc/

evanl@THINKPAD-T480 ~/boost/libs/utility/doc
$ b2
Performing configuration checks

[...snip...]

saxonhe.saxonhe ..\..\..\bin.v2\libs\utility\doc\_reference-dir\xml-pages.xml
Warning at char 9 in xsl:sequence/@select on line 78 column 84 of base-extract-xml-pages.xsl:
  FODC0002: Exception thrown by URIResolver: Invalid relative URI
  {structboost_1_1call__traits_3_...}: Illegal character in path at index 45:
  structboost_1_1call__traits_3_01const_01_t_01[_n]_4.xml
Type error evaluating (fn:document(...)) in xsl:sequence/@select on line 78 column 84 of base-extract-xml-pages.xsl:
  XTTE0780: An empty sequence is not allowed as the result of a call to d:get-source-doc#1
at function d:get-source-doc on line 76 of base-extract-xml-pages.xsl:
     invoked by function call at file:/C:/cygwin64/home/evanl/boost/bin.v2/libs/utility/doc/_reference-dir/base-extract-xml-pages.xsl#53
  In template rule with match="compound" on line 51 of base-extract-xml-pages.xsl
     invoked by xsl:apply-templates at file:/C:/cygwin64/home/evanl/boost/bin.v2/libs/utility/doc/_reference-dir/base-extract-xml-pages.xsl#26
  In template rule with match="/" on line 24 of base-extract-xml-pages.xsl
An empty sequence is not allowed as the result of a call to d:get-source-doc#1

    "java" -jar "C:/saxon/saxon9he.jar" -o:"..\..\..\bin.v2\libs\utility\doc\_reference-dir\xml-pages.xml" -s:"..\..\..\bin.v2\libs\utility\doc\_reference-dir\index.xml" -xsl:"..\..\..\bin.v2\libs\utility\doc\_reference-dir\extract-xml-pages.xsl"

...failed saxonhe.saxonhe ..\..\..\bin.v2\libs\utility\doc\_reference-dir\xml-pages.xml...
...removing ..\..\..\bin.v2\libs\utility\doc\_reference-dir\xml-pages.xml
...skipped <p..\..\..\bin.v2\libs\utility\doc>_reference-dir\stage1\results for lack of <p..\..\..\bin.v2\libs\utility\doc>_reference-dir\xml-pages...
...skipped <p..\..\..\bin.v2\libs\utility\doc>_reference-dir\stage2\results for lack of <p..\..\..\bin.v2\libs\utility\doc>_reference-dir\stage1\results...
...skipped <p..\..\..\bin.v2\libs\utility\doc>reference.qbk for lack of <p..\..\..\bin.v2\libs\utility\doc-object(xinclude-scanner)@12293>_reference-dir\xml-pages.xml...

[...snip...]

Are you getting this error too, or is it just me?

@alandefreitas
Copy link
Member Author

This is what I get:

Performing configuration checks

    - default address-model    : 64-bit (cached) [1]
    - default architecture     : x86 (cached) [1]
    - symlinks supported       : yes (cached)

[1] clang-12
...patience...
...found 859 targets...
...updating 6 targets...
saxonhe.saxonhe_dir ../../../bin.v2/libs/utility/doc/_reference-dir/stage1/results
saxonhe.saxonhe_dir ../../../bin.v2/libs/utility/doc/_reference-dir/stage2/results
saxonhe.saxonhe ../../../bin.v2/libs/utility/doc/reference.qbk
quickbook.quickbook-to-boostbook ../../../bin.v2/libs/utility/doc/utility_doc.xml
Generating output file: ../../../bin.v2/libs/utility/doc/utility_doc.xml
xslt-xsltproc ../../../bin.v2/libs/utility/doc/utility_doc.docbook
xslt-xsltproc-dir html/utility_HTML.manifest
Error: no ID for constraint linkend: "utility.ref.boost__base_from_member_lt__MemberType_&,_UniqueID__gt_.base_from_member".
Error: no ID for constraint linkend: "utility.ref.boost__base_from_member_lt__MemberType_&,_UniqueID__gt_.member".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_ref.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".

(dozens of similar warnings...)

Error: no ID for constraint linkend: "utility.ref.boost__basic_string_ref.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
Error: no ID for constraint linkend: "utility.ref.boost__basic_string_ref.operator_std__basic_string_lt__charT,_traits,_Allocator__gt_".
...updated 6 targets...

What's funny is I don't even see your first line after the configuration checks:

saxonhe.saxonhe ..\..\..\bin.v2\libs\utility\doc\_reference-dir\xml-pages.xml

I have been using the docca develop branch.

The script to replicate the issue should also include

git clone https://github.com/boostorg/boost
cd boost/libs
git clone -b docca_ref https://github.com/alandefreitas/utility.git
cd utility/doc
b2

for completeness but that shouldn't be a problem.

@evanlenz
Copy link
Contributor

I'm still trying to reproduce the errors but am running into a different error. I see a couple files in boost/bin.v2/libs/utility/doc/_reference-dir that look like the offending ones:

'structboost_1_1call__traits_3_01_t_01[_n]_4.xml'
'structboost_1_1call__traits_3_01const_01_t_01[_n]_4.xml'

Do you see these files in that same directory?

@evanlenz
Copy link
Contributor

For now, I was able to work around the problem on my end by temporarily commenting out some of the library code:

diff --git a/include/boost/detail/call_traits.hpp b/include/boost/detail/call_traits.hpp
index feca93d..981fbe8 100644
--- a/include/boost/detail/call_traits.hpp
+++ b/include/boost/detail/call_traits.hpp
@@ -140,6 +140,7 @@ struct call_traits< T * >
 };
 #endif
 #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
+/*
 template <typename T, std::size_t N>
 struct call_traits<T [N]>
 {
@@ -165,6 +166,7 @@ public:
    typedef const array_type& const_reference;
    typedef const T* const param_type;
 };
+*/
 #endif

 }

I am using Cygwin, so maybe the problem is unique to me. But I don't know yet. One issue at a time. 😅

@vinniefalco
Copy link
Member

vinniefalco commented Oct 27, 2021

To be honest, I don't think docca/doxygen is going to be a good choice for Boost.Utility. When using docca you have to structure code in a certain way to accommodate the toolchain. For example, files in detail directories should be skipped. But Utility probably either lifts some symbols from a detail namespace, or declares symbols in the primary namespace in files in detail directories. This breaks assumptions.

When you have a lot of code that hasn't been exposed to doxygen, very likely doxygen will emit faulty XML. And you have to painstakingly fix each piece of C++ code that doxygen is choking on. I instinctively know how to write new code that avoids this problem, because I have been working with docca for several years now and I am careful to run Doxygen frequently to identify problems the moment they appear.

For now, I believe that trying to convert an ancient library like Boost.Utility to use Doxygen is going to be an exercise in frustration, and even if successful will require considerable change to the sources. I'm not sure its a net win for the amount of change, given that the Doxygen C++ parser is relatively weak, and that Boost authors love to push the language to its limits.

@evanlenz
Copy link
Contributor

Good to know! Even so... I'm close to eliminating all the broken links. In each case so far, it's a matter of making docca more robust and doesn't involve any weird workarounds. So I'll proceed for now with this issue and regroup as necessary if we keep running into too many issues.

@evanlenz
Copy link
Contributor

A number (though not all) of the broken links are due to duplicate declarations that aren't really overloads. We could remove duplicates at the very first stage of processing to make docca more robust. For example, see first_type in each of these two files (one is marked "obsolete"):

This results in two identical entries in Doxygen's index.xml file:

On one line:

<member refid="classboost_1_1compressed__pair_1a05b29f866dcbca73330f11679e832a40" kind="typedef"><name>first_type</name></member>

And on another line:

<member refid="classboost_1_1compressed__pair_1a05b29f866dcbca73330f11679e832a40" kind="typedef"><name>first_type</name></member>

We could make Doxygen/docca more robust by ignoring identical duplicates. @vinniefalco, let me know if you'd like me to proceed with this change. It would fix a large portion of the broken links. The other two fixes involved escaping commas and escaping ampersands, respectively. That leaves just one broken link (out of over 100) that I haven't investigated yet.

This change should theoretically cause no harm but only good, but I can verify by testing it against all the libraries that use docca. It's not completely trivial, but it also shouldn't be difficult, and I should be able to do it in a plenty performant way.

@alandefreitas
Copy link
Member Author

I agree with you both.

The way Boost.Utility is structured doesn't help much. And I would also love to help docca as much as I can to make it more robust so we can use it for other libraries.

At worst, this exercise has been helping us make docca more resilient even if we don't use it. It seems like Evan found the cause of most broken links which is stupendous.

For example, files in detail directories should be skipped. But Utility probably either lifts some symbols from a detail namespace, or declares symbols in the primary namespace in files in detail directories. This breaks assumptions.

I think I partially managed to solve that. I attempted to separate the details from the API by excluding a combination of files and symbols.

For now, I believe that trying to convert an ancient library like Boost.Utility to use Doxygen is going to be an exercise in frustration, and even if successful will require considerable change to the sources. I'm not sure its a net win for the amount of change, given that the Doxygen C++ parser is relatively weak, and that Boost authors love to push the language to its limits.

The proposal here is to abandon docca or to abandon both doxygen and docca? The new documentation would have no reference then?

@vinniefalco
Copy link
Member

The proposal here is to abandon docca or to abandon both doxygen and docca?

I don't know what I'm proposing, but it looks like we could be in for a lot of pain because the mix of Doxygen's poor parsing ability and Boost.Utility not being written with these Doxygen parsing quirks in mind.

The new documentation would have no reference then?

The new documentation should have a reference, of course.

If you guys think you can work through all the issues, then go for it. Maybe it can be done with effort. namespace details is bollocks though, that should be renamed to namespace detail to be normalized. I don't want to be adding extra private namespace strings to docca.

@alandefreitas
Copy link
Member Author

That makes sense. I guess there's no harm in looking at what the reference will look like after we get rid of these warnings and the table of contents looks a little better.

@alandefreitas
Copy link
Member Author

Hi @evanlenz ,

because I'm getting a different error

I think you're getting an error at an earlier step for some reason. Probably something related to the OS.

I've also included

<replace pattern="," with="_comma_"/>

in common.xsl but still get the same warnings.

I'm still trying to reproduce the errors but am running into a different error. I see a couple files in boost/bin.v2/libs/utility/doc/_reference-dir that look like the offending ones:

The files have different names over here:

structboost_1_1call__traits.xml
structboost_1_1call__traits_3_01_t_0f_n_0e_4.xml
structboost_1_1call__traits_3_01_t_01_6_01_4.xml
structboost_1_1call__traits_3_01const_01_t_0f_n_0e_4.xml

Here is the complete list.

commenting out some of the library code

Great. I hope this one is something related to the OS only, considering the filenames are different. Maybe we could set up a VM with Ubuntu if we can't get the same warnings. The difference in the filenames could probably explain the first problem though.

For example, see first_type in each of these two files (one is marked "obsolete"):

That's interesting. For historical reasons, the files in boost/detail in boost utility are not implementation details while the files in boost/utility/detail are. But boost/detail/ob_compressed_pair.hpp is also not part of the public API just because. Only compressed_pair.hpp is.

I've attempted to remove these files in Jamfile.v2:

[ glob-tree-ex ../include/boost : *.hpp *.ipp : utility/detail detail/ob_compressed_pair.hpp ]

Not sure that completely worked. As @vinniefalco mentioned, it takes more effort to adapt a library that already exists than to write a library with doxygen + docca in mind.

But ignoring identical duplicates, as you said, sounds much more robust.

@alandefreitas
Copy link
Member Author

Some good news! 🎉

I've managed to put the reference in a child section so that the TOC looks cleaner while fixing the links in the subsection and getting the up arrows to work. The up arrows are not going to any blank pages anymore. For instance, the up arrow in this page goes back to the reference.

It's looking quite good. We can even reuse this pattern in Boost.Json to remove that blank page from there.

We only have a few broken links now, but they are in two groups and we know what they are:

  1. The links that contain an ampersand & in them, such as utility.index_and_ref.ref.boost__call_traits_lt__T_&__gt_.const_reference
  2. The links for the compressed_pair "false overloads", such as utility.index_and_ref.ref.boost__compressed_pair.second.overload1boost__compressed_pair.second.overload3

I think @evanlenz already identified a fix for both of them. And I'll also add some macros to remove whatever is in ob_compressed_pair.hpp for redundancy.

@alandefreitas
Copy link
Member Author

More good news. No warnings left. The result looks good. All links are OK.

Performing configuration checks

    - default address-model    : 64-bit (cached) [1]
    - default architecture     : x86 (cached) [1]
    - symlinks supported       : yes (cached)

[1] clang-12
...patience...
...found 859 targets...
...updating 4 targets...
saxonhe.saxonhe ../../../bin.v2/libs/utility/doc/reference.qbk
quickbook.quickbook-to-boostbook ../../../bin.v2/libs/utility/doc/utility_doc.xml
Generating output file: ../../../bin.v2/libs/utility/doc/utility_doc.xml
xslt-xsltproc ../../../bin.v2/libs/utility/doc/utility_doc.docbook
xslt-xsltproc-dir html/utility_HTML.manifest
...updated 4 targets...

The version without the warnings will only be correct in the preview because it required some local changes. We need some PRs to fix it permanently.

That required

<replace pattern="," with="_comma_"/>
<replace pattern="&amp;" with="_ampersand_"/>

in docca, so we need a PR for that. It's probably worth going through all HTML escaped chars that might cause errors and putting them there already.

The compressed_pair duplicates were manually removed with macros for now. So we need one more PR for that.

@evanlenz
Copy link
Contributor

evanlenz commented Oct 30, 2021

Excellent work! I am still working on the PR for all the broken-link issues. That includes the change you listed above, the treatment of friend sections as always public, and the duplicates removal. All are implemented and now I'm just verifying the changes across all the libraries to guard against regressions. (I suspect the bad-filename issue in the utility project will persist for me, but that sounds unique to my environment and I will have to address that separately.) Stay tuned...

EDIT: I forgot to mention I am also seeing some remaining broken links in the Beast project; I need to confirm they are all editorial problems or otherwise fix additional broken-link bugs in docca. I don't want to close this issue until I've somehow addressed all known broken link issues.

@evanlenz
Copy link
Contributor

evanlenz commented May 5, 2022

In order to ensure the bulk of this work isn't lost, I'm going to revisit, verify, and commit the relevant changes thus far. We can open a new issue to address any remaining broken links we might come across.

@sdkrystian
Copy link
Member

Fixed by 8ba36c0

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

No branches or pull requests

4 participants