ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: merch-redmine@jeremyevans.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:103525] [Ruby master Bug#17809] Ruby 2.6.7 backported C99 code that breaks older compilers
Date: Tue, 20 Apr 2021 16:42:57 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-91625.20210420164256.24755@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17809.20210416214636.24755@ruby-lang.org

Issue #17809 has been updated by jeremyevans0 (Jeremy Evans).

Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONTNEED to 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
Status changed from Open to Closed

I think this is only required for 2.6, since we switched to C99 before 2.7, so I've updated the backport field.

----------------------------------------
Bug #17809: Ruby 2.6.7 backported C99 code that breaks older compilers
https://bugs.ruby-lang.org/issues/17809#change-91625

* Author: tas50 (Tim Smith)
* Status: Closed
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: REQUIRED, 2.7: DONTNEED, 3.0: DONTNEED
----------------------------------------
Hey folks,

It looks like the 2.6.7 release inadvertently backported some C99 code from HEAD onto the Ruby 2.6 branch that shouldn't be requiring C99 compilers. This is causing us some pain and failures in our older versions of Chef that use Ruby 2.6 and are built without the C99 flag set on compilers.

Here's the patch we apply the 2.6.7 codebase to remove the C99 code:
https://github.com/chef/omnibus-software/blob/master/config/patches/ruby/ruby-2.6.7_c99.patch

Here's the commit that backported the C99 code:
https://github.com/ruby/ruby/commit/fe85a3d5271c4e3aeda42ec32e9c3f9ee02b6897

The particular line in the commit causing failures:
https://github.com/ruby/ruby/blob/fe85a3d5271c4e3aeda42ec32e9c3f9ee02b6897/hash.c#L5661

The failure we see while compiling:

```
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
compiling hash.c
compiling load.c
compiling marshal.c
 
Error:
 
    hash.c: In function 'keylist_delete':
hash.c:5661: error: 'for' loop initial declarations are only allowed in C99 mode
hash.c:5661: note: use option -std=c99 or -std=gnu99 to compile your code
gmake: *** [Makefile:419: hash.o] Error 1
gmake: *** Waiting for unfinished jobs....`
```



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

      parent reply	other threads:[~2021-04-20 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 21:46 [ruby-core:103490] [Ruby master Bug#17809] Ruby 2.6.7 backported C99 code that breaks older compilers tsmith84
2021-04-19  1:00 ` [ruby-core:103509] " nobu
2021-04-20 16:42 ` merch-redmine [this message]

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-list from there: mbox

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

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

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

  git send-email \
    --in-reply-to=redmine.journal-91625.20210420164256.24755@ruby-lang.org \
    --to=ruby-core@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 read-only IMAP folder(s) and NNTP newsgroup(s).