[#108771] [Ruby master Bug#18816] Ractor segfaulting MacOS 12.4 (aarch64 / M1 processor) — "brodock (Gabriel Mazetto)" <noreply@...>

Issue #18816 has been reported by brodock (Gabriel Mazetto).

8 messages 2022/06/05

[#108802] [Ruby master Feature#18821] Expose Pattern Matching interfaces in core classes — "baweaver (Brandon Weaver)" <noreply@...>

Issue #18821 has been reported by baweaver (Brandon Weaver).

9 messages 2022/06/08

[#108822] [Ruby master Feature#18822] Ruby lack a proper method to percent-encode strings for URIs (RFC 3986) — "byroot (Jean Boussier)" <noreply@...>

Issue #18822 has been reported by byroot (Jean Boussier).

18 messages 2022/06/09

[#108937] [Ruby master Bug#18832] Suspicious superclass mismatch — "fxn (Xavier Noria)" <noreply@...>

Issue #18832 has been reported by fxn (Xavier Noria).

16 messages 2022/06/15

[#108976] [Ruby master Misc#18836] DevMeeting-2022-07-21 — "mame (Yusuke Endoh)" <noreply@...>

Issue #18836 has been reported by mame (Yusuke Endoh).

12 messages 2022/06/17

[#109043] [Ruby master Bug#18876] OpenSSL is not available with `--with-openssl-dir` — "Gloomy_meng (Gloomy Meng)" <noreply@...>

Issue #18876 has been reported by Gloomy_meng (Gloomy Meng).

18 messages 2022/06/23

[#109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected — "qnighy (Masaki Hara)" <noreply@...>

Issue #18878 has been reported by qnighy (Masaki Hara).

9 messages 2022/06/26

[#109055] [Ruby master Bug#18881] IO#read_nonblock raises IOError when called following buffered character IO — "javanthropus (Jeremy Bopp)" <noreply@...>

Issue #18881 has been reported by javanthropus (Jeremy Bopp).

9 messages 2022/06/26

[#109063] [Ruby master Bug#18882] File.read cuts off a text file with special characters when reading it on MS Windows — magynhard <noreply@...>

Issue #18882 has been reported by magynhard (Matth辰us Johannes Beyrle).

15 messages 2022/06/27

[#109081] [Ruby master Feature#18885] Long lived fork advisory API (potential Copy on Write optimizations) — "byroot (Jean Boussier)" <noreply@...>

Issue #18885 has been reported by byroot (Jean Boussier).

23 messages 2022/06/28

[#109083] [Ruby master Bug#18886] Struct aref and aset don't trigger any tracepoints. — "ioquatix (Samuel Williams)" <noreply@...>

Issue #18886 has been reported by ioquatix (Samuel Williams).

8 messages 2022/06/29

[#109095] [Ruby master Misc#18888] Migrate ruby-lang.org mail services to Google Domains and Google Workspace — "shugo (Shugo Maeda)" <noreply@...>

Issue #18888 has been reported by shugo (Shugo Maeda).

16 messages 2022/06/30

[ruby-core:108880] [Ruby master Misc#18691] An option to run `make rbconfig.rb` in a different directory

From: "jaruga (Jun Aruga)" <noreply@...>
Date: 2022-06-13 17:49:48 UTC
List: ruby-core #108880
Issue #18691 has been updated by jaruga (Jun Aruga).


nobu (Nobuyoshi Nakada) wrote in #note-1:
> I think you can pass build-time-only flags to `make`:
> ```sh
> $ ./autogen.sh
> $ CFLAGS='-O2' ./configure
> $ make ARCH_FLAG=--specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
> ```
> Then `rbconfig.rb` would not include that flag.

I tested. And I see that the `make install` also needs the `ARCH_FLAG` to build some native extension gems.

```
$ make install ARCH_FLAG=--specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
```

Here is how I tested on the latest master commit `753da6deca34eb7d5d61a26cf66b014ad77ad51d`.

```
$ ./autogen.sh
$ CFLAGS='-O2' ./configure --prefix=$(pwd)/dest/ruby --enable-shared --enable-mkmf-verbose
$ make ARCH_FLAG=--specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 2>&1 | tee make_arch_flag.log
```

Then

```
$ make install 2>&1 | tee make_install.log
$ mv dest dest_make_install

$ make install ARCH_FLAG=--specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 2>&1 | tee make_install_arch_flag.log
$ mv dest dest_make_install_arch_flag
```

```
$ diff -r dest_make_install/ dest_make_install_arch_flag/ > diff_make_install.txt
```

Especially for the ruby debug gem, here is the difference. You see the `/usr/lib/rpm/redhat/redhat-hardened-cc1` in the `ARCH_FLAG` is used in the gcc command lines.

```
$ diff --color -r dest_make_install/ruby/lib/ruby/gems/3.2.0+1/extensions/x86_64-linux/3.2.0+1/debug-1.5.0/gem_make.out dest_make_install_arch_flag/ruby/lib/ruby/gems/3.2.0+1/extensions/x86_64-linux/3.2.0+1/debug-1.5.0/gem_make.out > diff_extentions_debug_gem_make.txt

$ cat diff_extentions_debug_gem_make.txt 
2c2
< /home/jaruga/git/ruby/ruby/dest/ruby/bin/ruby -I /home/jaruga/var/git/ruby/ruby/lib -r ./siteconf20220613-361867-pemm3y.rb extconf.rb
---
> /home/jaruga/git/ruby/ruby/dest/ruby/bin/ruby -I /home/jaruga/var/git/ruby/ruby/lib -r ./siteconf20220613-362313-zg4n9u.rb extconf.rb
18,19c18,19
< gcc -I. -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1/x86_64-linux -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1/ruby/backward -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1 -I. -DHAVE_RB_ISEQ_PARAMETERS -DHAVE_RB_ISEQ_CODE_LOCATION -DHAVE_RB_ISEQ_TYPE    -fPIC -O2 -fPIC  -o debug.o -c debug.c
< gcc -I. -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1/x86_64-linux -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1/ruby/backward -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1 -I. -DHAVE_RB_ISEQ_PARAMETERS -DHAVE_RB_ISEQ_CODE_LOCATION -DHAVE_RB_ISEQ_TYPE    -fPIC -O2 -fPIC  -o iseq_collector.o -c iseq_collector.c
---
> gcc -I. -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1/x86_64-linux -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1/ruby/backward -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1 -I. -DHAVE_RB_ISEQ_PARAMETERS -DHAVE_RB_ISEQ_CODE_LOCATION -DHAVE_RB_ISEQ_TYPE    -fPIC -O2 -fPIC --specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -o debug.o -c debug.c
> gcc -I. -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1/x86_64-linux -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1/ruby/backward -I/home/jaruga/git/ruby/ruby/dest/ruby/include/ruby-3.2.0+1 -I. -DHAVE_RB_ISEQ_PARAMETERS -DHAVE_RB_ISEQ_CODE_LOCATION -DHAVE_RB_ISEQ_TYPE    -fPIC -O2 -fPIC --specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -o iseq_collector.o -c iseq_collector.c
21c21
< gcc -shared -o debug.so debug.o iseq_collector.o -L. -L/home/jaruga/git/ruby/ruby/dest/ruby/lib -Wl,-rpath,/home/jaruga/git/ruby/ruby/dest/ruby/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -Wl,--compress-debug-sections=zlib    -Wl,-rpath,/home/jaruga/git/ruby/ruby/dest/ruby/lib -L/home/jaruga/git/ruby/ruby/dest/ruby/lib -lruby  -lm -lpthread  -lc
---
> gcc -shared -o debug.so debug.o iseq_collector.o -L. -L/home/jaruga/git/ruby/ruby/dest/ruby/lib -Wl,-rpath,/home/jaruga/git/ruby/ruby/dest/ruby/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -Wl,--compress-debug-sections=zlib  --specs=/usr/lib/rpm/redhat/redhat-hardened-cc1  -Wl,-rpath,/home/jaruga/git/ruby/ruby/dest/ruby/lib -L/home/jaruga/git/ruby/ruby/dest/ruby/lib -lruby  -lm -lpthread  -lc
27c27
< /bin/mkdir -p . ./.gem.20220613-361867-kmazjx/debug
---
> /bin/mkdir -p . ./.gem.20220613-362313-rsh8y1/debug
29c29
< /bin/install -c -m 0755 debug.so ./.gem.20220613-361867-kmazjx/debug
---
> /bin/install -c -m 0755 debug.so ./.gem.20220613-362313-rsh8y1/debug
```

So, I want to add the `ARCH_FLAG` to configure script environment variables for convenience.

```
$ ./configure --help
...
Some influential environment variables:
  cflags      additional CFLAGS (ignored when CFLAGS is given)
  cppflags    additional CPPFLAGS (ignored when CPPFLAGS is given)
  cxxflags    additional CXXFLAGS (ignored when CXXFLAGS is given)
  AR          Archiver command
  AS          Assembler command
  CC          C compiler command
  CXX         C++ compiler command
  LD          Linker command
  NM          Symbol list command
  OBJCOPY     Objcopy command
  OBJDUMP     Objdump command
  RANLIB      Ranlib command
  STRIP       Strip command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CXXFLAGS    C++ compiler flags
  CPP         C preprocessor
...
```




----------------------------------------
Misc #18691: An option to run `make rbconfig.rb` in a different directory
https://bugs.ruby-lang.org/issues/18691#change-97960

* Author: jaruga (Jun Aruga)
* Status: Feedback
* Priority: Normal
----------------------------------------
In a Fedora Ruby RPM packaging, I have a challenge for the current `make rbconfig.rb`. Currently when we build Ruby from source to create the Ruby RPM package, we set compiler flag `CFLAGS` including `--specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'`. The file `/usr/lib/rpm/redhat/redhat-hardened-cc1` is managed in `redhat-rpm-config` RPM package. This is a problem when end users run `gem install <a_gem_with_native_extension>`. Because the `config.status` created by `configure` script and `rbconfig.rb` created by `make` (`make rbconfig`) includes `CFLAGS` including `--specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'`. And the `gem install` checks flags in `rbconfig.rb`. Then end users need to install the redhat-rpm-config RPM to run the `gem install`.

So, we want to create another `rbconfig.rb` file with flags not depending on files in the redhat-rpm-config RPM, and ship in the Ruby RPM, so that end users can run `gem install` without installing `redhat-rpm-config` RPM.

Here are ideal steps to create another `rbconfig.rb` when building Ruby to create the Ruby RPM package. I tested it on the current latest master `381475f02e6b44ae729f9403637b30c445b622e5`.

```
$ autoconf
$ CFLAGS='-O2 --specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' ./configure
$ make

$ mkdir -p build/rbconfig
$ cd build/rbconfig
$ CFLAGS='-O2' ../../configure
$ make rbconfig.rb
```

Then we can ship the `build/rbconfig/rbconfig.rb`.

But right now it seems that the `make rbconfig.rb` triggers the process to build `miniruby`, and I want to skip the process.

```
$ pwd
/home/jaruga/git/ruby/ruby/build/rbconfig

$ ls
config.log  config.status*  .ext/  GNUmakefile  Makefile  uncommon.mk

$ make rbconfig.rb
compiling ../../main.c
compiling ../../dmydln.c
...
```

I executed the following commands, to create `miniruby` on the current working directory and not to remake `miniruby` (`make -o miniruby`) to skip the process to build the `miniruby`. But ideally I want to execute only `make rbconfig` to create the `rbconfig.rb` in `build/rbconfig` directory. Do you have any idea about how to improve files such as `configure.ac`, `common.mk` or `tool/mkconfig.rb` to achieve this?

```
$ cp -p ../../miniruby .

$ make -o miniruby rbconfig.rb
/bin/sh ../../tool/ifchange "--timestamp=.rbconfig.time" rbconfig.rb rbconfig.tmp
rbconfig.rb updated

$ diff -u ../../rbconfig.rb rbconfig.rb
--- ../../rbconfig.rb	2022-04-12 18:03:45.484465916 +0200
+++ rbconfig.rb	2022-04-12 18:13:09.248334704 +0200
@@ -44,7 +44,7 @@
   CONFIG["RUBY_SEARCH_PATH"] = ""
   CONFIG["UNIVERSAL_INTS"] = ""
   CONFIG["UNIVERSAL_ARCHNAMES"] = ""
-  CONFIG["configure_args"] = " 'CFLAGS=-O2 --specs=/usr/lib/rpm/redhat/redhat-hardened-cc1'"
+  CONFIG["configure_args"] = " 'CFLAGS=-O2'"
   CONFIG["CONFIGURE"] = "configure"
   CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
   CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
@@ -173,7 +173,7 @@
   CONFIG["OBJEXT"] = "o"
   CONFIG["CPPFLAGS"] = " $(DEFS) $(cppflags)"
   CONFIG["LDFLAGS"] = "-L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic"
-  CONFIG["CFLAGS"] = "-O2 --specs=/usr/lib/rpm/redhat/redhat-hardened-cc1"
+  CONFIG["CFLAGS"] = "-O2"
   CONFIG["STRIP"] = "strip -S -x"
   CONFIG["RANLIB"] = "gcc-ranlib"
   CONFIG["OBJDUMP"] = "objdump"
```




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread