From: mame@... Date: 2019-12-16T05:23:38+00:00 Subject: [ruby-core:96256] [Ruby master Bug#16418] when configuring --with-os-version-string=none fails to strip entire version string on MacOS Issue #16418 has been updated by mame (Yusuke Endoh). Status changed from Open to Closed The patch has been already merged. Closing, thanks. ---------------------------------------- Bug #16418: when configuring --with-os-version-string=none fails to strip entire version string on MacOS https://bugs.ruby-lang.org/issues/16418#change-83148 * Author: eightbitraptor (Matthew Valentine-House) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.7.0dev (2019-12-12T14:26:35Z master 93b27c69cc) [x86_64-darwin1] * Backport: 2.5: REQUIRED, 2.6: REQUIRED ---------------------------------------- When configuring Ruby with `--with-os-version-string=none` on Mac OS, the `target_os` is set to `darwin1`. This is happening because the regex's generated by `configure.ac` that form the `os_version_style_transform` in the `configure` script only handle a single major version digit. When this is run on Mac OS - where the target OS version is reported with a two digit major version (`19.2.0` on my Macbook Pro running Mac OS Catalina 10.15.2) - everything except the first half of the major version is removed. This affects the value of the global constant `RUBY_PLATFORM` I believe the correct behaviour is to strip the entire version string rather than just part of it when the `none` option is passed. ## Reproduction steps On a Machine running Mac OS, with the latest `master` checked out, run: ``` autoconf && ./configure --with-os-version-style=none | grep -F 'target OS:' ``` this will output ``` * target OS: darwin1 ``` Attached is a patch that fixes the regex to strip the entire version when `none` is passed as an argument. After the patch is applied, when running the above command again the output should be: ``` * target OS: darwin ``` ---Files-------------------------------- 0001-Allow-more-than-one-major-version-number-in-target_o.patch (1 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: