<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/rubygems/installer.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[rubygems/rubygems] Rely on PATH if Ruby is not installed in the same directory as the binstub</title>
<updated>2024-10-30T19:38:08+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-07-18T18:17:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5da1cc6c9c548bf95599ad7aa1b3877f8ccda953'/>
<id>5da1cc6c9c548bf95599ad7aa1b3877f8ccda953</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/ab7d65cc18

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/ab7d65cc18

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Simplify enable-load-relative prolog script creation</title>
<updated>2024-10-30T19:38:07+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-07-18T18:01:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=116d6cbc834c5c58a414d94f93f54e1007c0b60b'/>
<id>116d6cbc834c5c58a414d94f93f54e1007c0b60b</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/f2ed507afe
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/f2ed507afe
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Warning about PATH in `--user-install` mode is only necessary for gems with executables</title>
<updated>2024-09-27T16:49:32+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-09-25T14:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d1324170b6c25e893b0dec4d7829e6d561b15cf3'/>
<id>d1324170b6c25e893b0dec4d7829e6d561b15cf3</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/2fe0f452a2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/2fe0f452a2
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Remove temporary `.lock` files left around by gem installer</title>
<updated>2024-09-16T11:37:58+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-09-11T14:42:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fab01b15e999e9f9e18389dabfce3919e080ed56'/>
<id>fab01b15e999e9f9e18389dabfce3919e080ed56</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/edbb2e3475
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/edbb2e3475
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Ensure that the lock file will be removed</title>
<updated>2024-09-06T14:46:43+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-08-16T11:19:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=30176e3f238f198ae835bf1c593d2ad2dce2df49'/>
<id>30176e3f238f198ae835bf1c593d2ad2dce2df49</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/2706acb271
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/2706acb271
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Remove the lock file for binstubs</title>
<updated>2024-09-06T14:46:42+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-08-13T08:19:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5afee4d79599e5aad366a788b0c84e68594e6d34'/>
<id>5afee4d79599e5aad366a788b0c84e68594e6d34</id>
<content type='text'>
https://github.com/rubygems/rubygems/pull/7806#issuecomment-2241662488

https://github.com/rubygems/rubygems/commit/4f06ee234a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/pull/7806#issuecomment-2241662488

https://github.com/rubygems/rubygems/commit/4f06ee234a
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Fix another race condition</title>
<updated>2024-07-08T05:38:31+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-07-03T11:26:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e4825a5194af822104ec9fcac00004a2bad30f18'/>
<id>e4825a5194af822104ec9fcac00004a2bad30f18</id>
<content type='text'>
We also need to protect prior removal of the binstub, otherwise it can
happen that:

* Process A removes prior binstub FOO.
* Process B removes prior binstub FOO (does nothing actually because Process A already removed it).
* Process A writes binstub FOO for gem BAR from the beginning of file.
* Process B writes binstub FOO for gem BAZ from the beginning of file.

Similarly as before, if binstub FOO for gem BAR is bigger that binstub
FOO for gem BAZ, garbage bytes will be left around at the end of the
file, corrupting the binstub.

The solution is to also protect removal of the previous binstub. To do
this, we use a file lock on an explicit `.lock` file.

https://github.com/rubygems/rubygems/commit/d99a80e62d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We also need to protect prior removal of the binstub, otherwise it can
happen that:

* Process A removes prior binstub FOO.
* Process B removes prior binstub FOO (does nothing actually because Process A already removed it).
* Process A writes binstub FOO for gem BAR from the beginning of file.
* Process B writes binstub FOO for gem BAZ from the beginning of file.

Similarly as before, if binstub FOO for gem BAR is bigger that binstub
FOO for gem BAZ, garbage bytes will be left around at the end of the
file, corrupting the binstub.

The solution is to also protect removal of the previous binstub. To do
this, we use a file lock on an explicit `.lock` file.

https://github.com/rubygems/rubygems/commit/d99a80e62d
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Properly protect writing binstubs with a file lock</title>
<updated>2024-07-08T05:38:30+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-07-02T19:32:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d90a930edea311c0f3fe2a8aade03efb1697c3e0'/>
<id>d90a930edea311c0f3fe2a8aade03efb1697c3e0</id>
<content type='text'>
There's an issue when multiple processes try to write the same binstub.
The problem is that our file locking mechanism is incorrect because
files are truncated _before_ they are locked. So it can happen that:

* Process A truncates binstub FOO.
* Process B truncates binstub FOO.
* Process A writes binstub FOO for gem BAR from the beginning of file.
* Process B writes binstub FOO for gem BAZ from the beginning of file.

If binstub FOO for gem BAR is bigger than binstub FOO for gem BAZ, then
some bytes will be left around at the end of the binstub, making it
corrupt.

This was not a problem in our specs until the spec testing binstubs with
the same name coming from different gems changed from using gems named
"fake" and "rack" to using gems named "fake" and "myrack". Because of
the difference in gem name length, the generated binstub for gem
"myrack" is now longer, causing the above problem if binstub for gem
myrack is written first.

The solution is to make sure when using flock to always use modes that
DON'T truncate the file when opening it. So, we use `r+` if the file
exists previously (it requires the file to exist previously), otherwise
we use `a+`.

https://github.com/rubygems/rubygems/commit/ce8bcba90f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's an issue when multiple processes try to write the same binstub.
The problem is that our file locking mechanism is incorrect because
files are truncated _before_ they are locked. So it can happen that:

* Process A truncates binstub FOO.
* Process B truncates binstub FOO.
* Process A writes binstub FOO for gem BAR from the beginning of file.
* Process B writes binstub FOO for gem BAZ from the beginning of file.

If binstub FOO for gem BAR is bigger than binstub FOO for gem BAZ, then
some bytes will be left around at the end of the binstub, making it
corrupt.

This was not a problem in our specs until the spec testing binstubs with
the same name coming from different gems changed from using gems named
"fake" and "rack" to using gems named "fake" and "myrack". Because of
the difference in gem name length, the generated binstub for gem
"myrack" is now longer, causing the above problem if binstub for gem
myrack is written first.

The solution is to make sure when using flock to always use modes that
DON'T truncate the file when opening it. So, we use `r+` if the file
exists previously (it requires the file to exist previously), otherwise
we use `a+`.

https://github.com/rubygems/rubygems/commit/ce8bcba90f
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Remove unnecessary FileUtils usage</title>
<updated>2024-07-08T05:38:28+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-05-28T13:06:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6db1c53fce7a0f2f80dd78b5020132a09994c47d'/>
<id>6db1c53fce7a0f2f80dd78b5020132a09994c47d</id>
<content type='text'>
All other `chmod` usages in the file use `File.chmod`, so keep it
consistent.

https://github.com/rubygems/rubygems/commit/3dc0cf8703
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All other `chmod` usages in the file use `File.chmod`, so keep it
consistent.

https://github.com/rubygems/rubygems/commit/3dc0cf8703
</pre>
</div>
</content>
</entry>
<entry>
<title>[rubygems/rubygems] Protect binstub access during creation with a flock</title>
<updated>2024-06-28T10:49:07+00:00</updated>
<author>
<name>David Rodríguez</name>
<email>deivid.rodriguez@riseup.net</email>
</author>
<published>2024-06-26T14:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5c826ebea585dad8aa351632a9de3162d59fb898'/>
<id>5c826ebea585dad8aa351632a9de3162d59fb898</id>
<content type='text'>
https://github.com/rubygems/rubygems/commit/88e3f1d23c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/rubygems/rubygems/commit/88e3f1d23c
</pre>
</div>
</content>
</entry>
</feed>
