chef / chef-workstation

Chef Workstation gives you everything you need to get started with Chef, so you can automate how you audit, configure, and manage applications end environments.
Apache License 2.0
134 stars 112 forks source link

Build errors when building git-custom-bindir on MacOS 10.15+ (x86-64) #1633

Open ramereth opened 3 years ago

ramereth commented 3 years ago

Description

When building chef-workstation via omnibus on MacOS 11.0, I'm running into the following error (Full build log can be found here):

NOTE: This doesn't doesn't seem to be a problem with building 10.15 or 10.14.

[Software: git-custom-bindir] I | 2021-01-06T17:13:14+00:00 | Building because `preparation' dirtied the cache
[NetFetcher: git-custom-bindir] I | 2021-01-06T17:13:14+00:00 | Cleaning project directory `/var/cache/omnibus/src/git-custom-bindir'
[NetFetcher: git-custom-bindir] I | 2021-01-06T17:13:14+00:00 | Extracting `/Users/omnibus/builds/PsBhNr49/0/cinc-project/distribution/workstation/cache/git-2.29.2.tar.gz' to `/var/cache/omnibus/src/git-custom-bindir'
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 | Starting build
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 | Environment:
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   CFLAGS="-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   CPPFLAGS="-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   CXXFLAGS="-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   LDFLAGS="-Wl,-rpath,/opt/cinc-workstation/embedded/lib -L/opt/cinc-workstation/embedded/lib"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   LD_RUN_PATH="/opt/cinc-workstation/embedded/lib"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   MAKE="gmake"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   OMNIBUS_INSTALL_DIR="/opt/cinc-workstation"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   PATH="/opt/cinc-workstation/bin:/opt/cinc-workstation/embedded/bin:/Users/omnibus/builds/PsBhNr49/0/cinc-project/distribution/workstation/bundle/vendor/ruby/2.6.0/bin:/opt/omnibus-toolchain/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 |   PKG_CONFIG_PATH="/opt/cinc-workstation/embedded/lib/pkgconfig"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:15+00:00 | $ gmake distclean
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 | Execute: `gmake distclean': 4.1749s
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 | Rendering `/Users/omnibus/builds/PsBhNr49/0/cinc-project/distribution/workstation/chef-workstation/omnibus/config/templates/git-custom-bindir/config.mak.erb' to `/var/cache/omnibus/src/git-custom-bindir/git-2.29.2/config.mak'
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 | Render erb `config.mak.erb': 0.0018s
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 | Environment:
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   CFLAGS="-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   CPPFLAGS="-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   CXXFLAGS="-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   LDFLAGS="-Wl,-rpath,/opt/cinc-workstation/embedded/lib -L/opt/cinc-workstation/embedded/lib"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   LD_RUN_PATH="/opt/cinc-workstation/embedded/lib"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   MAKE="gmake"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   OMNIBUS_INSTALL_DIR="/opt/cinc-workstation"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   PATH="/opt/cinc-workstation/bin:/opt/cinc-workstation/embedded/bin:/Users/omnibus/builds/PsBhNr49/0/cinc-project/distribution/workstation/bundle/vendor/ruby/2.6.0/bin:/opt/omnibus-toolchain/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 |   PKG_CONFIG_PATH="/opt/cinc-workstation/embedded/lib/pkgconfig"
[Builder: git-custom-bindir] I | 2021-01-06T17:13:19+00:00 | $ gmake prefix=/opt/cinc-workstation/embedded bindir=/opt/cinc-workstation/gitbin -j 10
[Builder: git-custom-bindir] I | 2021-01-06T17:13:38+00:00 | Execute: `gmake prefix=/opt/cinc-workstation/embedded bindir=/opt/cinc-workstation/gitbin -j 10': 18.9921s
[Builder: git-custom-bindir] I | 2021-01-06T17:13:38+00:00 | Build git-custom-bindir: 23.1732s
The following shell command exited with status 2:
    $ CFLAGS=-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector CPPFLAGS=-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector CXXFLAGS=-I/opt/cinc-workstation/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector LDFLAGS=-Wl,-rpath,/opt/cinc-workstation/embedded/lib -L/opt/cinc-workstation/embedded/lib LD_RUN_PATH=/opt/cinc-workstation/embedded/lib MAKE=gmake OMNIBUS_INSTALL_DIR=/opt/cinc-workstation PATH=/opt/cinc-workstation/bin:/opt/cinc-workstation/embedded/bin:/Users/omnibus/builds/PsBhNr49/0/cinc-project/distribution/workstation/bundle/vendor/ruby/2.6.0/bin:/opt/omnibus-toolchain/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin PKG_CONFIG_PATH=/opt/cinc-workstation/embedded/lib/pkgconfig gmake prefix=/opt/cinc-workstation/embedded bindir=/opt/cinc-workstation/gitbin -j 10

<snip>

Error:
    GIT_VERSION = 2.29.2
    * new build flags
    * new link flags
    * new prefix flags
    * new script parameters
builtin/archive.c:48:24: error: implicit declaration of function 'archive_format_from_filename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                const char *format = archive_format_from_filename(name_hint);
                                     ^
builtin/archive.c:48:24: note: did you mean 'archive_read_open_filename'?
/opt/cinc-workstation/embedded/include/archive.h:527:15: note: 'archive_read_open_filename' declared here
__LA_DECL int archive_read_open_filename(struct archive *,
              ^
builtin/archive.c:48:15: warning: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
                const char *format = archive_format_from_filename(name_hint);
                            ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
builtin/archive.c:101:2: error: implicit declaration of function 'init_archivers' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        init_archivers();
        ^
builtin/archive.c:111:9: error: implicit declaration of function 'write_archive' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return write_archive(argc, argv, prefix, the_repository, output, 0);
               ^
builtin/archive.c:111:9: note: did you mean 'write_or_die'?
./cache.h:1821:6: note: 'write_or_die' declared here
void write_or_die(int fd, const void *buf, size_t count);
     ^
1 warning and 3 errors generated.
gmake: *** [Makefile:2433: builtin/archive.o] Error 1
gmake: *** Waiting for unfinished jobs....

Some other relevant build environment information:

========================================
= Tool Versions
========================================
Bash.........GNU bash, version 5.0.0(1)-release (x86_64-apple-darwin17.7.0)
Bundler......Bundler version 2.1.4
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
GCC..........Apple clang version 12.0.0 (clang-1200.0.32.28)
Git..........git version 2.28.0
Make.........GNU Make 4.2.1
Ruby.........ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin17]
RubyGems.....3.1.4
========================================
ramereth commented 3 years ago

FWIW I've tried the following:

  1. Tried building using libarchive-3.5.1
  2. Tried using git-2.30.0 (both with libarchive 3.5.0 and 3.5.1)

I suspect this is an upstream issue related to the Apple clang 12.x compiler being extra picky about c99 warnings. If I build git without using libarchive and using the system includes, it builds without issue on MacOS 11. I didn't see any upstream issues opened for either libarchive or git.

vkarve-chef commented 3 years ago

this commit likely resolved the issue. now facing error with libgecode.

tas50 commented 2 years ago

I've updated this issue. This is a problem with macOS 10.15 now that we've removed our 10.14 builders.

here's an ad-hoc where I updated git to the very latest release to see if this problem was resolved.

https://buildkite.com/chef/chef-chef-workstation-main-omnibus-adhoc/builds/699#c3001032-fd85-4570-9b6d-7ff4dba2ff9f/6-7