purpleprotocol / mimalloc_rust

A Rust wrapper over Microsoft's MiMalloc memory allocator
MIT License
481 stars 42 forks source link

Update mimalloc to version 0.1.35 build fail #92

Closed Ted-Jiang closed 1 year ago

Ted-Jiang commented 1 year ago

Without changing the code , cargo build got:

The following warnings were emitted during compilation:

warning: In file included from c_src/mimalloc/src/prim/prim.c:22:0,
warning:                  from c_src/mimalloc/src/static.c:37:
warning: c_src/mimalloc/src/prim/unix/prim.c: In function '_mi_prim_reset':
warning: c_src/mimalloc/src/prim/unix/prim.c:394:33: error: 'csize' undeclared (first use in this function)
warning:    int err = unix_madvise(start, csize, MADV_DONTNEED);
warning:                                  ^
warning: c_src/mimalloc/src/prim/unix/prim.c:394:33: note: each undeclared identifier is reported only once for each function it appears in
warning: c_src/mimalloc/src/prim/unix/prim.c:382:40: warning: unused parameter 'size' [-Wunused-parameter]
warning:  int _mi_prim_reset(void* start, size_t size) {
warning:                                         ^

error: failed to run custom build command for `libmimalloc-sys v0.1.31`

Caused by:
  process didn't exit successfully: `/root/arrow-ballista/target/release/build/libmimalloc-sys-48dcf41eb41fe253/build-script-build` (exit status: 1)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  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")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "c_src/mimalloc/include" "-I" "c_src/mimalloc/src" "-Wall" "-Wextra" "-ftls-model=initial-exec" "-DMI_DEBUG=0" "-o" "/root/arrow-ballista/target/release/build/libmimalloc-sys-d003d53f5551b7b6/out/c_src/mimalloc/src/static.o" "-c" "c_src/mimalloc/src/static.c"
  cargo:warning=In file included from c_src/mimalloc/src/prim/prim.c:22:0,
  cargo:warning=                 from c_src/mimalloc/src/static.c:37:
  cargo:warning=c_src/mimalloc/src/prim/unix/prim.c: In function '_mi_prim_reset':
  cargo:warning=c_src/mimalloc/src/prim/unix/prim.c:394:33: error: 'csize' undeclared (first use in this function)
  cargo:warning=   int err = unix_madvise(start, csize, MADV_DONTNEED);
  cargo:warning=                                 ^
  cargo:warning=c_src/mimalloc/src/prim/unix/prim.c:394:33: note: each undeclared identifier is reported only once for each function it appears in
  cargo:warning=c_src/mimalloc/src/prim/unix/prim.c:382:40: warning: unused parameter 'size' [-Wunused-parameter]
  cargo:warning= int _mi_prim_reset(void* start, size_t size) {
  cargo:warning=                                        ^
  exit status: 1

  --- stderr

  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "c_src/mimalloc/include" "-I" "c_src/mimalloc/src" "-Wall" "-Wextra" "-ftls-model=initial-exec" "-DMI_DEBUG=0" "-o" "/root/arrow-ballista/target/release/build/libmimalloc-sys-d003d53f5551b7b6/out/c_src/mimalloc/src/static.o" "-c" "c_src/mimalloc/src/static.c" with args "cc" did not execute successfully (status code exit status: 1).

warning: build failed, waiting for other jobs to finish...
Build step 'Execute shell' marked build as failure
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Notifying upstream projects of job completion
Finished: FAILURE
Ted-Jiang commented 1 year ago

temporary fail back to 0.1.34

octavonce commented 1 year ago

@Ted-Jiang Yes, this is an upstream issue. Experienced something similar when cross-compiling for musl. Check out https://github.com/microsoft/mimalloc/issues/718. The author responded saying he will fix it today.

Ted-Jiang commented 1 year ago

@octavonce cool thanks man!

Keavon commented 1 year ago

Do we have to wait for a new version of this crate to be released, or are we waiting on some sub-dependency of this crate to update for the https://github.com/microsoft/mimalloc/issues/718 fix to become usable?

I'm trying to use cargo-about which depends on this crate, and so my builds are failing. mimalloc released the fixes in 1.8.1 and 2.1.1 today (eight hours ago) but my builds are still failing, but I don't know how those releases make their way into this crate (and finally into cargo-about).

NobodyXu commented 1 year ago

@Keavon libmimalloc-sys contains vendored libmalloc that is built in build.rs and included in mimalloc.

It just needs someone to update the git submodule.

octavonce commented 1 year ago

v0.1.36 is now released: https://github.com/purpleprotocol/mimalloc_rust/releases/tag/v0.1.36