Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#8252 closed enhancement (fixed)

[PATCH] Create a "debug" build profile for use with Buildbot

Reported by: umccullough Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/Development
Keywords: buildbot debug Cc: mdisreali@…
Blocked By: Blocking:
Platform: All

Description

The attached patch creates a "debug" build profile (in a newly-added DebugBuildProfiles jamfile) while also fixing an issue that is preventing building with DEBUG=1 on a 64bit host.

This build profile will be used with Buildbot to continually test compilation of (most of) the tree with DEBUG=1 set.

During my testing, I discovered a few areas in the tree where targets failed to compile with DEBUG=1 and have added these as exceptions in the profile. These should eventually be fixed and the exceptions removed.

Patch was created with "git format-patch --stdout", please let me know if this is an issue.

Attachments (19)

add_debug_profile.patch (5.9 KB ) - added by umccullough 12 years ago.
patch to add debug profile and fix build on 64bit host
add_gcc4_exception_debug_profile.patch (1.1 KB ) - added by umccullough 12 years ago.
This should be applied after the other patch to add another subdirectory exception for gcc4 builds
add_debug_profile.2.patch (4.0 KB ) - added by umccullough 12 years ago.
Separate patch for adding the debug profile from the 64bit build issue
debug_build_on_64bit.patch (1.9 KB ) - added by umccullough 12 years ago.
Fix debug build on 64bit host
Fix-copy-paste-error-in-mouse-preferences-so-it-will.patch (860 bytes ) - added by umccullough 12 years ago.
Fix the mouse preferences debug build
Avoid-warning-in-debug-code-for-media-server.patch (768 bytes ) - added by umccullough 12 years ago.
Fix media server debug build
Fix-implicit-void-cast-in-usb_midi-debug-code.patch (920 bytes ) - added by umccullough 12 years ago.
Fix usb_midi debug build
Fix-warning-in-AutoMounter-debug-code.patch (888 bytes ) - added by umccullough 12 years ago.
Fix AutoMounter debug build
Fix-warning-in-BSnow-debug-code.patch (800 bytes ) - added by umccullough 12 years ago.
Fix BSnow debug build
Fix-warnings-in-OpenSound-debug-code.patch (1.4 KB ) - added by umccullough 12 years ago.
Fix OpenSound debug build
Fix-bad-debug-print-in-canna.patch (880 bytes ) - added by umccullough 12 years ago.
Fix canna input method debug build
Fix-various-issues-in-cortex-debug-code.patch (3.4 KB ) - added by umccullough 12 years ago.
Fix cortex debug build
Fix-PDF-print-driver-debug-code.patch (760 bytes ) - added by umccullough 12 years ago.
Fix PDF print driver debug build
Fix-another-mouse-preference-issue-specific-to-gcc4-.patch (1.1 KB ) - added by umccullough 12 years ago.
Fix another mouse pref issue for GCC4 debug build (sorry I didn't catch this one earlier)
Conditionally-add-debug.c-to-ctags-build.patch (761 bytes ) - added by umccullough 12 years ago.
debug.c is required to compile ctags with DEBUG=1
Disabled-DEBUG-1-in-several-of-the-3rd-party-ffmpeg-.patch (3.1 KB ) - added by umccullough 12 years ago.
Allow ffmpeg sources to compile during debug build
Disable-DEBUG-build-of-3rd-party-libgutenprint.patch (845 bytes ) - added by umccullough 12 years ago.
Allow libgutenprint sources to compile during debug build
Fix-ASSERT-that-wasn-t-altered-back-in-hrev39770-all.patch (811 bytes ) - added by umccullough 12 years ago.
Fix debug build of libprint
Remaining-subdirs-that-cannot-be-compiled-with-DEBUG.patch (2.0 KB ) - added by umccullough 12 years ago.
Patch BuildSetup to disable DEBUG=1 support on subdirs with targets that won't compile as such

Download all attachments as: .zip

Change History (44)

by umccullough, 12 years ago

Attachment: add_debug_profile.patch added

patch to add debug profile and fix build on 64bit host

comment:1 by umccullough, 12 years ago

patch: 01

comment:2 by umccullough, 12 years ago

Oops, there is one more subdirectory that doesn't compile with DEBUG=1 under gcc4 (I missed that during my testing) - I'll add an additional patch for that.

by umccullough, 12 years ago

This should be applied after the other patch to add another subdirectory exception for gcc4 builds

comment:3 by mmadia, 12 years ago

What happens when jam -q @debug is run with HAIKU_ADD_ALTERNATIVE_GCC_LIBS ?= 1 ; ?

Does the alternative_system_libs.zip get compiled with debugging?

comment:4 by Disreali, 12 years ago

Cc: mdisreali@… added

Has this been tested when building on a Haiku host?

in reply to:  3 ; comment:5 by umccullough, 12 years ago

Replying to mmadia:

What happens when jam -q @debug is run with HAIKU_ADD_ALTERNATIVE_GCC_LIBS ?= 1 ; ?

Does the alternative_system_libs.zip get compiled with debugging?

In theory, it should work, and they should include debug code I think (since the variable is set for the directory structure and all targets compiled from within in)... but I'd probably have to increase the image size again.

I'll test this out when I get a chance (probably tomorrow).

@Disreali:

Haven't tested it - and we don't have a buildbot slave on a Haiku host yet either. It should work I think - and I'll perhaps start setting up a buildslave for this soon.

in reply to:  5 ; comment:6 by bonefish, 12 years ago

Replying to umccullough:

Replying to mmadia:

What happens when jam -q @debug is run with HAIKU_ADD_ALTERNATIVE_GCC_LIBS ?= 1 ; ?

Does the alternative_system_libs.zip get compiled with debugging?

In theory, it should work, and they should include debug code I think (since the variable is set for the directory structure and all targets compiled from within in)...

I doubt that. The alternative gcc part is built in a sub-jam and besides the list of optional packages nothing is propagated to it.

I'm undecided whether it is worth having this build profile at all. The list of DEBUG exceptions could as well be moved to BuildSetup and then the same effect could be reached by running

DEBUG=1 HAIKU_IMAGE_NAME=haiku-debug.image HAIKU_IMAGE_SIZE=650 jam @image

Since I can't think of anyone being interested in building such a debug image that seems good enough to me.

The BBlockCache fix looks OK and could be applied regardless.

in reply to:  6 ; comment:7 by umccullough, 12 years ago

Replying to bonefish:

I doubt that. The alternative gcc part is built in a sub-jam and besides the list of optional packages nothing is propagated to it.

Hmm... would using "DEBUG=1 jam @image" fix that issue?

Since I can't think of anyone being interested in building such a debug image that seems good enough to me.

Ok. I've already got additional patches for fixing several of those exceptions... should I just create a new ticket for all of those?

The BBlockCache fix looks OK and could be applied regardless.

Can someone apply that for me? :)

in reply to:  7 comment:8 by bonefish, 12 years ago

Replying to umccullough:

Replying to bonefish:

I doubt that. The alternative gcc part is built in a sub-jam and besides the list of optional packages nothing is propagated to it.

Hmm... would using "DEBUG=1 jam @image" fix that issue?

Yep. Though, obviously, the calling jam's DEBUG variable value should be propagated.

Ok. I've already got additional patches for fixing several of those exceptions... should I just create a new ticket for all of those?

I guess attaching them to this ticket is fine.

The BBlockCache fix looks OK and could be applied regardless.

Can someone apply that for me? :)

I don't have much time ATM and my tree is in a rather messy state, so if there's any other taker, that would go faster.

by umccullough, 12 years ago

Attachment: add_debug_profile.2.patch added

Separate patch for adding the debug profile from the 64bit build issue

by umccullough, 12 years ago

Attachment: debug_build_on_64bit.patch added

Fix debug build on 64bit host

comment:9 by umccullough, 12 years ago

I broke the original patch into two so that the 64bit debug fix can be applied separately.

comment:10 by mmadia, 12 years ago

Applied debug_build_on_64bit.patch in hrev43545, based on mailing list feedback.

by umccullough, 12 years ago

Fix the mouse preferences debug build

by umccullough, 12 years ago

