Skip to content

configure: clarify --enable-debug option - #22512

Closed
jay wants to merge 1 commit into
curl:masterfrom
jay:clarify_enable_debug
Closed

jay wants to merge 1 commit into
curl:masterfrom
jay:clarify_enable_debug

Conversation

@jay

@jay jay commented Aug 7, 2026

Copy link
Copy Markdown
Member
  • Change --enable-debug help text to say it is for developing curl.

  • Warn when --enable-debug is used.

This change copies the help text and warning from cmake ENABLE_DEBUG. Also, it shortens the "for debugging curl itself" to just say "for debugging curl".

Now it looks like this:

  --enable-debug          Enable curl debug features (for developing curl)
  --disable-debug         Disable curl debug features

Ref: #22481 (comment)

Reported-by: Viktor Szakats

Closes #xxxx

- Change --enable-debug help text to say it is for developing curl.

- Warn when --enable-debug is used.

This change copies the help text and warning from cmake ENABLE_DEBUG.
Also, it shortens the "for debugging curl itself" to just say "for
debugging curl".

Now it looks like this:

  --enable-debug          Enable curl debug features (for developing
                          curl)
  --disable-debug         Disable curl debug features

Ref: curl#22481 (comment)

Reported-by: Viktor Szakats

Closes #xxxx
@jay jay added the build label Aug 7, 2026
@vszakats

vszakats commented Aug 7, 2026

Copy link
Copy Markdown
Member

Thanks.

A slightly related issue is that with autotools, this option also serves
to enable compiler debug options (aka -g, via $flags_dbg_yes).
There is no separate option to enable only the latter. One may pass them
manually, but if someone is looking at --help, wanting to do this, there
is no way (and also easy to think --enable-debug is the answer). IMO
there are valid cases to build libcurl with debug info and symbols, but
without the development parts.

@bagder

bagder commented Aug 7, 2026

Copy link
Copy Markdown
Member

wanting to do this, there is no way

Traditionally, configure options are not used for simply adding CFLAGS options. You can just CFLAGS=g ./configure.

@MichalPetryka

Copy link
Copy Markdown
Contributor

I wonder if it'd be better to rename this to --enable-testing or sth to not conflate it with Debug compiler configuration.

@icing

icing commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

I wonder if it'd be better to rename this to --enable-testing or sth to not conflate it with Debug compiler configuration.

That probably would break several deployed build pipelines in the world.

@MichalPetryka

Copy link
Copy Markdown
Contributor

I wonder if it'd be better to rename this to --enable-testing or sth to not conflate it with Debug compiler configuration.

That probably would break several deployed build pipelines in the world.

For now both options could work with the debug being effectively a deprecated name that wouldn't be in the docs.

@vszakats

vszakats commented Aug 7, 2026

Copy link
Copy Markdown
Member

I wonder if it'd be better to rename this to --enable-testing or sth to not conflate it with Debug compiler configuration.

That probably would break several deployed build pipelines in the world.

For now both options could work with the debug being effectively a deprecated name that wouldn't be in the docs.

Agreed, renaming an option is certainly possible, if there is a strong reason to do
it, since it also comes with disturbance. I tend to agree this is a strong one, but
that's only me. 'testing' may work, though in CMake BUILD_TESTING is already
used and means something else, so I'd probably seek more options. (It's a
CMake keyword, not curl-specific:
https://cmake.org/cmake/help/latest/variable/BUILD_TESTING.html)

@bagder

bagder commented Aug 7, 2026

Copy link
Copy Markdown
Member

I think enable testing is a downgrade. It's been called debugging since the dawn of time. Why is that wrong now?

@bagder

bagder commented Aug 7, 2026

Copy link
Copy Markdown
Member

not conflate it with Debug compiler configuration.

The compilers have no debug configuration do they? They have -g, the debug symbols option. Is that really so commonly confused?

@vszakats

vszakats commented Aug 7, 2026

Copy link
Copy Markdown
Member

The compilers have no debug configuration do they? They have -g, the debug symbols option. Is that really so commonly confused?

Not the OP, but I've been personally confused by the semantics of --enable-debug
several times. I don't know how frequent it is in general. But I'm also not using autotools
by default, which mean it's more of an outsider's opinion. Compilers have no debug
configuration, but in general, configuring for debug may mean more than just -g,
so other build tools or build frameworks often offer 'option packs' that cover common
combinations. (and abstract them to work more or less the same for all supported
compilers.) This is not a thing in autotools. But it's also one of the two things done
by curl's --enable-debug, DEBUGBUILD being the other. So if someone wants
a "just debug" build that matches compiler options set by --enable-debug, it's a
dive into the m4 sources to figure out what those are for a given compiler. This is
friction and not practical (esp in CI), which means some build combinations are not
tested in CI with autotools. This is fine, because CMake can fill in, and vice versa.
All in all, having slightly different semantics in build tools is useful, and expected.
That said, having unambiguous names always help, too, I find.

@bagder

bagder commented Aug 7, 2026

Copy link
Copy Markdown
Member

I don't know how frequent it is in general. But I'm also not using autotools by default

--enable-debug is not really "an autotools thing" and I have no idea if other projects have such an option in their autotools scripts. It is an option I felt I needed to enable things in the build for debugging purposes so I added it (back in February 2001). The name, the function, what it does started out what I think are useful when debugging curl. It has been tweaked and extended ever since.

@bagder

bagder commented Aug 7, 2026

Copy link
Copy Markdown
Member

some build combinations are not tested in CI with autotools

We have literally billions of build combinations with both setups. Most build combinations are not tested. With either configure method.

@vszakats

vszakats commented Aug 7, 2026

Copy link
Copy Markdown
Member

some build combinations are not tested in CI with autotools

We have literally billions of build combinations with both setups. Most build combinations are not tested. With either configure method.

Right, but what we consider "important" ones, are. I find great value in
mixing and matching options. The ability to tweak one toggle at a time
helps a great deal to narrow down root causes. When they are bundled
up (sometimes by accident), difficulty can escalate.

@jay

jay commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

I think a name change is unwarranted. The option needed clarification and this PR addresses that so I'm going to land it.

@jay jay closed this in a15cf1e Aug 7, 2026
@jay
jay deleted the clarify_enable_debug branch August 7, 2026 16:01
vszakats added a commit to vszakats/curl that referenced this pull request Aug 10, 2026
vszakats added a commit that referenced this pull request Aug 10, 2026
- CMAKE_INSTALL.md: sync up option desc with `CMakeLists.txt`.
- sync `--enable-debug` configure text with help description.
- say `--disable-debug` is the default in help description.

Follow-up to a15cf1e #22512

Closes #22532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

5 participants