Opened 3 years ago

Last modified 3 years ago

#63392 new defect

doxygen @1.9.2: CMake Error: Unknown argument -EPSTOPDF=/opt/local/bin/epstopdf

Reported by: mouse07410 (Mouse) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: landonf (Landon Fuller)
Port: doxygen

Description

macOS Big Sur 11.5.2, Xcode-12.5.1.

$ port installed doxygen
The following ports are currently installed:
  doxygen @1.9.1_0+docs+qt5 (active)
$ sudo port -v upgrade doxygen
Enter PIN for 'Certificate For PIV Authentication (Blumenthal, Uri (UR20980))': 
--->  Computing dependencies for doxygen.
--->  Fetching archive for doxygen
--->  doxygen-1.9.2_0+docs+qt5.darwin_20.x86_64.tbz2 doesn't seem to exist in /opt/local/var/macports/incoming/verified
--->  Attempting to fetch doxygen-1.9.2_0+docs+qt5.darwin_20.x86_64.tbz2 from https://packages.macports.org/doxygen
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
--->  Attempting to fetch doxygen-1.9.2_0+docs+qt5.darwin_20.x86_64.tbz2 from https://nue.de.packages.macports.org/doxygen
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
--->  Attempting to fetch doxygen-1.9.2_0+docs+qt5.darwin_20.x86_64.tbz2 from http://atl.us.packages.macports.org/doxygen
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
--->  Fetching distfiles for doxygen
--->  Verifying checksums for doxygen
--->  Checksumming doxygen-1.9.2.src.tar.gz
--->  Extracting doxygen
--->  Extracting doxygen-1.9.2.src.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/doxygen/doxygen-1.9.2.src.tar.gz' | /usr/bin/tar -xf - 
--->  Applying patches to doxygen
--->  Applying patch-src-portable_c.c.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.9.2" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/textproc/doxygen/files/patch-src-portable_c.c.diff'
patching file src/portable_c.c
--->  Applying patch-CMakeLists.txt.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.9.2" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/textproc/doxygen/files/patch-CMakeLists.txt.diff'
patching file CMakeLists.txt
--->  Applying patch-longtabu.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.9.2" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/textproc/doxygen/files/patch-longtabu.diff'
patching file src/latexdocvisitor.cpp
patching file templates/latex/doxygen.sty
--->  Configuring doxygen
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.9.2" && /opt/local/bin/cmake -DCMAKE_INSTALL_PREFIX='/opt/local' -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_C_COMPILER="$CC" -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_INSTALL_RPATH=/opt/local/lib -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH=/opt/local/share/cmake/Modules -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/opt/local;/usr" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -Wno-dev -DPython_ADDITIONAL_VERSIONS=3.9 -DICONV_INCLUDE_DIR=/opt/local/include -DICONV_LIBRARY=/opt/local/lib/libiconv.dylib -Dbuild_doc=YES -EPSTOPDF=/opt/local/bin/epstopdf -Dbuild_wizard=ON -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.9.2 
CMake Error: Unknown argument -EPSTOPDF=/opt/local/bin/epstopdf
CMake Error: Run 'cmake --help' for all supported options.
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.9.2" && /opt/local/bin/cmake -DCMAKE_INSTALL_PREFIX='/opt/local' -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_C_COMPILER="$CC" -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_INSTALL_RPATH=/opt/local/lib -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH=/opt/local/share/cmake/Modules -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/opt/local;/usr" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -Wno-dev -DPython_ADDITIONAL_VERSIONS=3.9 -DICONV_INCLUDE_DIR=/opt/local/include -DICONV_LIBRARY=/opt/local/lib/libiconv.dylib -Dbuild_doc=YES -EPSTOPDF=/opt/local/bin/epstopdf -Dbuild_wizard=ON -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.9.2 
Exit code: 1
Error: Failed to configure doxygen: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_doxygen/doxygen/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

Looks like Portfile argument screw-up? -EPSTOPDF= instead of -DEPSTOPDF=? Changing this in the Portfile alleviates the problem.

Change History (7)

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: oxygen fails to builddoxygen @1.9.2: CMake Error: Unknown argument -EPSTOPDF=/opt/local/bin/epstopdf

If that's a mistake, it's been in the portfile for 6 years, since [7956949ba720ae08fa8280210dc0d4fe81a8d05b/macports-ports]. However, what changed recently is that cmake was updated to a new version that errors on unknown arguments; previously, unknown arguments were silently ignored, which is probably how this mistake was overlooked for so long.

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

I tried changing the flag to -DEPSTOPDF=/opt/local/bin/epstopdf-nope and although it now does not complain about an invalid cmake argument, it also does not fail to build and the log does not contain any references to epstopdf except for that flag itself. This makes me wonder whether the port still needs this flag or the dependency on epstopdf. I suppose the next thing to try would be to remove the dependency on the port that installs epstopdf, deactivate that port, and try to install doxygen +docs again and make sure that still succeeds too (and is not missing anything that gets built when epstopdf is present).

comment:3 Changed 3 years ago by mouse07410 (Mouse)

I suspect that while you can build oxygen without EPSTOPDF, it may fail during run in some cases. There's no reason for the log to refer to epstopdf, as the binary probably invokes it only when needed. You can try to binary-search the executable, but again - what's the point?