Fix media server debug build

by umccullough, 12 years ago

Fix usb_midi debug build

by umccullough, 12 years ago

Fix AutoMounter debug build

by umccullough, 12 years ago

Fix BSnow debug build

by umccullough, 12 years ago

Fix OpenSound debug build

comment:11 by umccullough, 12 years ago

Attached a few patches to fix various debug builds - I'm sure some of these possibly aren't the best way to fix the problems, but I tried :)

I'll work on a better patch to exclude the rest of the misbehaving subdirs per Ingo's suggestion.

comment:12 by bonefish, 12 years ago

I forgot to mention: For the third-party code with errors I would simply disable debugging (i.e. override DEBUG) in the respective Jamfiles.

by umccullough, 12 years ago

Fix canna input method debug build

in reply to:  12 comment:13 by umccullough, 12 years ago

Replying to bonefish:

I forgot to mention: For the third-party code with errors I would simply disable debugging (i.e. override DEBUG) in the respective Jamfiles.

OK - I think all the patches I've supplied so far are either our own code, or code that I doubt we plan to replace again (canna input method for example).

Once I've fixed as many as I feel are within my means, I'll submit the jamfile patches you proposed.

comment:14 by mmadia, 12 years ago

Fix-copy-paste-error-in-mouse-preferences-so-it-will.patch applied in hrev43550. Can anyone comment on the other patches?

by umccullough, 12 years ago

Fix cortex debug build

by umccullough, 12 years ago

Fix PDF print driver debug build

by umccullough, 12 years ago

