David Rodríguez d90a930ede [rubygems/rubygems] Properly protect writing binstubs with a file lock
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
2024-07-08 14:38:30 +09:00
2024-07-07 13:09:42 +09:00
2024-06-24 23:43:45 +09:00
2024-06-21 09:25:00 +09:00
2024-05-02 10:12:58 -04:00
2024-06-06 14:15:55 +00:00
2024-07-03 19:10:57 -04:00
2024-06-04 12:40:08 +09:00
2024-07-03 12:32:53 -07:00
2024-07-03 12:32:53 -07:00
2024-01-22 19:39:34 +09:00
2024-04-16 17:20:35 +02:00
2024-07-03 09:03:40 -04:00
2024-05-18 15:44:24 +09:00
2024-04-24 15:30:43 -04:00
2024-06-12 10:42:01 +00:00
2024-04-15 12:08:07 +09:00
2024-04-07 16:44:42 +09:00
2024-02-21 23:37:20 +09:00
2024-02-21 23:37:20 +09:00
2024-05-06 13:51:44 +09:00
2024-06-26 13:31:40 -04:00
2024-04-07 17:29:23 +09:00
2024-03-05 18:50:47 +09:00
2024-07-04 09:25:50 -04:00
2024-07-03 09:03:40 -04:00
GPL
2024-04-27 21:55:28 +09:00
2024-03-25 13:07:39 -04:00
2024-06-18 09:28:25 -07:00
2024-03-19 09:26:49 +01:00
2024-03-19 10:59:25 -07:00
2024-03-06 15:33:43 -05:00
2024-02-21 23:37:20 +09:00
2024-04-04 13:17:26 +09:00
2024-04-29 21:26:44 +09:00
2024-07-03 16:00:00 -04:00
2024-04-15 12:08:07 +09:00
2024-04-07 21:16:26 +09:00
2024-04-18 10:17:26 +02:00
2024-04-04 18:20:13 +09:00
2024-01-19 10:25:02 -05:00
2024-03-12 13:44:48 -07:00
2024-02-09 11:09:56 +09:00
2024-05-18 15:44:24 +09:00
2024-04-16 17:20:35 +02:00
2024-04-08 11:13:29 +09:00
2024-01-31 10:47:35 -05:00
2024-03-05 18:50:47 +09:00
2024-04-15 12:08:07 +09:00
2024-06-18 09:28:25 -07:00
2024-01-30 14:48:59 +09:00
2024-03-19 09:26:49 +01:00
2024-07-05 21:20:54 +09:00
2024-03-17 15:57:19 +09:00
2024-06-18 09:28:25 -07:00
2024-05-06 23:56:01 +09:00

Actions Status: MinGW Actions Status: RJIT Actions Status: Ubuntu Actions Status: Windows Travis Status

What is Ruby?

Ruby is an interpreted object-oriented programming language often used for web development. It also offers many scripting features to process plain text and serialized files, or manage system tasks. It is simple, straightforward, and extensible.

Features of Ruby

  • Simple Syntax
  • Normal Object-oriented Features (e.g. class, method calls)
  • Advanced Object-oriented Features (e.g. mix-in, singleton-method)
  • Operator Overloading
  • Exception Handling
  • Iterators and Closures
  • Garbage Collection
  • Dynamic Loading of Object Files (on some architectures)
  • Highly Portable (works on many Unix-like/POSIX compatible platforms as well as Windows, macOS, etc.) cf. https://docs.ruby-lang.org/en/master/maintainers_md.html#label-Platform+Maintainers

How to get Ruby

For a complete list of ways to install Ruby, including using third-party tools like rvm, see:

https://www.ruby-lang.org/en/downloads/

You can download release packages and the snapshot of the repository. If you want to download whole versions of Ruby, please visit https://www.ruby-lang.org/en/downloads/releases/.

Download with Git

The mirror of the Ruby source tree can be checked out with the following command:

$ git clone https://github.com/ruby/ruby.git

There are some other branches under development. Try the following command to see the list of branches:

$ git ls-remote https://github.com/ruby/ruby.git

You may also want to use https://git.ruby-lang.org/ruby.git (actual master of Ruby source) if you are a committer.

How to build

See Building Ruby

Ruby home page

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

Documentation

Mailing list

There is a mailing list to discuss Ruby. To subscribe to this list, please send the following phrase:

join

in the mail subject (not body) to the address ruby-talk-request@ml.ruby-lang.org.

Copying

See the file COPYING.

Feedback

Questions about the Ruby language can be asked on the Ruby-Talk mailing list or on websites like https://stackoverflow.com.

Bugs should be reported at https://bugs.ruby-lang.org. Read "Reporting Issues" for more information.

Contributing

See "Contributing to Ruby", which includes setup and build instructions.

The Author

Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.

matz@ruby-lang.org

Description
Languages
Ruby 58.9%
C 29.5%
Rust 6.1%
C++ 2.9%
Yacc 0.9%
Other 1.6%