Skip to content

Instantly share code, notes, and snippets.

@veggiemonk
Created March 19, 2020 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veggiemonk/6141cec6e908560d8ccd932c85dc26a5 to your computer and use it in GitHub Desktop.
Save veggiemonk/6141cec6e908560d8ccd932c85dc26a5 to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main(void){
printf("Hello world\n");
return 0;
}
==> Caveats
zlib is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
error: failed to run custom build command for `libz-sys v1.0.25`
Caused by:
process didn't exit successfully: `/Users/julien/code/rust/starship/target/debug/build/libz-sys-42a4bb72600da88a/build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
cargo:rerun-if-changed=build.rs
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
running "cc" "src/smoke.c" "-o" "/dev/null" "-lz"
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/julien/code/rust/starship/target/debug/build/libz-sys-fd27be55bdb5100e/out/build/src/zlib/compress.o" "-c" "src/zlib/compress.c"
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/julien/code/rust/starship/target/debug/build/libz-sys-fd27be55bdb5100e/out/build/src/zlib/adler32.o" "-c" "src/zlib/adler32.c"
cargo:warning=In file included from src/zlib/compress.c:9:
cargo:warning=In file included from src/zlib/zlib.h:34:
cargo:warning=src/zlib/zconf.h:444:14: fatal error: 'sys/types.h' file not found
cargo:warning=# include <sys/types.h> /* for off_t */
cargo:warning= ^~~~~~~~~~~~~
cargo:warning=1 error generated.
cargo:warning=In file included from src/zlib/adler32.c:8:
cargo:warning=In file included from src/zlib/zutil.h:22:
cargo:warning=In file included from src/zlib/zlib.h:34:
cargo:warning=src/zlib/zconf.h:444:14: fatal error: 'sys/types.h' file not found
cargo:warning=# include <sys/types.h> /* for off_t */
cargo:warning= ^~~~~~~~~~~~~
exit code: 1
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/julien/code/rust/starship/target/debug/build/libz-sys-fd27be55bdb5100e/out/build/src/zlib/crc32.o" "-c" "src/zlib/crc32.c"
cargo:warning=1 error generated.
exit code: 1
cargo:warning=In file included from src/zlib/crc32.c:31:
cargo:warning=In file included from src/zlib/zutil.h:22:
cargo:warning=In file included from src/zlib/zlib.h:34:
cargo:warning=src/zlib/zconf.h:444:14: fatal error: 'sys/types.h' file not found
cargo:warning=# include <sys/types.h> /* for off_t */
cargo:warning= ^~~~~~~~~~~~~
cargo:warning=1 error generated.
exit code: 1
--- stderr
src/smoke.c:1:10: fatal error: 'zlib.h' file not found
#include <zlib.h>
^~~~~~~~
1 error generated.
error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/julien/code/rust/starship/target/debug/build/libz-sys-fd27be55bdb5100e/out/build/src/zlib/adler32.o" "-c" "src/zlib/adler32.c" with args "cc" did not execute successfully (status code exit code: 1).
warning: build failed, waiting for other jobs to finish...
error: build failed
cc a.c -o a
a.c:1:9: fatal error: 'stdio.h' file not found
#include<stdio.h>
^~~~~~~~~
1 error generated.
make: *** [a] Error 1
❯ npm install
> fsevents@1.2.11 install /Users/julien/code/awesome-docker/node_modules/fsevents
> node-gyp rebuild
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:53:
In file included from /Users/julien/Library/Caches/node-gyp/12.16.1/include/node/uv.h:52:
In file included from /Users/julien/Library/Caches/node-gyp/12.16.1/include/node/uv/errno.h:25:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/errno.h:32:15: fatal error: 'errno.h' file not found
#include_next <errno.h>
^~~~~~~~~
1 error generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/julien/.fnm/node-versions/v12.16.1/installation/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/Users/julien/.fnm/node-versions/v12.16.1/installation/bin/node" "/Users/julien/.fnm/node-versions/v12.16.1/installation/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/julien/code/awesome-docker/node_modules/fsevents
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
audited 9680 packages in 7.655s
31 packages are looking for funding
run `npm fund` for details
found 10 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
export CPATH="$(xcrun --show-sdk-path)/usr/include" # bash, zsh
# or fish shell
set -x CPATH (xcrun --show-sdk-path)/usr/include
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment