Bug 266721 - Mk/Uses/cmake.mk: Define -DNDEBUG when BUILD_TYPE is set to RELEASE
Summary: Mk/Uses/cmake.mk: Define -DNDEBUG when BUILD_TYPE is set to RELEASE
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Package Infrastructure (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Daniel Engberg
URL:
Keywords:
Depends on: 266842 266844 266849 266850 266852 266853
Blocks:
  Show dependency treegraph
 
Reported: 2022-09-30 11:07 UTC by Daniel Engberg
Modified: 2022-10-29 19:43 UTC (History)
0 users

See Also:
diizzy: exp-run?


Attachments
Patch for cmake.mk (813 bytes, patch)
2022-09-30 11:07 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2022-09-30 11:07:02 UTC
Created attachment 236966 [details]
Patch for cmake.mk

CMake defines -DNDEBUG when BUILD_TYPE is set to RELEASE by default however default flags gets dropped when CMAKE_C_FLAGS_RELEASE and CMAKE_CXX_FLAGS_RELEASE are (re)defined. This causes some projects to build with debugging by default which needs to be disabled manually if they do not set -DNDEBUG manually either in ports Makefile and/or in CMake's Makefile. To follow upstream add -DNDEBUG to our RELEASE flags.

Initially submitted as https://reviews.freebsd.org/D36695

I'd like to request an exp-run, thanks in advance!
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-10-05 16:34:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f3ed7c9f94dacceb527517733d31661743fc360d

commit f3ed7c9f94dacceb527517733d31661743fc360d
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-10-05 10:07:15 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-10-05 16:33:04 +0000

    math/cvc4: Mark BROKEN, doesn't build

    Fails with src/expr/expr_template.h:0: error: undefined replacement ${getConst_instantiations}
    on multiple platforms

    PR:             266721
    Reported by:    pkg-fallout

 math/cvc4/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-10-05 18:57:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1271f7aecc958c600e4a01c65896281521015ff0

commit 1271f7aecc958c600e4a01c65896281521015ff0
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-10-05 18:54:00 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-10-05 18:54:04 +0000

    net/astron: Disable compiler warnings as errors

    Defining -DNDEBUG requires -Werror to be disabled for port to build

    PR:             266721
    Reviewed by:    nc (maintainer)

 net/astron/files/patch-CMakeLists.txt | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-10-20 09:24:43 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7c2beee51d072ab185dd5186b2fd9d6eda4b7dfc

commit 7c2beee51d072ab185dd5186b2fd9d6eda4b7dfc
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-10-20 09:21:33 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-10-20 09:24:09 +0000

    benchmarks/netperfmeter: Fix build with -DNDEBUG defined

    Disable usage of OMNeT++ random generator when -DNDEBUG is defined

    PR:             266721
    Reported by:    antoine (via exp-run)
    Approved by:    portmgr (build fix)

 .../netperfmeter/files/patch-src_tools.cc (new)    | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-10-20 09:24:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e74014c897b3de44a201b304b24b2b36bcda8e0c

commit e74014c897b3de44a201b304b24b2b36bcda8e0c
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-10-20 09:12:37 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-10-20 09:24:09 +0000

    net/rsplib: Fix build with -DNDEBUG defined

    Disable usage of OMNeT++ random generator when -DNDEBUG is defined

    PR:             266721
    Reported by:    antoine (via exp-run)
    Approved by:    portmgr (build fix)

 net/rsplib/files/patch-src_randomizer.c (new) | 47 +++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-10-20 20:18:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4875cfa8c4ea9d906ea5c3367347b56065a68043

commit 4875cfa8c4ea9d906ea5c3367347b56065a68043
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-10-20 20:12:25 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-10-20 20:17:24 +0000

    games/avp: Mark BROKEN

    Mark this broken for now as it doesn't build with NDEBUG defined and
    there doesn't seem to be a simple fix around it

    PR:             266721
    Reported by:    antoine (via exp-run)
    Approved by:    portmgr (maintainer timeout, 2+ weeks via private mail)

 games/avp/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2022-10-20 20:20:38 UTC
Hi,

All reported failures should now be fixed in tree

Best regards,
Daniel
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2022-10-25 14:07:43 UTC
Friendly ping
Comment 10 Antoine Brodin freebsd_committer freebsd_triage 2022-10-28 08:49:34 UTC
New failure log:

http://package22.nyi.freebsd.org/data/131amd64-default-foo/2022-10-25_14h26m27s/logs/bareos-traymonitor-21.1.3_1.log

Once you fix it, no need for another exp-run as it is a leaf port
Comment 11 commit-hook freebsd_committer freebsd_triage 2022-10-29 19:39:42 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=68f60fd8f526820a7114064213613a0195c2708c

commit 68f60fd8f526820a7114064213613a0195c2708c
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-10-29 19:20:57 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-10-29 19:38:58 +0000

    sysutils/bareos-server: Disable -Werror flag in traymonitor

    When -DNDEBUG is defined -Werror needs to be disabled otherwise
    (leaf) port won't build

    This is the same fix as for client leaf port
    Commit: 15fd15478b93d0264ea9bd8af4acff12c2dbde95

    PR:             266721
    Reviewed by:    antoine (via exp-run)
    Approved by:    portmgr (blanket, build fix)

 sysutils/bareos-server/Makefile.common | 3 +++
 1 file changed, 3 insertions(+)
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-10-29 19:39:43 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3c5189a0fd4c82addfb659024bf28c5006bf88f7

commit 3c5189a0fd4c82addfb659024bf28c5006bf88f7
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-10-29 19:27:02 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-10-29 19:38:58 +0000

    Mk/Uses/cmake.mk: Define -DNDEBUG when BUILD_TYPE is set to RELEASE

    CMake defines -DNDEBUG when BUILD_TYPE is set to RELEASE by default
    however default flags gets dropped when CMAKE_C_FLAGS_RELEASE and
    CMAKE_CXX_FLAGS_RELEASE are (re)defined. This causes some projects
    to build with debugging by default which needs to be disabled
    by hand if they do not set -DNDEBUG manually either in ports
    Makefile and/or in CMake's Makefile. To follow upstream add
    -DNDEBUG to our RELEASE flags.

    PR:             266721
    Reviewed by:    arrowd
    Approved by:    portmgr (tcberner)
    Differential Revision:  https://reviews.freebsd.org/D36695
    Exp-run by:     antoine

 Mk/Uses/cmake.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 13 Daniel Engberg freebsd_committer freebsd_triage 2022-10-29 19:43:01 UTC
Thanks everyone and Antoine for the exp-runs :-)