tikv / jemallocator

Rust allocator using jemalloc as a backend
Other
347 stars 58 forks source link

Support for illumos #58

Open mtelka opened 1 year ago

mtelka commented 1 year ago

I'm trying to build ruff for OpenIndiana (an illumos distro) and the compilation fails while building tikv-jemalloc-sys:

error: failed to run custom build command for `tikv-jemalloc-sys v0.5.3+5.3.0-patched`

Caused by:
  process didn't exit successfully: `$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-67bcd31923eca60c/build-script-build` (exit status: 101)
  --- stdout
  TARGET=x86_64-unknown-illumos
  HOST=x86_64-unknown-illumos
  NUM_JOBS=6
  OUT_DIR="$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out"
  BUILD_DIR="$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out/build"
  SRC_DIR="$(BUILD_DIR)/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tikv-jemalloc-sys-0.5.3+5.3.0-patched"
  cargo:rustc-cfg=prefixed
  cargo:rerun-if-env-changed=JEMALLOC_OVERRIDE
  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-unknown-illumos")
  HOST = Some("x86_64-unknown-illumos")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-illumos
  CC_x86_64-unknown-illumos = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_illumos
  CC_x86_64_unknown_illumos = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/usr/gcc/10/bin/gcc")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-illumos
  CFLAGS_x86_64-unknown-illumos = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_illumos
  CFLAGS_x86_64_unknown_illumos = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("-m64 -O3 ")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  CC="/usr/gcc/10/bin/gcc"
  CFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -m64 -m64 -O3"
  JEMALLOC_REPO_DIR="jemalloc"
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_MALLOC_CONF
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_PAGE
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_HUGEPAGE
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_QUANTUM
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_VADDR
  --with-jemalloc-prefix=_rjem_
  running: cd "$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out/build" && CC="/usr/gcc/10/bin/gcc" CFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -m64 -m64 -O3" CPPFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -m64 -m64 -O3" LDFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -m64 -m64 -O3" "sh" "$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out/build/configure" "--disable-cxx" "--enable-doc=no" "--enable-shared=no" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--host=x86_64-unknown-illumos" "--build=x86_64-unknown-illumos" "--prefix=$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out"
  checking for xsltproc... /usr/bin/xsltproc
  checking for x86_64-unknown-illumos-gcc... /usr/gcc/10/bin/gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether /usr/gcc/10/bin/gcc accepts -g... yes
  checking for /usr/gcc/10/bin/gcc option to accept ISO C89... none needed
  checking whether compiler is cray... no
  checking whether compiler supports -std=gnu11... yes
  checking whether compiler supports -Werror=unknown-warning-option... no
  checking whether compiler supports -Wall... yes
  checking whether compiler supports -Wextra... yes
  checking whether compiler supports -Wshorten-64-to-32... no
  checking whether compiler supports -Wsign-compare... yes
  checking whether compiler supports -Wundef... yes
  checking whether compiler supports -Wno-format-zero-length... yes
  checking whether compiler supports -Wpointer-arith... yes
  checking whether compiler supports -Wno-missing-braces... yes
  checking whether compiler supports -Wno-missing-field-initializers... yes
  checking whether compiler supports -Wno-missing-attributes... yes
  checking whether compiler supports -pipe... yes
  checking whether compiler supports -g3... yes
  checking how to run the C preprocessor... /usr/gcc/10/bin/gcc -E
  checking for grep that handles long lines and -e... /usr/bin/ggrep
  checking for egrep... /usr/bin/ggrep -E
  checking for ANSI C header files... yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking whether byte ordering is bigendian... no
  checking size of void *... 8
  checking size of int... 4
  checking size of long... 8
  checking size of long long... 8
  checking size of intmax_t... 8
  checking build system type... running: "tail" "-n" "100" "$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out/build/config.log"
  dvidir='${docdir}'
  enable_autogen=''
  enable_cache_oblivious=''
  enable_cxx='0'
  enable_debug=''
  enable_doc='no'
  enable_experimental_smallocx=''
  enable_fill=''
  enable_initial_exec_tls=''
  enable_lazy_lock=''
  enable_log=''
  enable_opt_safety_checks=''
  enable_opt_size_checks=''
  enable_prof=''
  enable_readlinkat=''
  enable_shared='no'
  enable_static=''
  enable_stats=''
  enable_tls=''
  enable_uaf_detection=''
  enable_utrace=''
  enable_xmalloc=''
  enable_zone_allocator=''
  exe=''
  exec_prefix='$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out'
  host='x86_64-unknown-illumos'
  host_alias='x86_64-unknown-illumos'
  host_cpu=''
  host_os=''
  host_vendor=''
  htmldir='${docdir}'
  importlib=''
  includedir='${prefix}/include'
  infodir='${datarootdir}/info'
  install_suffix=''
  je_=''
  jemalloc_version=''
  jemalloc_version_bugfix=''
  jemalloc_version_gid=''
  jemalloc_version_major=''
  jemalloc_version_minor=''
  jemalloc_version_nrev=''
  libdir='${exec_prefix}/lib'
  libdl=''
  libexecdir='${exec_prefix}/libexec'
  libprefix=''
  link_whole_archive=''
  localedir='${datarootdir}/locale'
  localstatedir='${prefix}/var'
  mandir='${datarootdir}/man'
  o=''
  objroot=''
  oldincludedir='/usr/include'
  pdfdir='${docdir}'
  prefix='$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out'
  private_namespace=''
  program_transform_name='s,x,x,'
  psdir='${docdir}'
  rev='2'
  sbindir='${exec_prefix}/sbin'
  sharedstatedir='${prefix}/com'
  so=''
  srcroot=''
  sysconfdir='${prefix}/etc'
  target_alias=''

  ## ----------- ##
  ## confdefs.h. ##
  ## ----------- ##

  /* confdefs.h */
  #define PACKAGE_NAME ""
  #define PACKAGE_TARNAME ""
  #define PACKAGE_VERSION ""
  #define PACKAGE_STRING ""
  #define PACKAGE_BUGREPORT ""
  #define PACKAGE_URL ""
  #define JEMALLOC_HAS_RESTRICT
  #define STDC_HEADERS 1
  #define HAVE_SYS_TYPES_H 1
  #define HAVE_SYS_STAT_H 1
  #define HAVE_STDLIB_H 1
  #define HAVE_STRING_H 1
  #define HAVE_MEMORY_H 1
  #define HAVE_STRINGS_H 1
  #define HAVE_INTTYPES_H 1
  #define HAVE_STDINT_H 1
  #define HAVE_UNISTD_H 1
  #define SIZEOF_VOID_P 8
  #define LG_SIZEOF_PTR 3
  #define SIZEOF_INT 4
  #define LG_SIZEOF_INT 2
  #define SIZEOF_LONG 8
  #define LG_SIZEOF_LONG 3
  #define SIZEOF_LONG_LONG 8
  #define LG_SIZEOF_LONG_LONG 3
  #define SIZEOF_INTMAX_T 8
  #define LG_SIZEOF_INTMAX_T 3

  configure: exit 1

  --- stderr
  Invalid configuration `x86_64-unknown-illumos': OS `illumos' not recognized
  configure: error: /bin/sh build-aux/config.sub x86_64-unknown-illumos failed
  thread 'main' panicked at 'command did not execute successfully: cd "$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out/build" && CC="/usr/gcc/10/bin/gcc" CFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -m64 -m64 -O3" CPPFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -m64 -m64 -O3" LDFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -m64 -m64 -O3" "sh" "$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out/build/configure" "--disable-cxx" "--enable-doc=no" "--enable-shared=no" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--host=x86_64-unknown-illumos" "--build=x86_64-unknown-illumos" "--prefix=$(BUILD_DIR)/crates/ruff_cli/target/release/build/tikv-jemalloc-sys-95d70c5642729f87/out"
  expected success, got: exit status: 1', $(BUILD_DIR)/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tikv-jemalloc-sys-0.5.3+5.3.0-patched/build.rs:346:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
💥 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit status: 101": `"cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "$(BUILD_DIR)/crates/ruff_cli/Cargo.toml" "--release" "--bin" "ruff" "--" "-C" "link-arg=-s"`
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/bin/python3.7', '--compatibility', 'off'] returned non-zero exit status 1

ERROR Backend subprocess exited when trying to invoke build_wheel
BusyJay commented 1 year ago

Can you build jemalloc itself on illumos?

mtelka commented 1 year ago

Version 5.3.0 does not build, but latest dev github branch builds properly. I think this fixed the build for illumos: https://github.com/jemalloc/jemalloc/pull/2341