I urge you to just fix this flag, setting it to -DEPSTOPDF=/opt/local/bin/epstopdf and be done with it.

comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

The point was that I would not want a port to declare a dependency on something it does not use, and I did not see evidence of epstopdf's use in the log, and I assumed that epstopdf is something that would be used during the build. The use of epstopdf only appears within the port's doc variant and the only types of dependencies added by that variant are build dependencies, which means they cannot be things that get used by the files installed by the port at runtime. I left these notes in this ticket in order to assist whoever picks it up next; I'm not investigating further at the moment.

comment:5 Changed 3 years ago by mouse07410 (Mouse)

I would not want a port to declare a dependency on something it does not use, and I did not see evidence of epstopdf's use in the log . . .

The following precursory analysis of the Doxygen source demonstrates that it does require epstopdf to run:

$ cd ~/src/doxygen
$ rg epstopdf
src/msc.cpp
130:    QCString epstopdfArgs(maxCmdLine);
131:    epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
134:    if (Portable::system("epstopdf",epstopdfArgs)!=0)
136:      err_full(srcFile,srcLine,"Problems running epstopdf when processing '%s.eps'. Check your TeX installation!\n",

src/dia.cpp
75:    QCString epstopdfArgs(maxCmdLine);
76:    epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
79:    if (Portable::system("epstopdf",epstopdfArgs)!=0)
81:      err("Problems running epstopdf. Check your TeX installation!\n");

src/docparser.cpp
343:      QCString epstopdfArgs(4096);
344:      epstopdfArgs.sprintf("\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"",
348:      if (Portable::system("epstopdf",epstopdfArgs)!=0)
350:	err("Problems running epstopdf. Check your TeX installation!\n");

doc/CMakeLists.txt
18:find_program(EPSTOPDF NAMES epstopdf )

src/plantuml.cpp
259:        Debug::print(Debug::Plantuml,0,"*** %s Running epstopdf\n","PlantumlManager::runPlantumlContent");
266:            QCString epstopdfArgs(maxCmdLine);
267:            epstopdfArgs.sprintf("\"%s%s.eps\" --outfile=\"%s%s.pdf\"",
270:            if ((exitCode=Portable::system("epstopdf",epstopdfArgs.data()))!=0)
272:              err_full(nb.srcFile,nb.srcLine,"Problems running epstopdf. Check your TeX installation! Exit code: %d\n",exitCode);

doc/changelog.doc
2793:<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5559">5559</a> - plantUML requires epstopdf for building PDF files [<a href="https://github.com/doxygen/doxygen/commit/52d216a87451c867c92691a4483cd85d3e5b906f">view</a>]</li>
9939:<li>   Fixed problem with doxygen calling epstopdf.bat in Windows.</li>

src/diagram.cpp
1327:    QCString epstopdfArgs(4096);
1328:    epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
1330:    //printf("Converting eps using '%s'\n",qPrint(epstopdfArgs));
1332:    if (Portable::system("epstopdf",epstopdfArgs)!=0)
1334:       err("Problems running epstopdf. Check your TeX installation!\n");
$ 

I assumed that epstopdf is something that would be used during the build

Apparently, it is not used during (or for) the build. It is something that run-time requires for specific tasks (and, as expected, mostly for image or file format conversion), which a given invocation may or may not have.

Now, nowhere in the source did I find the EPSTOPDF definition used. The code invokes the epstopdf executable directly. I suspect it's an artifact of dependency discovery process, to ensure the required package is installed on this system:

$ rg EPSTOPDF
doc/CMakeLists.txt
18:find_program(EPSTOPDF NAMES epstopdf )
$ 

The use of epstopdf only appears within the port's doc variant and the only types of dependencies added by that variant are build dependencies . . .

Frankly, I doubt that - and conjecture that it indicates a deficiency of the Portfile, rather than how Doxygen works. But since I'm not an expert in either Doxygen innards, or Macports - I could be wrong here. Still, that's what the browsing of the Doxygen sources suggests (see above).

I left these notes in this ticket in order to assist whoever picks it up next; I'm not investigating further at the moment.

Again, I suggest that this obvious bug is fixed, to enable the package build - and IMHO no further investigation is necessary: the runtime dependency seems clear enough, so removing epstopdf package is highly likely to cause runtime failures for some people, depending on what they do.

comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: landonf added

Landon changed the configure argument in [dde0253f7da7e9836e7338194383061a1ef787d3/macports-ports] but did not increase the revision or change the dependency type, so perhaps that still needs to be done. If epstpdf is needed at runtime, then perhaps it is needed at runtime with any variant, not just with the docs variant, and the dependency and flag should be moved out of the docs variant.

comment:7 Changed 3 years ago by mouse07410 (Mouse)

If epstpdf is needed at runtime, then perhaps it is needed at runtime with any variant, not just with the docs variant, and the dependency and flag should be moved out of the docs variant.

I am quite certain that we should move the epstopdf dependency out of the docs variant, as it appears to be needed with any variant.

Not sure if the flag matters - but IMHO the lowest risk is fixing it and also moving out of the docs variant.

Note: See TracTickets for help on using tickets.