Fix another mouse pref issue for GCC4 debug build (sorry I didn't catch this one earlier)

in reply to:  12 ; comment:15 by umccullough, 12 years ago

Replying to bonefish:

I forgot to mention: For the third-party code with errors I would simply disable debugging (i.e. override DEBUG) in the respective Jamfiles.

I wasn't sure how to do this - so the last patch I attached here has all of the logic in BuildSetup still.

The 3rd party dirs we likely won't mess with are the two printing libs and the ffmpeg stuff I guess?

in reply to:  15 ; comment:16 by bonefish, 12 years ago

Replying to umccullough:

Replying to bonefish:

I forgot to mention: For the third-party code with errors I would simply disable debugging (i.e. override DEBUG) in the respective Jamfiles.

I wasn't sure how to do this - so the last patch I attached here has all of the logic in BuildSetup still.

Just add a DEBUG = 0 ; line in the respective Jamfiles somewhere between the SubDir and the rule invocation for the first target. Ideally with a comment.

The 3rd party dirs we likely won't mess with are the two printing libs and the ffmpeg stuff I guess?

With 3rd party I mean code that is still developed outside of our repository and might be updated or outsourced eventually. Hence I would consider libprint "absorbed", but yes to the others. Moreover coreutils and ctags fall into my 3rd party category. tcpdump as well, though it seems to have been customized quite a bit, so the debug code should probably better be fixed.

Regarding the patches:

Fix-implicit-void-cast-in-usb_midi-debug-code.patch
Fix-warning-in-AutoMounter-debug-code.patch
Fix-warning-in-BSnow-debug-code.patch
Fix-bad-debug-print-in-canna.patch
Fix-various-issues-in-cortex-debug-code.patch
Fix-PDF-print-driver-debug-code.patch
Fix-another-mouse-preference-issue-specific-to-gcc4-.patch

Signed-off-by: Ingo Weinhold <ingo_weinhold@gmx.de>

Avoid-warning-in-debug-code-for-media-server.patch: What's the warning and why does the patch fix it? Looks completely equivalent to me.

Fix-warnings-in-OpenSound-debug-code.patch: First part OK, the second part, just like the previous patch, I don't understand.

PS: It would really be nice to have that "Apply Patch" button in Trac.

in reply to:  16 comment:17 by umccullough, 12 years ago

Replying to bonefish:

Just add a DEBUG = 0 ; line in the respective Jamfiles somewhere between the SubDir and the rule invocation for the first target. Ideally with a comment.

OK, Will do.

With 3rd party I mean code that is still developed outside of our repository and might be updated or outsourced eventually. Hence I would consider libprint "absorbed", but yes to the others. Moreover coreutils and ctags fall into my 3rd party category. tcpdump as well, though it seems to have been customized quite a bit, so the debug code should probably better be fixed.

Ah, that makes sense.

Avoid-warning-in-debug-code-for-media-server.patch: What's the warning and why does the patch fix it? Looks completely equivalent to me.

Fix-warnings-in-OpenSound-debug-code.patch: First part OK, the second part, just like the previous patch, I don't understand.

Right, these two were a bit subtle.

The warning was about an unused variable. Apparently these variables are only initialized in an "#ifdef DEBUG" block, but further down, they are only used in a TRACE() line... which I suppose may not always be enabled with DEBUG.

By moving the initialization below the definition, the "unused variable" warning seemed to go away. Is there a better suggestion?

Quick reference links:

http://cgit.haiku-os.org/haiku/tree/src/servers/media/NodeManager.cpp#n255

http://cgit.haiku-os.org/haiku/tree/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp#n562

in reply to:  16 comment:18 by umccullough, 12 years ago

Replying to bonefish:

Moreover coreutils and ctags fall into my 3rd party category.

FWIW, coreutils only seems to fail to link - and only on gcc2 at that, so perhaps this is something we should fix in our jamfiles instead... I don't even understand how DEBUG=1 affected this one based on my brief investigation.

by umccullough, 12 years ago

debug.c is required to compile ctags with DEBUG=1

by umccullough, 12 years ago

Allow ffmpeg sources to compile during debug build

by umccullough, 12 years ago

Allow libgutenprint sources to compile during debug build

by umccullough, 12 years ago

Fix debug build of libprint

in reply to:  16 comment:19 by mmadia, 12 years ago

Replying to bonefish:

Regarding the patches:

Fix-implicit-void-cast-in-usb_midi-debug-code.patch
Fix-warning-in-AutoMounter-debug-code.patch
Fix-warning-in-BSnow-debug-code.patch
Fix-bad-debug-print-in-canna.patch
Fix-various-issues-in-cortex-debug-code.patch
Fix-PDF-print-driver-debug-code.patch
Fix-another-mouse-preference-issue-specific-to-gcc4-.patch

Signed-off-by: Ingo Weinhold <ingo_weinhold@gmx.de>

These seven have been applied in hrev43566

PS: It would really be nice to have that "Apply Patch" button in Trac.

Maybe that could be a GSoC project idea? I'm barely finding the time to make meager progress with our BuildBot setup.

comment:20 by mmadia, 12 years ago

Fix-ASSERT-that-wasn-t-altered-back-in-hrev39770-all.patch applied in hrev43567

by umccullough, 12 years ago

Patch BuildSetup to disable DEBUG=1 support on subdirs with targets that won't compile as such

comment:21 by mmadia, 12 years ago

applied Disabled-DEBUG-1-in-several-of-the-3rd-party-ffmpeg-.patch and Disable-DEBUG-build-of-3rd-party-libgutenprint.patch in hrev43601

comment:22 by mmlr, 12 years ago

Similar patches applied in hrev43634 and hrev43635 applying/obsoleting Avoid-warning-in-debug-code-for-media-server.patch, Fix-warnings-in-OpenSound-debug-code.patch and Conditionally-add-debug.c-to-ctags-build.patch.

comment:23 by mmlr, 12 years ago

Applied Remaining-subdirs-that-cannot-be-compiled-with-DEBUG.patch in hrev43638. Leaving this ticket open as at least some of the blacklisted items should be fixed. Alternatively a new ticket could be opened for that though.

comment:24 by umccullough, 12 years ago

Resolution: fixed
Status: newclosed

I think we can just close this one and open another ticket (or tickets) for the other issues.

The "buildsystem" changes are now in place, and the debug images are building with buildbot now at least - which was the goal of this ticket.

Thanks!

comment:25 by mmadia, 12 years ago

patch: 10
Note: See TracTickets for help on using tickets.