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

[TESTING/WIP] ci/coverage: Test proxy-wasm-cpp-sdk PR#157 #32432

Closed

Conversation

martijneken
Copy link

Test proxy-wasm/proxy-wasm-cpp-sdk#157

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Martijn Stevenson <mstevenson@google.com>
Signed-off-by: Martijn Stevenson <mstevenson@google.com>
Signed-off-by: Martijn Stevenson <mstevenson@google.com>
Copy link

Hi @martijneken, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #32432 was opened by martijneken.

see: more, trace.

Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #32432 was opened by martijneken.

see: more, trace.

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Feb 16, 2024
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @mattklein123

🐱

Caused by: #32432 was opened by martijneken.

see: more, trace.

@martijneken
Copy link
Author

precheck error:

[Precheck (pr/32432/main@e573f89) / deps / ./ci/do_ci.sh deps](https://github.com/envoyproxy/envoy/actions/runs/7925291985/job/21638225574#step:8:983)
DependencyChecker ERROR [release_dates] Mismatch: emsdk 2022-08-29 != 2023-08-29

arm64 build error:

ERROR: /build/bazel_root/base/external/nodejs/BUILD.bazel:5:6: no such target '@nodejs_linux_arm64//:run_npm.bat.template': target 'run_npm.bat.template' not declared in package '' defined by /build/bazel_root/base/external/nodejs_linux_arm64/BUILD.bazel (did you mean 'run_npm.template'? Tip: use `query "@nodejs_linux_arm64//:*"` to see all the targets in that package) and referenced by '@nodejs//:run_npm.bat.template'
ERROR: Evaluation of query "deps((//contrib/exe/... union //distribution/... union //source/exe/... union @com_github_google_quiche//:ci_tests union @nodejs//... union //test/...))" failed: preloading transitive closure failed: no such target '@nodejs_linux_arm64//:run_npm.bat.template': target 'run_npm.bat.template' not declared in package '' defined by /build/bazel_root/base/external/nodejs_linux_arm64/BUILD.bazel (did you mean 'run_npm.template'? Tip: use `query "@nodejs_linux_arm64//:*"` to see all the targets in that package)
Fetch failed
##[error]Bash exited with code '1'.

Signed-off-by: Martijn Stevenson <mstevenson@google.com>
@martijneken
Copy link
Author

martijneken commented Feb 16, 2024

The issue is that Envoy CI does a full fetch and dependency check on @nodejs//...:

envoy/ci/do_ci.sh

Lines 33 to 39 in 49425f5

# TODO(phlax): add this as a general cache
# this fetches a bit too much for some of the targets
# but its not really possible to filter their needs so move
# to a shared precache
FETCH_TEST_TARGETS=(
@nodejs//...
//test/...)

But @nodejs//... is broken, here and in emsdk at HEAD:

$ bazelisk query "deps((@nodejs//...))"
ERROR: /usr/local/google/home/mstevenson/.cache/bazel/_bazel_mstevenson/a70324d31864af234fcb5ca19cc454c8/external/nodejs/BUILD.bazel:4:6: no such target '@nodejs_linux_amd64//:run_npm.sh.template': target 'run_npm.sh.template' not declared in package '' defined by /usr/local/google/home/mstevenson/.cache/bazel/_bazel_mstevenson/a70324d31864af234fcb5ca19cc454c8/external/nodejs_linux_amd64/BUILD.bazel (did you mean 'run_npm.template'? Tip: use `query "@nodejs_linux_amd64//:*"` to see all the targets in that package) and referenced by '@nodejs//:run_npm.sh.template'
ERROR: Evaluation of query "deps(@nodejs//...)" failed: preloading transitive closure failed: no such target '@nodejs_linux_amd64//:run_npm.sh.template': target 'run_npm.sh.template' not declared in package '' defined by /usr/local/google/home/mstevenson/.cache/bazel/_bazel_mstevenson/a70324d31864af234fcb5ca19cc454c8/external/nodejs_linux_amd64/BUILD.bazel (did you mean 'run_npm.template'? Tip: use `query "@nodejs_linux_amd64//:*"` to see all the targets in that package)

I suspect the emsdk update in this PR also picked up a nodejs update, e.g. via this commit:
emscripten-core/emsdk@d7327b4

@phlax: can you give advice on how to proceed?

@martijneken
Copy link
Author

@phlax Friendly ping on #32432 (comment)

Envoy expects all of @nodejs//... to build, but that doesn't seem true in an updated version of NodeJS (16.20.0), which doesn't contain these files/targets:
https://github.com/bazelbuild/rules_nodejs/blob/5af115dac3c59cb69f63a25f745eeceac11b21a2/nodejs/private/nodejs_repo_host_os_alias.bzl#L11-L13

Can we narrow the scope of the Envoy CI check?

@phlax
Copy link
Member

phlax commented Feb 21, 2024

The issue is that Envoy CI does a full fetch and dependency check on @nodejs//... ... Can we narrow the scope of the Envoy CI check?

the fetch is not a "check" - its fetching what is required by the check (in a way that is retriable)

this likely fetches more than it should (and perhaps not all that it requires) - but was added ~naively as without this, pulling in the nodejs toolchain tends to be very flakey

the check itself (as in the build tests) need to stay the same but we can certainly adjust this if we can figure out something that is reliable (which is kinda hard to test)

for testing/wip purposes just comment out or remove that line and lets see if that is the only blocker

But @nodejs//... is broken, here and in emsdk at HEAD ... e.g. via this commit:

the problem is introduced here:

emscripten-core/emsdk@5b80c10

Signed-off-by: Martijn Stevenson <mstevenson@google.com>
@martijneken
Copy link
Author

martijneken commented Feb 28, 2024

This uncovered a clang/zlib compatibility issue. Looks like emscripten became stricter:
emscripten-core/emscripten@524ab1f

Also seen/patched here: https://gerrit.libreoffice.org/c/core/+/160554

I am not able to repro locally. Theories:

@martijneken
Copy link
Author

This seems to be an intersection between emscripten and zlib so adding @walkingeyerobot for advice.

2024-02-21T16:05:18.1831978Z �[31m�[1mERROR: �[0m/build/bazel_root/base/external/envoy/bazel/foreign_cc/BUILD:555:12: Foreign Cc - CMake: Building zlib failed: (Exit 1): bash failed: error executing command (from target @envoy//bazel/foreign_cc:zlib) 
2024-02-21T16:05:18.1835309Z   (cd /build/bazel_root/base/execroot/envoy && \
2024-02-21T16:05:18.1836074Z   exec env - \
2024-02-21T16:05:18.1836564Z     BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \
2024-02-21T16:05:18.1837554Z     BAZEL_FAKE_SCM_REVISION=e3b4a6e9570da15ac1caffdded17a8bebdc7dfc9 \
2024-02-21T16:05:18.1838694Z     BAZEL_LINKLIBS=-l%:libstdc++.a \
2024-02-21T16:05:18.1839251Z     BAZEL_LINKOPTS=-lm \
2024-02-21T16:05:18.1839951Z     CC=clang \
2024-02-21T16:05:18.1840262Z     CXX=clang++ \
2024-02-21T16:05:18.1840732Z     CXXFLAGS='-stdlib=libc++' \
2024-02-21T16:05:18.1841337Z     ENVOY_TSAN=1 \
2024-02-21T16:05:18.1842011Z     LDFLAGS='-stdlib=libc++' \
2024-02-21T16:05:18.1842695Z     PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin \
2024-02-21T16:05:18.1844273Z   /bin/bash -c bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib_foreign_cc/wrapper_build_script.sh)
2024-02-21T16:05:18.1845976Z # Configuration: 12a31c8f76a1a9f7c97cd2d0c574fe512df34afe101dac13ada5b4114b019e4d
2024-02-21T16:05:18.1847202Z # Execution platform: @envoy_build_tools//toolchains:rbe_linux_clang_libcxx_platform
2024-02-21T16:05:18.1848017Z rules_foreign_cc: Build failed!
2024-02-21T16:05:18.1848606Z rules_foreign_cc: Keeping temp build directory and dependencies directory for debug.
2024-02-21T16:05:18.1849951Z rules_foreign_cc: Please note that the directories inside a sandbox are still cleaned unless you specify --sandbox_debug Bazel command line flag.
2024-02-21T16:05:18.1852089Z rules_foreign_cc: Printing build logs:
2024-02-21T16:05:18.1852757Z _____ BEGIN BUILD LOGS _____
2024-02-21T16:05:18.1853168Z 
2024-02-21T16:05:18.1853648Z Bazel external C/C++ Rules. Building library zlib
2024-02-21T16:05:18.1854187Z 
2024-02-21T16:05:18.1854710Z Environment:______________
2024-02-21T16:05:18.1856233Z BUILD_SCRIPT=bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib_foreign_cc/build_script.sh
2024-02-21T16:05:18.1857692Z HOSTNAME=b7b9db313296
2024-02-21T16:05:18.1861188Z EXT_BUILD_ROOT=/b/f/w
2024-02-21T16:05:18.1863071Z BUILD_LOG=bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib_foreign_cc/CMake.log
2024-02-21T16:05:18.1864947Z HOST_INPUT_ROOT=/b/f/w
2024-02-21T16:05:18.1865509Z PWD=/b/f/w
2024-02-21T16:05:18.1865924Z CXX=clang++
2024-02-21T16:05:18.1866552Z CXXFLAGS=-stdlib=libc++
2024-02-21T16:05:18.1867288Z LDFLAGS=-stdlib=libc++
2024-02-21T16:05:18.1867859Z HOME=/home/nobody
2024-02-21T16:05:18.1868474Z LANG=en_US.utf8
2024-02-21T16:05:18.1870161Z BUILD_WRAPPER_SCRIPT=bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib_foreign_cc/wrapper_build_script.sh
2024-02-21T16:05:18.1872103Z BAZEL_LINKOPTS=-lm
2024-02-21T16:05:18.1873554Z EXT_BUILD_DEPS=/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib.ext_build_deps
2024-02-21T16:05:18.1875267Z BAZEL_FAKE_SCM_REVISION=e3b4a6e9570da15ac1caffdded17a8bebdc7dfc9
2024-02-21T16:05:18.1876222Z BAZEL_LINKLIBS=-l%:libstdc++.a
2024-02-21T16:05:18.1877610Z BUILD_TMPDIR=/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib.build_tmpdir
2024-02-21T16:05:18.1879093Z SHLVL=2
2024-02-21T16:05:18.1879550Z BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
2024-02-21T16:05:18.1880506Z EM_CONFIG_PATH=external/emsdk/emscripten_toolchain/emscripten_config
2024-02-21T16:05:18.1881805Z HOST_NETWORK_NAME=network-name-dont-hardcode-use-HOST_NETWORK_NAME-env-var
2024-02-21T16:05:18.1882808Z EM_BIN_PATH=external/emscripten_bin_linux
2024-02-21T16:05:18.1884034Z HOST_CONTAINER_NAME=rbe-container-1d6e70a2-ec88-438a-8db2-930653c7ea5e
2024-02-21T16:05:18.1884948Z ENVOY_TSAN=1
2024-02-21T16:05:18.1886056Z INSTALLDIR=/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib
2024-02-21T16:05:18.1887473Z PATH=/b/f/w:/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin
2024-02-21T16:05:18.1888198Z CC=clang
2024-02-21T16:05:18.1888609Z EMCC_WASM_BACKEND=1
2024-02-21T16:05:18.1889074Z _=/usr/bin/env
2024-02-21T16:05:18.1889526Z __________________________
2024-02-21T16:05:18.1904624Z + /b/f/w/external/cmake-3.23.2-linux-x86_64/bin/cmake -DCMAKE_AR=/b/f/w/external/emsdk/emscripten_toolchain/emar.sh '-DCMAKE_CXX_LINK_EXECUTABLE=/b/f/w/external/emsdk/emscripten_toolchain/emcc_link.sh <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>' '-DCMAKE_SHARED_LINKER_FLAGS=--sysroot=/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot -fdiagnostics-color -fno-strict-aliasing -funsigned-char -no-canonical-prefixes -s PRINTF_LONG_DOUBLE=1 --oformat=js -g -O0 -shared -sSTANDALONE_WASM' '-DCMAKE_EXE_LINKER_FLAGS=--sysroot=/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot -fdiagnostics-color -fno-strict-aliasing -funsigned-char -no-canonical-prefixes -s PRINTF_LONG_DOUBLE=1 --oformat=js -g -O0 -sSTANDALONE_WASM' -DCMAKE_CXX_COMPILER_FORCED=on -DCMAKE_C_COMPILER_FORCED=on -DSKIP_BUILD_EXAMPLES=on -DBUILD_SHARED_LIBS=off -DZLIB_COMPAT=on -DZLIB_ENABLE_TESTS=off -DWITH_OPTIM=on -DWITH_SSE4=off -DWITH_NEW_STRATEGIES=off -DUNALIGNED_OK=off -DCMAKE_BUILD_TYPE=Bazel -DCMAKE_INSTALL_PREFIX=/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib -DCMAKE_PREFIX_PATH=/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib.ext_build_deps -DCMAKE_RANLIB= -DCMAKE_MAKE_PROGRAM=/b/f/w/external/ninja_1.11.0_linux/ninja -G Ninja /b/f/w/external/net_zlib
2024-02-21T16:05:18.1919316Z CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
2024-02-21T16:05:18.1920618Z   Compatibility with CMake < 2.8.12 will be removed from a future version of
2024-02-21T16:05:18.1921567Z   CMake.
2024-02-21T16:05:18.1921832Z 
2024-02-21T16:05:18.1922499Z   Update the VERSION argument <min> value or use a ...<max> suffix to tell
2024-02-21T16:05:18.1923691Z   CMake that the project does not need compatibility with older versions.
2024-02-21T16:05:18.1924523Z 
2024-02-21T16:05:18.1924746Z 
2024-02-21T16:05:18.1925775Z -- The C compiler identification is Clang 17.0.0
2024-02-21T16:05:18.1926741Z -- Looking for sys/types.h
2024-02-21T16:05:18.1927393Z -- Looking for sys/types.h - not found
2024-02-21T16:05:18.1928105Z -- Looking for stdint.h
2024-02-21T16:05:18.1928708Z -- Looking for stdint.h - not found
2024-02-21T16:05:18.1929383Z -- Looking for stddef.h
2024-02-21T16:05:18.1930145Z -- Looking for stddef.h - not found
2024-02-21T16:05:18.1930905Z -- Check size of off64_t
2024-02-21T16:05:18.1931794Z -- Check size of off64_t - failed
2024-02-21T16:05:18.1932480Z -- Looking for fseeko
2024-02-21T16:05:18.1933026Z -- Looking for fseeko - not found
2024-02-21T16:05:18.1933775Z -- Looking for unistd.h
2024-02-21T16:05:18.1934615Z -- Looking for unistd.h - not found
2024-02-21T16:05:18.1935365Z -- Renaming
2024-02-21T16:05:18.1936145Z --     /b/f/w/external/net_zlib/zconf.h
2024-02-21T16:05:18.1937324Z -- to 'zconf.h.included' because this file is included with zlib
2024-02-21T16:05:18.1938811Z -- but CMake generates it automatically in the build directory.
2024-02-21T16:05:18.1940061Z -- Configuring done
2024-02-21T16:05:18.1940719Z -- Generating done
2024-02-21T16:05:18.1941310Z CMake Warning:
2024-02-21T16:05:18.1942418Z   Manually-specified variables were not used by the project:
2024-02-21T16:05:18.1943270Z 
2024-02-21T16:05:18.1943781Z     CMAKE_CXX_COMPILER_FORCED
2024-02-21T16:05:18.1944452Z     CMAKE_CXX_LINK_EXECUTABLE
2024-02-21T16:05:18.1945087Z     UNALIGNED_OK
2024-02-21T16:05:18.1945740Z     WITH_NEW_STRATEGIES
2024-02-21T16:05:18.1946361Z     WITH_OPTIM
2024-02-21T16:05:18.1947031Z     WITH_SSE4
2024-02-21T16:05:18.1947564Z     ZLIB_COMPAT
2024-02-21T16:05:18.1948091Z     ZLIB_ENABLE_TESTS
2024-02-21T16:05:18.1948467Z 
2024-02-21T16:05:18.1948709Z 
2024-02-21T16:05:18.1950343Z -- Build files have been written to: /b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib.build_tmpdir
2024-02-21T16:05:18.1953017Z + /b/f/w/external/cmake-3.23.2-linux-x86_64/bin/cmake --build . --config Debug
2024-02-21T16:05:18.1954494Z [1/16] Building C object CMakeFiles/zlib.dir/compress.o
2024-02-21T16:05:18.1955485Z [2/16] Building C object CMakeFiles/zlib.dir/crc32.o
2024-02-21T16:05:18.1956431Z [3/16] Building C object CMakeFiles/zlib.dir/adler32.o
2024-02-21T16:05:18.1957413Z [4/16] Building C object CMakeFiles/zlib.dir/gzclose.o
2024-02-21T16:05:18.1958355Z [5/16] Building C object CMakeFiles/zlib.dir/gzlib.o
2024-02-21T16:05:18.1959398Z FAILED: CMakeFiles/zlib.dir/gzlib.o 
2024-02-21T16:05:18.1969953Z /b/f/w/external/emsdk/emscripten_toolchain/emcc.sh -DNO_FSEEKO -I/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib.build_tmpdir -I/b/f/w/external/net_zlib --sysroot=/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot -fdiagnostics-color -fno-strict-aliasing -funsigned-char -no-canonical-prefixes -fno-omit-frame-pointer -g -O0 -Wall -iwithsysroot/include/c++/v1 -iwithsysroot/include/compat -iwithsysroot/include -isystem /b/f/w/external/emscripten_bin_linux/lib/clang/18/include -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -Werror -O3 -DSTANDALONE_WASM -Wno-deprecated-non-prototype -fexceptions -MD -MT CMakeFiles/zlib.dir/gzlib.o -MF CMakeFiles/zlib.dir/gzlib.o.d -o CMakeFiles/zlib.dir/gzlib.o -c /b/f/w/external/net_zlib/gzlib.c
2024-02-21T16:05:18.1980907Z /b/f/w/external/net_zlib/gzlib.c:254:9: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2024-02-21T16:05:18.1983755Z   254 |         LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
2024-02-21T16:05:18.1984920Z       |         ^
2024-02-21T16:05:18.1985758Z /b/f/w/external/net_zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
2024-02-21T16:05:18.1986594Z    14 | #  define LSEEK lseek
2024-02-21T16:05:18.1987168Z       |                 ^
2024-02-21T16:05:18.1987965Z /b/f/w/external/net_zlib/gzlib.c:254:9: note: did you mean 'fseek'?
2024-02-21T16:05:18.1989120Z /b/f/w/external/net_zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
2024-02-21T16:05:18.1989946Z    14 | #  define LSEEK lseek
2024-02-21T16:05:18.1990389Z       |                 ^
2024-02-21T16:05:18.1991628Z /b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot/include/stdio.h:92:5: note: 'fseek' declared here
2024-02-21T16:05:18.1993021Z    92 | int fseek(FILE *, long, int);
2024-02-21T16:05:18.1993528Z       |     ^
2024-02-21T16:05:18.1995343Z /b/f/w/external/net_zlib/gzlib.c:260:24: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2024-02-21T16:05:18.1997197Z   260 |         state->start = LSEEK(state->fd, 0, SEEK_CUR);
2024-02-21T16:05:18.1997815Z       |                        ^
2024-02-21T16:05:18.1998621Z /b/f/w/external/net_zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
2024-02-21T16:05:18.1999428Z    14 | #  define LSEEK lseek
2024-02-21T16:05:18.1999856Z       |                 ^
2024-02-21T16:05:18.2001507Z /b/f/w/external/net_zlib/gzlib.c:361:9: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2024-02-21T16:05:18.2003453Z   361 |     if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
2024-02-21T16:05:18.2004087Z       |         ^
2024-02-21T16:05:18.2004806Z /b/f/w/external/net_zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
2024-02-21T16:05:18.2005615Z    14 | #  define LSEEK lseek
2024-02-21T16:05:18.2006099Z       |                 ^
2024-02-21T16:05:18.2007766Z /b/f/w/external/net_zlib/gzlib.c:402:15: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2024-02-21T16:05:18.2009732Z   402 |         ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
2024-02-21T16:05:18.2010671Z       |               ^
2024-02-21T16:05:18.2011505Z /b/f/w/external/net_zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
2024-02-21T16:05:18.2012462Z    14 | #  define LSEEK lseek
2024-02-21T16:05:18.2012881Z       |                 ^
2024-02-21T16:05:18.2014681Z /b/f/w/external/net_zlib/gzlib.c:498:14: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2024-02-21T16:05:18.2017105Z   498 |     offset = LSEEK(state->fd, 0, SEEK_CUR);
2024-02-21T16:05:18.2017939Z       |              ^
2024-02-21T16:05:18.2018904Z /b/f/w/external/net_zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
2024-02-21T16:05:18.2019838Z    14 | #  define LSEEK lseek
2024-02-21T16:05:18.2020297Z       |                 ^
2024-02-21T16:05:18.2020678Z 5 errors generated.
2024-02-21T16:05:18.2029940Z emcc: error: '/b/f/w/external/emscripten_bin_linux/bin/clang -target wasm32-unknown-emscripten -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -Werror=implicit-function-declaration --sysroot=/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -DNO_FSEEKO -I/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib.build_tmpdir -I/b/f/w/external/net_zlib --sysroot=/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot -fdiagnostics-color -fno-strict-aliasing -funsigned-char -no-canonical-prefixes -fno-omit-frame-pointer -g3 -O0 -Wall -iwithsysroot/include/c++/v1 -iwithsysroot/include/compat -iwithsysroot/include -isystem /b/f/w/external/emscripten_bin_linux/lib/clang/18/include -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -Werror -O3 -DSTANDALONE_WASM -Wno-deprecated-non-prototype -fexceptions -MD -MT CMakeFiles/zlib.dir/gzlib.o -MF CMakeFiles/zlib.dir/gzlib.o.d -c /b/f/w/external/net_zlib/gzlib.c -o CMakeFiles/zlib.dir/gzlib.o' failed (returned 1)
2024-02-21T16:05:18.2038919Z [6/16] Building C object CMakeFiles/zlib.dir/gzread.o
2024-02-21T16:05:18.2039498Z FAILED: CMakeFiles/zlib.dir/gzread.o 
2024-02-21T16:05:18.2045544Z /b/f/w/external/emsdk/emscripten_toolchain/emcc.sh -DNO_FSEEKO -I/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib.build_tmpdir -I/b/f/w/external/net_zlib --sysroot=/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot -fdiagnostics-color -fno-strict-aliasing -funsigned-char -no-canonical-prefixes -fno-omit-frame-pointer -g -O0 -Wall -iwithsysroot/include/c++/v1 -iwithsysroot/include/compat -iwithsysroot/include -isystem /b/f/w/external/emscripten_bin_linux/lib/clang/18/include -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -Werror -O3 -DSTANDALONE_WASM -Wno-deprecated-non-prototype -fexceptions -MD -MT CMakeFiles/zlib.dir/gzread.o -MF CMakeFiles/zlib.dir/gzread.o.d -o CMakeFiles/zlib.dir/gzread.o -c /b/f/w/external/net_zlib/gzread.c
2024-02-21T16:05:18.2054153Z /b/f/w/external/net_zlib/gzread.c:35:15: error: call to undeclared function 'read'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2024-02-21T16:05:18.2056807Z    35 |         ret = read(state->fd, buf + *have, get);
2024-02-21T16:05:18.2057614Z       |               ^
2024-02-21T16:05:18.2058685Z /b/f/w/external/net_zlib/gzread.c:35:15: note: did you mean 'fread'?
2024-02-21T16:05:18.2060542Z /b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot/include/stdio.h:99:8: note: 'fread' declared here
2024-02-21T16:05:18.2062376Z    99 | size_t fread(void *__restrict, size_t, size_t, FILE *__restrict);
2024-02-21T16:05:18.2063333Z       |        ^
2024-02-21T16:05:18.2065260Z /b/f/w/external/net_zlib/gzread.c:647:11: error: call to undeclared function 'close'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2024-02-21T16:05:18.2067633Z   647 |     ret = close(state->fd);
2024-02-21T16:05:18.2068319Z       |           ^
2024-02-21T16:05:18.2068812Z 2 errors generated.
2024-02-21T16:05:18.2084441Z emcc: error: '/b/f/w/external/emscripten_bin_linux/bin/clang -target wasm32-unknown-emscripten -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -Werror=implicit-function-declaration --sysroot=/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -DNO_FSEEKO -I/b/f/w/bazel-out/wasm-dbg-ST-fab3e889cc10/bin/external/envoy/bazel/foreign_cc/zlib.build_tmpdir -I/b/f/w/external/net_zlib --sysroot=/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot -fdiagnostics-color -fno-strict-aliasing -funsigned-char -no-canonical-prefixes -fno-omit-frame-pointer -g3 -O0 -Wall -iwithsysroot/include/c++/v1 -iwithsysroot/include/compat -iwithsysroot/include -isystem /b/f/w/external/emscripten_bin_linux/lib/clang/18/include -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -Werror -O3 -DSTANDALONE_WASM -Wno-deprecated-non-prototype -fexceptions -MD -MT CMakeFiles/zlib.dir/gzread.o -MF CMakeFiles/zlib.dir/gzread.o.d -c /b/f/w/external/net_zlib/gzread.c -o CMakeFiles/zlib.dir/gzread.o' failed (returned 1)
2024-02-21T16:05:18.2118901Z [7/16] Building C object CMakeFiles/zlib.dir/deflate.o
2024-02-21T16:05:18.2119677Z ninja: build stopped: subcommand failed.
2024-02-21T16:05:18.2120361Z _____ END BUILD LOGS _____

@walkingeyerobot
Copy link

lseek comes from libc and it's something that emscripten certainly provides. Looking a bit further up in the logs, a number of libc-related headers weren't detected during a configure (i.e. sys/types.h). The compiler tries to be helpful and offers this:

/b/f/w/external/emscripten_bin_linux/emscripten/cache/sysroot/include/stdio.h:92:5: note: 'fseek' declared here

So it does know about the emscripten sysroot and it can see at least some libc-related files in there. This makes me suspect something wrong with how CMake is being invoked.

If this was working before, you could try to figure out a way to pass -Wno-implicit-function-declaration to the zlib build. I don't recommend this as this error is likely indicative of a bad sysroot, but on the other hand, it might work.

Looking back at some of the comments here, I see @nodejs// mentioned as something that's broken. Is that where the zlib dep is coming from?

cc @trybka

Copy link

github-actions bot commented Apr 5, 2024

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Apr 5, 2024
Copy link

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps Approval required for changes to Envoy's external dependencies stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants