Bug 193481 - emulators/open-vm-tools does not compile on some systems because of undefined DIRSEPS
Summary: emulators/open-vm-tools does not compile on some systems because of undefined...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-09 10:47 UTC by Thomas Schweikle
Modified: 2017-08-12 20:37 UTC (History)
6 users (show)

See Also:
mva: maintainer-feedback? (swills)


Attachments
patch-libvmtools__i18n.c (884 bytes, text/x-csrc)
2016-02-19 07:19 UTC, w.schwarzenfeld
no flags Details
patch-libvmtools__i18n.c (884 bytes, patch)
2016-02-19 07:25 UTC, w.schwarzenfeld
no flags Details | Diff
poudriere-open-vm-tools-nox11-1280544_12,1.log (862.52 KB, text/plain)
2016-02-19 07:38 UTC, w.schwarzenfeld
no flags Details
open-vm-tools-nox11_build.log (635.42 KB, text/plain)
2017-02-28 19:39 UTC, Walter Schwarzenfeld
no flags Details
svn-diff-open-vm-tools (3.57 KB, patch)
2017-04-24 05:26 UTC, Walter Schwarzenfeld
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schweikle 2014-09-09 10:47:01 UTC
Install open-vm-tools-nox11 fails with compile errors at function Util_SafeStrdup(), because of undefined identifiers: DIRSEPS.

This was fixed some time ago, now it is there again (regression?).

it doesn't matter if it is a new install or an upgrade to an existing system:

# pkg info -d emulators/open-vm-tools-nox11
open-vm-tools-nox11-1280544_7,1:
        libdnet-1.12
        pcre-8.35
        libnotify-0.7.5_1
        icu-53.1
        glib-2.36.3_4
# pkg delete -f open-vm-tools-nox11 libdnet pcre libnotify icu glib
# portinstall open-vm-tools-nox11
[...]
--- libvmtools_la-signalSource.lo ---
libtool: compile:  cc -DPACKAGE_NAME=\"open-vm-tools\" -DPACKAGE_TARNAME=\"open-vm-tools\" -DPACKAGE_VERSION=\"9.4.0\" "-DPACKAGE_STRING=\"open-vm-tools 9.4.0\"" -DPACKAGE_BUGREPORT=\"open-vm-tools-devel@lists.sourceforge.net\" -DPACKAGE_URL=\"\" -DPACKAGE=\"open-vm-tools\" -DVERSION=\"9.4.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DX_DISPLAY_MISSING=1 -DHAVE_DLOPEN=1 -DNO_PROCPS=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_WCHAR_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_USER_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_STRUCT_STAT_ST_RDEV=1 -DTIME_WITH_SYS_TIME=1 -DNO_XSM=1 -DNO_XCOMPOSITE=1 -DNO_MULTIMON=1 -I. -DVMTOOLS_USE_GLIB -DNO_LOG_STUB -DVMTOOLS_DATA_DIR=\"/usr/local/share/open-vm-tools\" -I/usr/local/include/glib-2.0 -I/usr/local/include -I/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544/lib/include -I/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544/lib/include -Wno-deprecated-declarations -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS -I/usr/local/include -I/usr/local/include -DUSE_ICU -DHAVE_ICU_38 -DVMX86_TOOLS -O2 -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused-function -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing -Wno-unknown-pragmas -Wno-uninitialized -MT libvmtools_la-signalSource.lo -MD -MP -MF .deps/libvmtools_la-signalSource.Tpo -c signalSource.c -o libvmtools_la-signalSource.o >/dev/null 2>&1
--- libvmtools_la-i18n.lo ---
i18n.c:634:15: error: implicit declaration of function 'Unicode_IsBufferValid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
         if (!Unicode_IsBufferValid(name, strlen(name) + 1, STRING_ENCODING_UTF8) ||
              ^
i18n.c:740:17: error: implicit declaration of function 'Util_SafeStrdup' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      dfltdir = Util_SafeStrdup(VMTOOLS_DATA_DIR);
                ^
i18n.c:740:15: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Werror,-Wint-conversion]
      dfltdir = Util_SafeStrdup(VMTOOLS_DATA_DIR);
              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
i18n.c:748:35: error: use of undeclared identifier 'DIRSEPS'
                          catdir, DIRSEPS, DIRSEPS, lang, DIRSEPS, domain);
                                  ^
i18n.c:758:21: error: incompatible integer to pointer conversion assigning to 'gchar *' (aka 'char *') from 'int' [-Werror,-Wint-conversion]
            usrlang = Util_SafeStrdup(lang);
                    ^ ~~~~~~~~~~~~~~~~~~~~~
i18n.c:763:41: error: use of undeclared identifier 'DIRSEPS'
                                catdir, DIRSEPS, DIRSEPS, usrlang, DIRSEPS, domain);
                                        ^
6 errors generated.
*** [libvmtools_la-i18n.lo] Error code 1

