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 [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 77CDC1F44D for ; Tue, 23 Apr 2024 15:28:23 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=nHi3DWY7; 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=YBRcSJaE; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id A3C24844C9; Tue, 23 Apr 2024 15:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1713886096; bh=SoKx26nWAtegYV4KaJVHpP4+MS300TEu/96nxVRWlM8=; 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=nHi3DWY78eoqetmd9+NQ0zU1AuArudCKsqLosHvDUMYryh3kgxU22qve6LdtZIu9U VISaK+kAbyHFyHBBpt6EWcxWQL4l/hYfaoY/ChLzJGIjjoaczbtMsupPSj8ykfO9DE Vh1i0vqDsnyOn5r4w8zqKmWAoemyJTmRlhWqmSA8= Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by nue.mailmanlists.eu (Postfix) with ESMTPS id C8DE48447C for ; Tue, 23 Apr 2024 15:28:12 +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=YBRcSJaE; dkim-atps=neutral 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=PFxC7fwGlrz2eI33MXFp/DgIsUWV57ABkboMBqlHPVk=; b=YBRcSJaEAaPtEjIrbdUWrirKQ//VE5IIzdzdxzWFjcWFvHtCr4gs9vy9mlGSf0mUreGb 9aQpyLSpXneb5wUkEdIBusQ/byTPvz8Nxi8Vi3nO3RQ5yEW4nReApx0VPhM5aMrrVYXlJm 6u0hVPSpCeUO53hZV8Bm63pYrb/Au+ka4/P/PbnoFU7bMg9s2zuHV6bJOxsi5C7j71w10D Yw1ljqAqHhGv/QtNcg/mmw3Lkgm6cOSJ9FtdYb4Gwu0q4/r45cB8HAc2cTdPlRV9crQXPe HbE1R+uoGU2AN04shViSStSK1tybihovTN2vd/0V9EhF17NGHQ6ra856VWoLmRlg== Received: by recvd-547d99795c-6s9kc with SMTP id recvd-547d99795c-6s9kc-1-6627D38B-18 2024-04-23 15:28:11.655001602 +0000 UTC m=+926853.050770915 Received: from herokuapp.com (unknown) by geopod-ismtpd-13 (SG) with ESMTP id Q7v2ezPsRXKW8qZAkIriOg for ; Tue, 23 Apr 2024 15:28:11.608 +0000 (UTC) Date: Tue, 23 Apr 2024 15:28:11 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 6648 X-Redmine-Issue-Author: headius X-Redmine-Issue-Assignee: matz X-Redmine-Issue-Priority: Normal X-Redmine-Sender: kddnewton 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: 94251 X-SG-EID: =?us-ascii?Q?u001=2E41nWPij=2FD1kdGmpgWeHScbb9X8tZePZrQQx3bl8Vy2odBuMhLMhId2kIq?= =?us-ascii?Q?I4MmMJ43lNHfKPNNds=2Fb3JsTYpYoWyQb3+sPV4d?= =?us-ascii?Q?vscaSKwkBzWpbRfpjQKWp29hXehgg8kya2LHVq9?= =?us-ascii?Q?I8jkwKil91x6xrOyRAMJX4Bv26cMmaDwKF7q98A?= =?us-ascii?Q?LwjsqtdIbdFIo2yw0I1vQxbUaLxuMMxchts821S?= =?us-ascii?Q?sGzucXULBQDyXPqAGR8a4NgEENe+Z=2FuWECfdoN=2F?= =?us-ascii?Q?okC7u5IAqyycj3P=2FE97PX1aYlw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: CZRPGUEQGOFDC3V4PHJWW73IEGXAH6BV X-Message-ID-Hash: CZRPGUEQGOFDC3V4PHJWW73IEGXAH6BV 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.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117655] [Ruby master Feature#6648] Provide a standard API for retrieving all command-line flags passed to Ruby List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "kddnewton (Kevin Newton) via ruby-core" Cc: "kddnewton (Kevin Newton)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #6648 has been updated by kddnewton (Kevin Newton). As another note, this would be useful within CRuby itself. Right now there are lots of tests that run `assert_in_out_err`, which in turn calls `EnvUtil.invoke_ruby`. `EnvUtil.invoke_ruby` does not pass along some command-line options like RJIT, YJIT, Prism, etc. So there appear to be some tests that are being run in the CRuby CI that aren't testing what they should be testing. ---------------------------------------- Feature #6648: Provide a standard API for retrieving all command-line flags passed to Ruby https://bugs.ruby-lang.org/issues/6648#change-108065 * Author: headius (Charles Nutter) * Status: Assigned * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- Currently there are no standard mechanisms to get the flags passed to the currently running Ruby implementation. The available mechanisms are not ideal: * Scanning globals and hoping they have not been tweaked to new settings * Using external wrappers to launch Ruby * ??? Inability to get the full set of command-line flags, including flags passed to the VM itself (and probably VM-specific) makes it impossible to launch subprocess Ruby instances with the same settings. A real world example of this is "((%bundle exec%))" when called with a command line that sets various flags, a la ((%jruby -Xsome.vm.setting --1.9 -S bundle exec%)). None of these flags can propagate to the subprocess, so odd behaviors result. The only option is to put the flags into an env var (((|JRUBY_OPTS|)) or ((|RUBYOPT|))) but this breaks the flow of calling a simple command line. JRuby provides mechanisms to get all its command line options, but they require calling Java APIs from Ruby's API set. Rubinius provides its own API for accessing comand-line options, but I do not know if it includes VM-level flags as well as standard Ruby flags. I know there is a (({RubyVM})) namespace in the 2.0 line. If that namespace is intended to be general-purpose for VM-level features, it would be a good host for this API. Something like... ``` class << RubyVM def vm_args; end # returns array of command line args *not* passed to the target script def script; end # returns the script being executed...though this overlaps with $0 def script_args; end # returns args passed to the script...though this overlaps with ARGV, but that is perhaps warranted since ARGV can be modified (i.e. you probably want the original args) end ``` -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/