<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_autoload.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Fix autoload status of statically linked extensions</title>
<updated>2022-11-25T21:21:40+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2022-11-17T22:33:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=790cf4b6d0475614afb127b416e87cfa39044d67'/>
<id>790cf4b6d0475614afb127b416e87cfa39044d67</id>
<content type='text'>
Previously, for statically-linked extensions, we used
`vm-&gt;loading_table` to delay calling the init function until the
extensions are required. This caused the extensions to look like they
are in the middle of being loaded even before they're required.
(`rb_feature_p()` returned true with a loading path output.) Combined
with autoload, queries like `defined?(CONST)` and `Module#autoload?`
were confused by this and returned nil incorrectly. RubyGems uses
`defined?` to detect if OpenSSL is available and failed when OpenSSL was
available in builds using `--with-static-linked-ext`.

Use a dedicated table for the init functions instead of adding them to
the loading table. This lets us remove some logic from non-EXTSTATIC
builds.

[Bug #19115]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, for statically-linked extensions, we used
`vm-&gt;loading_table` to delay calling the init function until the
extensions are required. This caused the extensions to look like they
are in the middle of being loaded even before they're required.
(`rb_feature_p()` returned true with a loading path output.) Combined
with autoload, queries like `defined?(CONST)` and `Module#autoload?`
were confused by this and returned nil incorrectly. RubyGems uses
`defined?` to detect if OpenSSL is available and failed when OpenSSL was
available in builds using `--with-static-linked-ext`.

Use a dedicated table for the init functions instead of adding them to
the loading table. This lets us remove some logic from non-EXTSTATIC
builds.

[Bug #19115]
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent a warning "Expected ... to define AutoloadTest but it didn't"</title>
<updated>2022-06-20T08:39:58+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2022-06-20T08:39:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=078db98da42444b3cdbd0f391b680ba8193299fd'/>
<id>078db98da42444b3cdbd0f391b680ba8193299fd</id>
<content type='text'>
related: [Bugs #18813] and eca31d24d606a73def3674938112dc3c5b79c445
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
related: [Bugs #18813] and eca31d24d606a73def3674938112dc3c5b79c445
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #18813] Warn when autoload has to lookup in parent namespace</title>
<updated>2022-06-18T12:49:02+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2022-06-18T08:29:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=eca31d24d606a73def3674938112dc3c5b79c445'/>
<id>eca31d24d606a73def3674938112dc3c5b79c445</id>
<content type='text'>
This is a verbose mode only warning.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a verbose mode only warning.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Module#const_source_location for autoload constants with direct requires</title>
<updated>2022-06-06T18:12:55+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-03-12T05:43:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c85d1cda86d75ee2c3f7b42f22c543409cb5a186'/>
<id>c85d1cda86d75ee2c3f7b42f22c543409cb5a186</id>
<content type='text'>
If an autoload exists for a constant, but the path for the autoload
was required, const_source_location would return [false, 0] instead
of the actual file and line. This fixes it by setting the appropriate
file and line in rb_const_set, and saving the file and line in
const_tbl_update before they get reset by current_autoload_data.

Fixes [Bug #18624]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If an autoload exists for a constant, but the path for the autoload
was required, const_source_location would return [false, 0] instead
of the actual file and line. This fixes it by setting the appropriate
file and line in rb_const_set, and saving the file and line in
const_tbl_update before they get reset by current_autoload_data.

Fixes [Bug #18624]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix GC race condition in autoload.</title>
<updated>2022-05-25T12:17:30+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-05-25T11:12:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d875445e8a8b073298e8b3db177d1a5e78c92893'/>
<id>d875445e8a8b073298e8b3db177d1a5e78c92893</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Restore implicit relationship between `autoload_const` and `autoload_data` during GC. (#5911)</title>
<updated>2022-05-17T07:12:36+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-05-17T07:12:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=60d45b2ee86a80e248c3bff0c90c981ed2168ac3'/>
<id>60d45b2ee86a80e248c3bff0c90c981ed2168ac3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Delete autoload data from global features after autoload has completed. (#5910)</title>
<updated>2022-05-16T12:50:02+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-05-16T12:50:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f626998c4fa62973cac3a027597f97cdacd0d3c5'/>
<id>f626998c4fa62973cac3a027597f97cdacd0d3c5</id>
<content type='text'>
* Update naming of critical section assertions macros.

* Improved locking for autoload.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Update naming of critical section assertions macros.

* Improved locking for autoload.</pre>
</div>
</content>
</entry>
<entry>
<title>Remove autoload for constant if the autoload fails</title>
<updated>2021-10-08T21:54:26+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-10-08T21:54:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=08759edea8fb75d46c3e75217e6613465426a0d2'/>
<id>08759edea8fb75d46c3e75217e6613465426a0d2</id>
<content type='text'>
Previously, if an autoload failed (the file was loaded, but the
constant was not defined by the autoloaded file). Ruby will try
to autoload again if you delete the autoloaded file from
$LOADED_FEATURES.  With this change, the autoload and the
constant itself are removed as soon as it fails.

To handle cases where multiple threads are autoloading, when
deleting an autoload, handle the case where another thread
already deleted it.

Fixes [Bug #15790]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, if an autoload failed (the file was loaded, but the
constant was not defined by the autoloaded file). Ruby will try
to autoload again if you delete the autoloaded file from
$LOADED_FEATURES.  With this change, the autoload and the
constant itself are removed as soon as it fails.

To handle cases where multiple threads are autoloading, when
deleting an autoload, handle the case where another thread
already deleted it.

Fixes [Bug #15790]</pre>
</div>
</content>
</entry>
<entry>
<title>fix for multi-run test.</title>
<updated>2020-05-15T05:54:03+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2020-05-15T05:27:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e89b87508160868bd431218872d0d5b7b15bc57b'/>
<id>e89b87508160868bd431218872d0d5b7b15bc57b</id>
<content type='text'>
TestAutoload#test_source_location can't run multiple test-run so
that use assert_separately().

repro command:
make yes-test-all TESTS='--repeat-count=50 ruby/test_autoload -n test_source_location'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TestAutoload#test_source_location can't run multiple test-run so
that use assert_separately().

repro command:
make yes-test-all TESTS='--repeat-count=50 ruby/test_autoload -n test_source_location'
</pre>
</div>
</content>
</entry>
<entry>
<title>Suffixed memory leak tests as "memory_leak"</title>
<updated>2020-05-06T17:53:39+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-05-06T17:53:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ce00fda9254887388b15a3a9ff505d3473cecf57'/>
<id>ce00fda9254887388b15a3a9ff505d3473cecf57</id>
<content type='text'>
So that `TEST_EXCLUDES` option in common.mk works.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So that `TEST_EXCLUDES` option in common.mk works.
</pre>
</div>
</content>
</entry>
</feed>
