Skip to content

Strange Makefile build error on tikv-jemalloc-sys 0.7.1 #167

Description

@orlp

We now get the following build error while trying to build tikv-jemalloc-sys:

--- stderr
  make[2]: *** No rule to make target 's'.  Stop.

  thread 'main' (47826) panicked at /home/ubuntu/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tikv-jemalloc-sys-0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8/build.rs:441:9:
  command did not execute successfully: cd "/home/ubuntu/polars/target/debug/build/tikv-jemalloc-sys-241a2b995cdbb770/out/build" && MAKEFLAGS="-j --jobserver-fds=8,9 --jobserver-auth=8,9 s" "make"
  expected success, got: exit status: 2
  note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

I have no idea the extra s ends up in

MAKEFLAGS="-j --jobserver-fds=8,9 --jobserver-auth=8,9 s"

I checked and as far as I can see we're not setting MAKEFLAGS anywhere.

Activity

  1. changed the title [-]Strange build error on tikv-jemalloc-sys 0.7.1[/-] [+]Strange Makefile build error on tikv-jemalloc-sys 0.7.1[/+] on Jun 11, 2026
  2. orlp commented on Jun 11, 2026

    @orlp
    Author

    The problem lies here:

    format!("{makeflags} {orig_makeflags}")

    This is not how you merge MAKEFLAGS. Make is very strange in that it will parse and mangle the command line options, turning single-character flags into a block at the start. Take a look at this Makefile:

    foo:
        echo $(MAKEFLAGS)
    

    If I now run:

    $ make -w -j 8 -k foo
    wk --jobserver-fds=3,4 -j
    

    Note how it combined the -w and -k options into just a string wk at the start?

    However if you now naively concatenate this with something which specified -k, you'd get:

    ws --jobserver-fds=3,4 -j k
    

    Now this might work with some versions of Make, but not GNU Make:

    $ MAKEFLAGS='-j16 s' make
    make: *** No rule to make target 's'.  Stop.
    $ make --v
    GNU Make 4.4.1
    Built for x86_64-pc-linux-gnu
    Copyright (C) 1988-2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
  3. jsf9k commented on Oct 28, 2026

    @jsf9k

    I am seeing something similar when trying to build aws/efs-utils on Debian 13 and 14, Kali, and Fedora 43 and 44:

    cd
      │   \"/tmp/efs-utils/src/target/release/build/tikv-jemalloc-sys-baddff26ebba3f77/out/build\"  │   && MAKEFLAGS=\" -- RUSTFLAGS=-C\\\\ linker=gcc-14 CXX=g++-14 CC=gcc-14 -j
      │   --jobserver-fds=3,11 --jobserver-auth=3,11\" \"make\"
    make[1]: Entering directory
      │   '/tmp/efs-utils/src/target/release/build/tikv-jemalloc-sys-baddff26ebba3f77/out/build'\n  │   make[1]: Leaving directory
      │   '/tmp/efs-utils/src/target/release/build/tikv-jemalloc-sys-baddff26ebba3f77/out/build'\n  │   \n  --- stderr\n  make[1]: *** No rule to make target '-j'.  Stop.\n\n  thread 'main'
      │   (15426) panicked at
      │   /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tikv-jemalloc-sys-0.6.1+5.3.0  │   -1-ge13ca993e8ccb9ba9847cc330696e02839f328f7/build.rs:411:9:\n  command did not execute
      │   successfully: cd
      │   \"/tmp/efs-utils/src/target/release/build/tikv-jemalloc-sys-baddff26ebba3f77/out/build\"  │   && MAKEFLAGS=\" -- RUSTFLAGS=-C\\\\ linker=gcc-14 CXX=g++-14 CC=gcc-14 -j
      │   --jobserver-fds=3,11 --jobserver-auth=3,11\" \"make\"\n  expected success, got: exit
      │   status: 2\n
  4. jsf9k commented on Oct 28, 2026

    @jsf9k

    I believe the issue is only happening with make>=4.4, since I am able to use the same code to successfully build on Debian 12 (which has make version 4.3). All the platforms listed here have make>=4.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions