From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 066E41F4C1 for ; Tue, 19 Nov 2024 08:44:16 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=RtxVVu7R; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=QcK2roxU; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1732005812; bh=xXIBBtEQHxcvPHhVkcT8WROQJbw1NsoKEDB/duD7ytI=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=RtxVVu7Rx50znY1tLzz5ITlL/HxvU81deKemRG6gBcQHBHiR843o8JHjAxhzrEI3t EcCbZUthzOHqmrFy6uaOPUHbnPfS8snpwHSTuKG7J7kjBigX94bUnfyV/Q9Yp3CNmb AdFdOoa7apK7p6JdeBQ+V61tnH5WDDI4VglNyROw= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 3753144C00 for ; Tue, 19 Nov 2024 08:43:32 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=QcK2roxU; dkim-atps=neutral Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 6B3DE44B9C for ; Tue, 19 Nov 2024 08:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=Jb0SSGpnKAyKrMk+R2glxXaBTRLmVA8Q8Bgh3LddawY=; b=QcK2roxUsR4FdM1lLPntAWyO+jWPfKkOW6wypucFd+DknaOhqXKlhrpVdx/IMNlZkVvV O/CL9AHVHEVx7UfPoB0AkzeE2Ie1Dn9nTu3F4qbk1SD0rh073VOrE5TJq0tWhFKdeeZj1s q29LUG7vmPvtrFSKYWHIcrNVC5M5FW5jcrtsVNvArc4e7jVg4ngHVtpQfADJDozotP+vu9 2VijBGVQxSEllqivRXAH5P+4b83o7JULlr3lxoH2sU+ZpPL40J8Dh95t95RfZaXYxrz8cR 5NAOMzfJnUR1pehNeCfp7p0cpXr3XtYOuV011Ps4s9MIypzdJlp6+shPutIwzopQ== Received: by recvd-5c8ccdbd88-v6stf with SMTP id recvd-5c8ccdbd88-v6stf-1-673C4FA6-4 2024-11-19 08:43:18.303873464 +0000 UTC m=+386418.622075985 Received: from herokuapp.com (unknown) by geopod-ismtpd-19 (SG) with ESMTP id odsXEIrMSLqTjhK44tY9aw for ; Tue, 19 Nov 2024 08:43:18.185 +0000 (UTC) Date: Tue, 19 Nov 2024 08:43:18 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20871 X-Redmine-Issue-Author: sanderd17 X-Redmine-Issue-Priority: Normal X-Redmine-Sender: tdeo X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 96639 X-SG-EID: =?us-ascii?Q?u001=2EqjV0SqZ0S4qJacbMovKeakwg2VIm8LtKIW1quU=2F0wzCrUpm4+ZWd6rLjU?= =?us-ascii?Q?2UgYl2qMjWD5IUuHxxkjRIMGYrvQ2McYWUJpPdc?= =?us-ascii?Q?r6Pe7VYzo8OxLApwoHkDJM04DjEgJgmUnkxv8su?= =?us-ascii?Q?J9YseaJEPFuUrhqOQXG1MnRejRrOHoHqb8LHvJc?= =?us-ascii?Q?wdAy=2FnwNjJ1m6FusIFTk7keANyESDhzFWMrhKvl?= =?us-ascii?Q?H8Aza7jiilVFR+beBzXQ37db5CPB=2FcgMROTNl=2FU?= =?us-ascii?Q?r8Jx?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 6XAQCQTRHTGJPBGPYEG7KO2YXBTUDNY4 X-Message-ID-Hash: 6XAQCQTRHTGJPBGPYEG7KO2YXBTUDNY4 X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:119964] [Ruby master Bug#20871] Including methods in Enumerable doesn't make them available in Array List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "tdeo (Thierry Deo) via ruby-core" Cc: "tdeo (Thierry Deo)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20871 has been updated by tdeo (Thierry Deo). I'm running into a similar situation which I managed to reproduce with a plain ruby console and no external dependencies: ```ruby $ irb irb(main):001> module Bar; def bar; 'bar'; end; end module Foo; def foo; 'foo'; end; end Enumerable.prepend Bar Class.new { include Enumerable } Enumerable.include Foo puts [].foo (irb):9:in `
': undefined method `foo' for an instance of Array (NoMethodError) puts [].foo ^^^^ from :187:in `loop' from /Users/thierry/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/irb-1.14.1/exe/irb:9:in `' from /Users/thierry/.asdf/installs/ruby/3.3.6/bin/irb:25:in `load' from /Users/thierry/.asdf/installs/ruby/3.3.6/bin/irb:25:in `
' ``` Removing either of the `Enumerable.prepend` or `Class.new` lines makes the bug go away ---------------------------------------- Bug #20871: Including methods in Enumerable doesn't make them available in Array https://bugs.ruby-lang.org/issues/20871#change-110700 * Author: sanderd17 (Sander Deryckere) * Status: Feedback * ruby -v: 3.3.6 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Today, our CI pipeline started failing after the automatic update from v3.3.5 to v3.3.6. After researching, it turned out that our core extensions to the `Array` class weren't loaded anymore. The core-extensions code looks like this: ```ruby module CoreExt module Enumerable def average sum(&:to_f) / count if any? end # def ... end end Enumerable.include CoreExt::Enumerable ``` After some debugging, it turned out that the `average` method was included in the `instance_methods` of `Enumerable`, but not in the `instance_methods` of `Array`. Explicitly adding `Array.include CoreExt::Enumerable` fixes CI for our case. The very strange thing is that it only happens on a release branch we are still maintaining. It doesn't happen on our main development branch (which also updated to v3.3.6 today). I have been unable to find the difference between both branches so far (they diverged a couple of months ago, but the base system is still regularly updated on both, and pretty similar). After some digging around, I assume this commit is related to our issue: https://github.com/ruby/ruby/commit/edeb0319f7a95dfe3f9b895bcf32371dd8514726 -- 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/