make[2]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544/libvmtools
--- libvmtools_la-monotonicTimer.lo ---
mv -f .deps/libvmtools_la-monotonicTimer.Tpo .deps/libvmtools_la-monotonicTimer.Plo
--- libvmtools_la-vmtools.lo ---
mv -f .deps/libvmtools_la-vmtools.Tpo .deps/libvmtools_la-vmtools.Plo
--- libvmtools_la-signalSource.lo ---
mv -f .deps/libvmtools_la-signalSource.Tpo .deps/libvmtools_la-signalSource.Plo
1 error

make[2]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544/libvmtools
*** [all-recursive] Error code 1

make[1]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544
1 error

make[1]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-9.4.0-1280544
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/emulators/open-vm-tools-nox11
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portinstall20140909-97059-1yreipz env make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! emulators/open-vm-tools-nox11 (unknown build error)

# pkg info open-vm-tools-nox11 libdnet pcre libnotify icu glib
pkg: No package(s) matching open-vm-tools-nox11
libdnet-1.12
pcre-8.35
libnotify-0.7.5_1
icu-53.1
glib-2.36.3_4
Comment 1 Thomas Schweikle 2014-09-09 10:55:49 UTC
Related errors: 191339
Comment 2 Thomas Schweikle 2014-09-09 12:31:25 UTC
function "Unicode_IsBufferValid" seems never defined too.
Comment 3 Marcus von Appen freebsd_committer freebsd_triage 2014-09-17 20:34:00 UTC
Over to maintainer
Comment 4 Martin Wilke freebsd_committer freebsd_triage 2016-01-17 15:19:43 UTC
Hi,

Is the reported problem still present with the current ports tree?
Comment 5 w.schwarzenfeld 2016-02-19 05:51:54 UTC
I try it with clang and gcc49 on 10.2-RELEASE amd64 both ended with the same failure as above.
Comment 6 w.schwarzenfeld 2016-02-19 06:16:54 UTC
Unicode_IsBufferValid is declared in lib/unicode/unicodeSimpleBase.c which is not included in work/open-vm-tools-9.4.0-1280544/libvmtools.
Comment 7 w.schwarzenfeld 2016-02-19 06:19:36 UTC
There was something wrong in the clipboard

.. is declared in lib/include/unicodeBase.h which is not included in work/open-vm-tools-9.4.0-1280544/libvmtools/i18n.c.
Comment 8 w.schwarzenfeld 2016-02-19 06:26:11 UTC
And DIRSEPS:
/modules/freebsd/vmhgfs/fsutil.h:#define DIRSEPS "/"
Comment 9 w.schwarzenfeld 2016-02-19 07:19:39 UTC
Created attachment 167168 [details]
patch-libvmtools__i18n.c
Comment 10 w.schwarzenfeld 2016-02-19 07:21:40 UTC
The patch should copied in the MASTERPORt emulators/open-vm-tools.
Comment 11 w.schwarzenfeld 2016-02-19 07:25:11 UTC
Created attachment 167169 [details]
patch-libvmtools__i18n.c

There was a typo in it.
Comment 12 w.schwarzenfeld 2016-02-19 07:38:16 UTC
Created attachment 167170 [details]
poudriere-open-vm-tools-nox11-1280544_12,1.log
Comment 13 w.schwarzenfeld 2016-02-19 08:53:06 UTC
Btw, there is a newer version 10.0.5 https://sourceforge.net/projects/open-vm-tools/files/
Comment 14 Steve Wills freebsd_committer freebsd_triage 2017-02-27 23:25:42 UTC
Hi,

