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

3.13.1: PACKAGE_VERSION redefined #729

Closed
jengelh opened this issue Feb 7, 2023 · 5 comments
Closed

3.13.1: PACKAGE_VERSION redefined #729

jengelh opened this issue Feb 7, 2023 · 5 comments
Labels

Comments

@jengelh
Copy link

jengelh commented Feb 7, 2023

Forwarded from an openSUSE report:

FUSE 3.13.1 is breaking compilation in other packages, e.g. open-vm-tools (last-known-good 3.13.0):

gcc -DPACKAGE_NAME=\"open-vm-tools\" -DPACKAGE_TARNAME=\"open-vm-tools\" -DPACKAGE_VERSION=\"12.1.5\" -DPACKAGE_STRING=\"open-vm-tools\ 12.1.5\" -DPACKAGE_BUGREPORT=\"open-vm-tools-devel@lists.sourceforge.net\" -DPACKAGE_URL=\"\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1 -DSTDC_HEADERS=1 -DPACKAGE=\"open-vm-tools\" -DVERSION=\"12.1.5\" -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FUSE3=1 -DFUSE_USE_VERSION=35 -DHAVE_X11_SM_SMLIB_H=1 -DHAVE_X11_ICE_ICELIB_H=1 -DHAVE_X11_EXTENSIONS_XCOMPOSITE_H=1 -DHAVE_DLOPEN=1 -DHAVE_ECVT=1 -DHAVE_FCVT=1 -DNO_DNET=1 -DHAVE_CRYPT_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_WCHAR_H=1 -DHAVE_SYS_IO_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_SYSINFO_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_USER_H=1 -DHAVE_SYS_VFS_H=1 -DHAVE_UNWIND_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_STRUCT_STAT_ST_RDEV=1 -DTIME_WITH_SYS_TIME=1 -I.   -I/home/abuild/rpmbuild/BUILD/open-vm-tools-12.1.5/open-vm-tools/lib/include -I/home/abuild/rpmbuild/BUILD/open-vm-tools-12.1.5/open-vm-tools/lib/include  -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS -DUSE_VGAUTH  -DNO_ICU -DVMX86_TOOLS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -DENABLE_RESOLUTIONKMS -Dvmblock_fuse -U_XOPEN_SOURCE -D_XOPEN_SOURCE=600 -DUSERLEVEL -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse3  -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I../modules/shared/vmblock -I. -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -Wno-unused-local-typedefs -Wno-unused-but-set-variable -Wno-deprecated-declarations -Wno-sizeof-pointer-memaccess -Wno-cpp -fPIE -Wall -Werror -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-but-set-variable -c -o fsops.o fsops.c
[  309s] In file included from /usr/include/fuse3/fuse_common.h:17,
[  309s]                  from /usr/include/fuse3/fuse.h:19,
[  309s]                  from fsops.h:46,
[  309s]                  from fsops.c:39:
[  309s] /usr/include/fuse3/fuse_config.h:42: error: "PACKAGE_VERSION" redefined [-Werror]
[  309s]    42 | #define PACKAGE_VERSION "3.13.1"
[  309s]       | 
[  309s] <command-line>: note: this is the location of the previous definition
[  309s] cc1: all warnings being treated as errors
[  309s] make[1]: *** [Makefile:582: fsops.o] Error 1

PACKAGE_VERSION (and basically anything from config.h) should never be leaked directly into public APIs.

@jengelh
Copy link
Author

jengelh commented Feb 7, 2023

The way to fix this is have, in essence, two config.h. One with all the private HAVEs, and one with the curated exported and properly namespaces HAVEs, i.e. change HAVE_LIBC_VERSIONED_SYMBOLS to something like LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS.

bsbernd added a commit to bsbernd/libfuse that referenced this issue Feb 7, 2023
This addresses libfuse#729

commit db35a37 introduced a public
config.h (rename to fuse_config.h to avoid conflicts) that
was installed with the package and included by libfuse users
through fuse_common.h. Probablem is that this file does not have
unique defines so that they are unique to libfuse - on including
the file conflicts with libfuse users came up.

In principle all defines could be prefixed, but then most of them
are internal for libfuse compilation only. So this splits out
publically required defines to a new file 'libfuse_config.h'
and changes back to include of "fuse_config.h" only when
HAVE_LIBFUSE_PRIVATE_CONFIG_H is defined.
bsbernd added a commit to bsbernd/libfuse that referenced this issue Feb 7, 2023
This addresses libfuse#729

commit db35a37 introduced a public
config.h (rename to fuse_config.h to avoid conflicts) that
was installed with the package and included by libfuse users
through fuse_common.h. Probablem is that this file does not have
unique defines so that they are unique to libfuse - on including
the file conflicts with libfuse users came up.

In principle all defines could be prefixed, but then most of them
are internal for libfuse compilation only. So this splits out
publically required defines to a new file 'libfuse_config.h'
and changes back to include of "fuse_config.h" only when
HAVE_LIBFUSE_PRIVATE_CONFIG_H is defined.

This also renames HAVE_LIBC_VERSIONED_SYMBOLS to
LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS, as it actually
better explains for libfuse users what that variable
is for.
@bsbernd
Copy link
Collaborator

bsbernd commented Feb 7, 2023

Uh oh, sorry, yes, I could have expected this :( I just pushed a patch, but I first need to review it myself and need to think, if that could break anything.

Nikratio pushed a commit that referenced this issue Feb 9, 2023
This addresses #729

commit db35a37 introduced a public
config.h (rename to fuse_config.h to avoid conflicts) that
was installed with the package and included by libfuse users
through fuse_common.h. Probablem is that this file does not have
unique defines so that they are unique to libfuse - on including
the file conflicts with libfuse users came up.

In principle all defines could be prefixed, but then most of them
are internal for libfuse compilation only. So this splits out
publically required defines to a new file 'libfuse_config.h'
and changes back to include of "fuse_config.h" only when
HAVE_LIBFUSE_PRIVATE_CONFIG_H is defined.

This also renames HAVE_LIBC_VERSIONED_SYMBOLS to
LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS, as it actually
better explains for libfuse users what that variable
is for.
@Nikratio
Copy link
Contributor

@jengelh Thanks for reporting this! Bernd, thank you for the quick patch!

Jan, would you be able to confirm that current git head is working correctly?

@Nikratio Nikratio added the bug label Feb 10, 2023
@jengelh
Copy link
Author

jengelh commented Feb 10, 2023

open-vm-tools build succeeds now.

@Nikratio
Copy link
Contributor

Okay, thanks for testing! Will release another version now.

bsbernd added a commit to bsbernd/libfuse that referenced this issue Feb 19, 2023
This addresses libfuse#729

commit db35a37 introduced a public
config.h (rename to fuse_config.h to avoid conflicts) that
was installed with the package and included by libfuse users
through fuse_common.h. Probablem is that this file does not have
unique defines so that they are unique to libfuse - on including
the file conflicts with libfuse users came up.

In principle all defines could be prefixed, but then most of them
are internal for libfuse compilation only. So this splits out
publically required defines to a new file 'libfuse_config.h'
and changes back to include of "fuse_config.h" only when
HAVE_LIBFUSE_PRIVATE_CONFIG_H is defined.

This also renames HAVE_LIBC_VERSIONED_SYMBOLS to
LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS, as it actually
better explains for libfuse users what that variable
is for.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants