ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "k0kubun (Takashi Kokubun) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "k0kubun (Takashi Kokubun)" <noreply@ruby-lang.org>
Subject: [ruby-core:118085] [Ruby master Bug#20500] Non-system directories are not searched when checking for jemalloc headers and libs, and building `enc`
Date: Wed, 29 May 2024 23:53:50 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-108512.20240529235350.53336@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-20500.20240521155348.53336@ruby-lang.org>

Issue #20500 has been updated by k0kubun (Takashi Kokubun).

Backport changed from 3.1: UNKNOWN, 3.2: REQUIRED, 3.3: REQUIRED to 3.1: UNKNOWN, 3.2: REQUIRED, 3.3: DONE

ruby_3_3 commit:a96233161a0e917b57c3c2cd9598d75d8b7721f5 merged revision(s) commit:5fa6ba9568e87e43e08a4daeba1572254c589fb1.

----------------------------------------
Bug #20500: Non-system directories are not searched when checking for jemalloc headers and libs, and building `enc`
https://bugs.ruby-lang.org/issues/20500#change-108512

* Author: lish82 (Hiroki Katagiri)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
* Backport: 3.1: UNKNOWN, 3.2: REQUIRED, 3.3: DONE
----------------------------------------
I found a problem similar to #20494 on jemalloc
It's similar to #20494, but it has a few more issues

Problems:

- Non-system directories (specified by `--with-opt-dir`) are not searched when checking jemalloc headers (almost the same as #20494)
- Non-system directories are not searched when checking jemalloc libs
- Non-system directories are not searched when building the `enc` directory sources

I have confirmed that this problem can be fixed by applying the following patch:

```patch
diff --git a/configure.ac b/configure.ac
index 169662c..b2dce70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1392,6 +1392,8 @@ AC_ARG_WITH([jemalloc],
   [with_jemalloc=$withval], [with_jemalloc=no])
 AS_IF([test "x$with_jemalloc" != xno],[
   # find jemalloc header first
+  save_CPPFLAGS="${CPPFLAGS}"
+  CPPFLAGS="${INCFLAGS} ${CPPFLAGS}"
   malloc_header=
   AC_CHECK_HEADER(jemalloc/jemalloc.h, [malloc_header=jemalloc/jemalloc.h], [
     AC_CHECK_HEADER(jemalloc.h, [malloc_header=jemalloc.h])
@@ -1423,6 +1425,8 @@ AS_IF([test "x$with_jemalloc" != xno],[
       done
     done
   ])
+  CPPFLAGS="${save_CPPFLAGS}"
+  unset save_CPPFLAGS
   with_jemalloc=${rb_cv_jemalloc_library}
   AS_CASE(["$with_jemalloc"],
   [no],
diff --git a/enc/Makefile.in b/enc/Makefile.in
index 6920bc9..ce93fdd 100644
--- a/enc/Makefile.in
+++ b/enc/Makefile.in
@@ -52,7 +52,7 @@ optflags = @optflags@
 debugflags = @debugflags@
 warnflags = @warnflags@
 CCDLFLAGS = @CCDLFLAGS@
-INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(top_srcdir)
+INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(top_srcdir) @incflags@
 DEFS = @DEFS@
 CPPFLAGS = @CPPFLAGS@ -DONIG_ENC_REGISTER=rb_enc_register
 LDFLAGS = @LDFLAGS@
```

---

On a side note, I think there might be other parts affected by the changes bellow:
https://github.com/ruby/ruby/pull/8449

I thought it might be a good idea to review everything thoroughly



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

  parent reply	other threads:[~2024-05-29 23:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 15:53 [ruby-core:117957] " lish82 (Hiroki Katagiri) via ruby-core
2024-05-21 19:14 ` [ruby-core:117960] " mame (Yusuke Endoh) via ruby-core
2024-05-22  5:43 ` [ruby-core:117964] " nobu (Nobuyoshi Nakada) via ruby-core
2024-05-22  9:20 ` [ruby-core:117965] " lish82 (Hiroki Katagiri) via ruby-core
2024-05-22  9:28 ` [ruby-core:117967] " lish82 (Hiroki Katagiri) via ruby-core
2024-05-23  3:13 ` [ruby-core:117973] " nobu (Nobuyoshi Nakada) via ruby-core
2024-05-29 23:53 ` k0kubun (Takashi Kokubun) via ruby-core [this message]
2024-07-15 13:02 ` [ruby-core:118605] " nagachika (Tomoyuki Chikanaga) via ruby-core
2024-07-15 13:11 ` [ruby-core:118608] " nagachika (Tomoyuki Chikanaga) via ruby-core
2024-10-21  8:50 ` [ruby-core:119554] " nagachika (Tomoyuki Chikanaga) via ruby-core

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-108512.20240529235350.53336@ruby-lang.org \
    --to=ruby-core@ml.ruby-lang.org \
    --cc=noreply@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).