Can you please test the patch in PR 212471 and see if that still exhibits the same issue?
Comment 15 Walter Schwarzenfeld freebsd_triage 2017-02-28 02:32:55 UTC
There is something wrong with the patches. I could not test it.
Comment 16 Walter Schwarzenfeld freebsd_triage 2017-02-28 03:23:09 UTC
After I make your patch, nearly all patches from files directory are
rejected.
Comment 17 Steve Wills freebsd_committer freebsd_triage 2017-02-28 13:32:00 UTC
(In reply to w.schwarzenfeld from comment #16)
Thanks for trying. Perhaps you need to remove the old files (.orig) and empty files (several) from the files dir. SVN has a tendency to leave those, which patch chokes on.
Comment 18 Walter Schwarzenfeld freebsd_triage 2017-02-28 15:34:04 UTC
I have tried this yesterday (to remove before "make" remove the .orig
files).
e.g.
===>  Extracting for open-vm-tools-10.1.0,2
=> SHA256 Checksum OK for open-vm-tools-10.1.0-4449150.tar.gz.
===>  Patching for open-vm-tools-10.1.0,2
===>  Applying FreeBSD patches for open-vm-tools-10.1.0,2
  I can't seem to find a patch in there anywhere.
=> FreeBSD patch patch-base64rename failed to apply cleanly.
*** Error code 1
Comment 19 Steve Wills freebsd_committer freebsd_triage 2017-02-28 15:38:05 UTC
(In reply to w.schwarzenfeld from comment #18)
The patch-base64rename is one of the patches that was deleted, so it ends up as an empty patch file that confuses the patch command. Run this:

find /usr/ports/emulators/open-vm-tools -type f -empty -delete

and then try again please.

Steve
Comment 20 Walter Schwarzenfeld freebsd_triage 2017-02-28 16:16:52 UTC
configure: error: C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu).
===>  Script "configure" failed unexpectedly.
Please report the problem to swills@FreeBSD.org [maintainer] and attach the
"/ram/usr/ports/emulators/open-vm-tools/work/open-vm-tools-10.1.0-4449150/open-vm-tools/config.log"
including the output of the failure of your make command. Also, it might be
a good idea to provide an overview of all packages installed on your system
(e.g. a /usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1
Comment 21 Walter Schwarzenfeld freebsd_triage 2017-02-28 16:31:35 UTC
Sorry was CCACHE, but:
mv -f .deps/util.Tpo .deps/util.Plo
1 error

make[4]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-10.1.0-4449150/open-vm-tools/lib/user
*** [all-recursive] Error code 1

make[3]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-10.1.0-4449150/open-vm-tools/lib
1 error

make[3]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-10.1.0-4449150/open-vm-tools/lib
*** [all-recursive] Error code 1

make[2]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-10.1.0-4449150/open-vm-tools
1 error

make[2]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-10.1.0-4449150/open-vm-tools
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/emulators/open-vm-tools-nox11
*** Error code 1

Stop.
Comment 22 Walter Schwarzenfeld freebsd_triage 2017-02-28 16:35:06 UTC
The error was few lines above

utilBacktrace.c:155:20: error: implicit declaration of function '_Unwind_GetCFA' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   uintptr_t cfa = _Unwind_GetCFA(ctx);
                   ^
utilBacktrace.c:357:4: error: implicit declaration of function '_Unwind_Backtrace' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   _Unwind_Backtrace(UtilBacktraceFromPointerCallback, &data);
   ^
utilBacktrace.c:357:4: note: did you mean 'Util_Backtrace'?
/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-10.1.0-4449150/open-vm-tools/lib/include/util.h:130:6: note: 'Util_Backtrace' declared here
void Util_Backtrace(int bugNr);
     ^
2 errors generated.
*** [utilBacktrace.lo] Error code 1

make[4]: stopped in /usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-10.1.0-4449150/open-vm-tools/lib/user
Comment 23 Steve Wills freebsd_committer freebsd_triage 2017-02-28 19:20:35 UTC
(In reply to w.schwarzenfeld from comment #22)
What version of FreeBSD are you using?
Comment 24 Walter Schwarzenfeld freebsd_triage 2017-02-28 19:22:30 UTC
10.3-RELEASE-amd64-p17.
Comment 25 Steve Wills freebsd_committer freebsd_triage 2017-02-28 19:28:50 UTC
(In reply to w.schwarzenfeld from comment #24)
I can't reproduce that error. I'll send you the full log on my side, can you send my your full log?
Comment 26 Walter Schwarzenfeld freebsd_triage 2017-02-28 19:39:53 UTC
Created attachment 180368 [details]
open-vm-tools-nox11_build.log
Comment 27 Walter Schwarzenfeld freebsd_triage 2017-02-28 20:07:32 UTC
Seems I am not the only:
Found this -
https://lists.freebsd.org/pipermail/freebsd-virtualization/2017-January/005186.html
Comment 28 Steve Wills freebsd_committer freebsd_triage 2017-02-28 21:45:30 UTC
(In reply to w.schwarzenfeld from comment #27)
Do you have the libunwind package installed and if so, does the error go away if you uninstall it?
Comment 29 Walter Schwarzenfeld freebsd_triage 2017-02-28 22:07:50 UTC
Deinstalled libunwind.

Now it works, thanks.
Comment 30 John Wolfe 2017-03-01 16:25:06 UTC
The configure script is checks for the presence of the unwind.h header but does not check for the visibility of the needed unwind APIs.   Those declaration are there, but bracketed by an "#ifdef _GNU_SOURCE" which means that all GCC language and runtime extensions are supported.

I have filed a PR with VMware Tools to:
  - enhance the usability testing on the unwind.h header
  - provide a configure option disable/bypass use of libunwind
Comment 31 Walter Schwarzenfeld freebsd_triage 2017-04-24 05:26:51 UTC
Created attachment 182032 [details]
svn-diff-open-vm-tools
Comment 32 w.schwarzenfeld 2017-04-24 05:32:14 UTC
If I am right, the svn-diff should solve the problems.
Comment 33 Walter Schwarzenfeld freebsd_triage 2017-04-24 15:24:02 UTC
Obsolete patch. Fix is included update Bug 217485.
Comment 34 Steve Wills freebsd_committer freebsd_triage 2017-08-12 20:37:25 UTC
This was fixed in r444773.