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

FreeBSD Build fails: build sets invalid option '-Wno-nan-infinity-disabled' [-Werror,-Wunknown-warning-option] #7754

Closed
yurivict opened this issue Aug 13, 2024 · 13 comments
Labels
Bug Report Item submitted using the Bug Report template

Comments

@yurivict
Copy link

yurivict commented Aug 13, 2024

Bug Description:
See the log.

Surge XT Version

  • Version:
    1.3.2
    1.3.4

Reproduction Steps:
Regular build.

Expected Behavior:
A clear and concise description of what you expected to happen.

Screenshots:
If applicable, add screenshots/GIF/videos to help explain your problem.

Computer Information (please complete the following!):

  • OS: FreeBSD 14.1, FreeBSD 15-CURRENT
  • clang-18

Additional Information:
I think that the unknown warning -Wno-nan-infinity-disabled from some of the dependencies is elevated to the error status by the -Werror option that you set.

@yurivict yurivict added the Bug Report Item submitted using the Bug Report template label Aug 13, 2024
@baconpaul
Copy link
Collaborator

Link to #7730

looks like we don’t work with clang 18 yup

@yurivict
Copy link
Author

Actually I would like to correct my original post.

The problem occurs with clang-16.
clang-18 fixed the problem.

nan-infinity-disabled isn't known to the earlier clang which is elevated to error by -Werror.

@baconpaul
Copy link
Collaborator

Hmm

paul ~/dev/music/surge (release-xt/1.3.4) % grep -r "infinity-disabled" cmake libs src CMakeLists.txt scripts 
paul ~/dev/music/surge (release-xt/1.3.4) % 

I can't find where we set that. Is your build process changing flags somewhere? or have you changed the source of some of the libraries?

@baconpaul
Copy link
Collaborator

baconpaul commented Aug 13, 2024

Yeah i looked in your log. At the top is this


--MAKE_ENV--
NINJA_STATUS="[%p %s/%t] " XDG_DATA_HOME=/wrkdirs/usr/ports/audio/surge-synthesizer-xt-lv2/work  XDG_CONFIG_HOME=/wrkdirs/usr/ports/audio/surge-synthesizer-xt-lv2/work  XDG_CACHE_HOME=/wrkdirs/usr/ports/audio/surge-synthesizer-xt-lv2/work/.cache  HOME=/wrkdirs/usr/ports/audio/surge-synthesizer-xt-lv2/work TMPDIR="/tmp" PATH=/wrkdirs/usr/ports/audio/surge-synthesizer-xt-lv2/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin PKG_CONFIG_LIBDIR=/wrkdirs/usr/ports/audio/surge-synthesizer-xt-lv2/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES DESTDIR=/wrkdirs/usr/ports/audio/surge-synthesizer-xt-lv2/work/stage PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -Wno-nan-infinity-disabled -O3 -ffast-math -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-isystem /usr/local/include"  LDFLAGS=" -fstack-protector-strong -L/usr/local/lib " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -Wno-nan-infinity-disabled -O3 -ffast-math -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DPLUGIN_API="" -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -Dstrnicmp16=strncasecmp -O3 -ffast-math -isystem /usr/local/include " BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444"
--End MAKE_ENV--

with the relevant section being

CFLAGS="-O2 -pipe  -Wno-nan-infinity-disabled  ...

so it is definitely the case that if you set -Wno-nan-infinity-disabled and then use a compiler that doesn't support it with a package that compilers with Werror on, it will fail, because you've configured it in an error state I guess.

Where does that segment come from? It's not me though so nothing to be done here I don't think!

@yurivict
Copy link
Author

I couldn't find -Wno-nan-infinity-disabled either, but it appears after configure is done.
Some dependency adds it, but I couldn't track down which one.

In order to isolate from such issues, it's best to disable -Werror in production builds.
Some projects use cmake option for this, like ${PROJECT_NAME}_USE_WERROR.

@yurivict
Copy link
Author

NINJA is used to build it by the ports framework.
It doesn't add any -Wxx arguments.

@baconpaul
Copy link
Collaborator

The -Wno.... is in your log that you shared so it is definitely being added by your build system.

I guess I could add a skip werror flag sure when i'm next in the cmake. but really the solution is to not add arbitrary build flags to the build!

@baconpaul baconpaul changed the title Build fails: error: unknown warning option '-Wno-nan-infinity-disabled' [-Werror,-Wunknown-warning-option] FreeBSD Build fails: build sets invalid option '-Wno-nan-infinity-disabled' [-Werror,-Wunknown-warning-option] Aug 13, 2024
@baconpaul
Copy link
Collaborator

Oh or just add Wno-unknown-warning-option to the warnings we bypass I guess (and I suppose you could do the same in your eng to patch now).

seems like there’s two things

  1. if clang version is 18 surge needs to add the no man Infinity flag thing which would fix 7730
  2. If build type is released add the no unknown warning thing if the compiler is clang any version

and that should do it right?

@yurivict
Copy link
Author

Ah, yes ....
Sorry, I didn't notice the obvious.

-Wno-nan-infinity-disabled' was added to mitigate this bug: #7730

@baconpaul
Copy link
Collaborator

Right. So where you added that perhaps also add -Wno-unknown-warning-option and then this one will be fixed until we fix 7730? See what I mean

@yurivict
Copy link
Author

Yes, that's what I am doing.

@mkruselj mkruselj added this to the Surge XT 1.4.0 milestone Aug 17, 2024
@mkruselj
Copy link
Collaborator

@yurivict Does this mean we can close this issue then?

@yurivict
Copy link
Author

Ok, thanks.

@yurivict yurivict closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Item submitted using the Bug Report template
Projects
None yet
Development

No branches or pull requests

3 participants