ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "nagachika (Tomoyuki Chikanaga) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "nagachika (Tomoyuki Chikanaga)" <noreply@ruby-lang.org>
Subject: [ruby-core:118608] [Ruby master Bug#20500] Non-system directories are not searched when checking for jemalloc headers and libs, and building `enc`
Date: Mon, 15 Jul 2024 13:11:13 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-109138.20240715131112.53336@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-20500.20240521155348.53336@ruby-lang.org>

Issue #20500 has been updated by nagachika (Tomoyuki Chikanaga).

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

commit:fc5b9ffad1b0710bd999521d0bf9631af6b762c2 cause compilation failures like `gcc: error: incflags@: No such file or directory`.
Reverted it for a while.

----------------------------------------
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-109138

* 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/lists/ruby-core.ml.ruby-lang.org/

  parent reply	other threads:[~2024-07-15 13:11 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 ` [ruby-core:118085] " k0kubun (Takashi Kokubun) via ruby-core
2024-07-15 13:02 ` [ruby-core:118605] " nagachika (Tomoyuki Chikanaga) via ruby-core
2024-07-15 13:11 ` nagachika (Tomoyuki Chikanaga) via ruby-core [this message]
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-109138.20240715131112.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).