summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-12-05[rubygems/rubygems] Don't write outside of destdir when installing default ↵David Rodríguez
bundler https://github.com/rubygems/rubygems/commit/a62d00c5e8
2021-12-05[rubygems/rubygems] Fold a line that got out of handDavid Rodríguez
https://github.com/rubygems/rubygems/commit/49317d8beb
2021-12-05[rubygems/rubygems] Fix binstubs and plugins regeneration with `--destdir` ↵David Rodríguez
is used https://github.com/rubygems/rubygems/commit/7079de16fa
2021-12-04[rubygems/rubygems] Let original EACCES error be raisedDavid Rodríguez
This block of code already wraps file operations with `SharedHelpers.filesystem_access`, which rescues and re-raises more friendly errors. Also, I'm not fully sure creating a temporary directory can end up raising an `Errno::EACCES` error from reading `tmpdir` sources. Finally, this rescue block apparently leads to some false positives when firewall is blocking the ruby executable on Windows, or at least that's what we've got reported. In any case, I think it's best to let the original error be raised. https://github.com/rubygems/rubygems/commit/f7dbe54404
2021-12-03[rubygems/rubygems] Don't unnecessarily loop twice through dependenciesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/06b4a7994d
2021-12-03[rubygems/rubygems] Improve source gemfile/lockfile equivalence checksDavid Rodríguez
Since we no longer have multiple global sources, each top level dependency is always pinned to a single source, so it makes little sense to talk about adding or removing a source. Instead, source changes always mean to change the source one or more dependencies are pinned to. This logic can now be much simpler. https://github.com/rubygems/rubygems/commit/f1d33fa0df
2021-12-03[rubygems/rubygems] Improve sources representationDavid Rodríguez
We have two representations of a source. Once used for sorting, which should not depend on the source's state, but solely on its static information, like remotes. Another one used for error and informational messages, which should properly inform about the exact state of the source when the message is printed. This commit makes the latter be the default implementation of `to_s`, so that error and informational messages are more accurate by default. https://github.com/rubygems/rubygems/commit/b5f2b88957
2021-12-03[rubygems/rubygems] Don't overwrite locked dependency sources too earlyDavid Rodríguez
Otherwise we hide some useful message about dependency source changes. https://github.com/rubygems/rubygems/commit/c926673c5b
2021-12-03[rubygems/rubygems] Fix incorrect order in changed sources messageDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6f1b5f68de
2021-12-03[rubygems/rubygems] Remove unnecessary codeDavid Rodríguez
Somehow this is trying to relax frozen mode constraints for path sources. It doesn't make sense to me and it's not covered by any spec so I'm killing it. https://github.com/rubygems/rubygems/commit/17c978e161
2021-12-03[rubygems/rubygems] Reuse `locked_dependencies` helperDavid Rodríguez
It makes the code more consistent with the above line. https://github.com/rubygems/rubygems/commit/f28d05a548
2021-12-03[rubygems/rubygems] Reformat for consistency with the above lineDavid Rodríguez
https://github.com/rubygems/rubygems/commit/11193be3f1
2021-12-03[rubygems/rubygems] Remove unnecessary nil checksDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d047b8935d
2021-12-03[rubygems/rubygems] Move required_ruby_version gemspec attribute to ↵Josef Šimánek
recommended section. https://github.com/rubygems/rubygems/commit/de6552ac30
2021-12-03[ruby/irb] Examine indentation of in keyword when trying to type includeKaíque Kandy Koga
Use in_keyword_case_scope? Return fast https://github.com/ruby/irb/commit/8acc7f8dc7
2021-12-03[ruby/irb] Add Alt+d keycode when convert-meta isn't usedima1zumi
I pushed reline#389 for when convert-meta is not turned on in .inputrc. Alt+D in irb also needs to be set to the keycode for not using convert-meta. https://github.com/ruby/irb/commit/328eddf851
2021-12-03[ruby/irb] Fix bug infinite loop when pasting multilines fo code in Ruby 2.6manga_osyo
Fix bug infinite loop when pasting multilines fo code in Ruby 2.6. This is not reproduced in Ruby 2.7. Changes added in https://github.com/ruby/irb/pull/242/files#diff-612b926e42ed78aed1a889ac1944f7d22229b3a489cc08f837a7f75eca3d3399R155 are also reflected in Ruby 2.6. https://github.com/ruby/irb/commit/0a77f75bf0
2021-12-03[ruby/reline] No need to check `x > 0`ima1zumi
Checked in the previous line. https://github.com/ruby/reline/commit/bf774c0f2c
2021-12-02[ruby/reline] fix `TerminfoError` -> `Reline::Terminfo::TerminfoError`ima1zumi
https://github.com/ruby/reline/commit/c07b0ace6a
2021-12-02[ruby/reline] Rescue if tigetstr(capname) cannot be obtainedima1zumi
fix https://github.com/ruby/reline/issues/384 If `$TERM` is `vt102`, there are no `kend`, `khome`, `civis`, or `cnorm` in capabilities. `TerminfoError` is raised in `Reline::Terminfo.tigetstr(capname)`, so it is rescued if it does not exist. https://github.com/ruby/reline/commit/c9f5112702
2021-12-02[rubygems/rubygems] This warrants a commentDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8fa29e5e55
2021-12-02[rubygems/rubygems] Fix gemspec source unlocking also for prereleases like ↵David Rodríguez
0.0.0.SNAPSHOT The default prerelease requirement in rubygems doesn't actually match things like "0.0.0.SNAPSHOT". https://github.com/rubygems/rubygems/commit/711498b342
2021-12-02[rubygems/rubygems] Fix materialization of locked 0 prereleasesDavid Rodríguez
Since the default requirement in rubygems is ">= 0", it was failing to match 0 prereleases. Changing the default globally to be ">= 0.a" instead is a major refactoring that's quite tricky to make backwards compatible, so I'm special casing this where needed for now to fix the regression. https://github.com/rubygems/rubygems/commit/68fe37937c
2021-12-02Compatibility with IRBschneems
Instead of accessing the struct as an array, access it via methods. There are other places inside of this file already using this API (for example https://github.com/ruby/ruby/blob/e0a5c3d2b71dfad038d7562fdd33f02ffd79232d/lib/irb/ruby-lex.rb#L829-L830). This commit moves all struct array-ish calls to use their method calls instead. It is also ~1.23 faster accessing values via a method instead of as an array according to this microbenchmark: ```ruby Elem = Struct.new(:pos, :event, :tok, :state, :message) do def initialize(pos, event, tok, state, message = nil) super(pos, event, tok, State.new(state), message) end # ... def to_a a = super a.pop unless a.empty? a end end class ElemClass attr_accessor :pos, :event, :tok, :state, :message def initialize(pos, event, tok, state, message = nil) @pos = pos @event = event @tok = tok @state = State.new(state) @message = message end def to_a if @message [@pos, @event, @tok, @state, @message] else [@pos, @event, @tok, @state] end end end # stub state class creation for now class State; def initialize(val); end; end ``` ```ruby Benchmark.ips do |x| x.report("struct") { struct[1] } x.report("class ") { from_class.event } x.compare! end; nil ``` ``` Warming up -------------------------------------- struct 1.624M i/100ms class 1.958M i/100ms Calculating ------------------------------------- struct 17.139M (± 2.6%) i/s - 86.077M in 5.025801s class 21.104M (± 3.4%) i/s - 105.709M in 5.015193s Comparison: class : 21103826.3 i/s struct: 17139201.5 i/s - 1.23x (± 0.00) slower ``` Notes: Merged: https://github.com/ruby/ruby/pull/5093
2021-12-02Ignore to generate the documentation from vendored librariesHiroshi SHIBATA
2021-12-02[rubygems/rubygems] Provide distinguished name which will be correctly parsed.Vít Ondruch
It seems that since ruby openssl 2.1.0 [[1]], the distinguished name submitted to `OpenSSL::X509::Name.parse` is not correctly parsed if it does not contain the first slash: ~~~ $ ruby -v ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] $ gem list | grep openssl openssl (default: 2.2.0) $ irb -r openssl irb(main):001:0> OpenSSL::X509::Name.parse("CN=nobody/DC=example").to_s(OpenSSL::X509::Name::ONELINE) => "CN = nobody/DC=example" irb(main):002:0> OpenSSL::X509::Name.parse("/CN=nobody/DC=example").to_s(OpenSSL::X509::Name::ONELINE) => "CN = nobody, DC = example" ~~~ Instead, use `OpenSSL::X509::Name.new` directly as suggested by upstream maintainer. [1]: https://github.com/ruby/openssl/commit/19c67cd10c57f3ab7b13966c36431ebc3fdd653b https://github.com/rubygems/rubygems/commit/09ca0c2dae Co-authored-by: Kazuki Yamaguchi <k@rhe.jp>
2021-12-01Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbdHiroshi SHIBATA
2021-12-01[rubygems/rubygems] Update ↵Olle Jonsson
bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt https://github.com/rubygems/rubygems/commit/8836fe157b Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2021-12-01[rubygems/rubygems] Update main.yml.ttOlle Jonsson
https://github.com/rubygems/rubygems/commit/3260173c59
2021-12-01[rubygems/rubygems] newgem tmpl: ruby as "2.7" in GH Actions matrixOlle Jonsson
https://github.com/rubygems/rubygems/commit/f5bead5634
2021-12-01[rubygems/rubygems] newgem templ: Avoid Float 3.0 -> "3" in GH ActionOlle Jonsson
This change avoids a YAML Float-to-String conversion, which turns a 3.0 into a "3". That can make names of builds less clear. In order to use this new capability, I added a "name" descriptor to the matrix-created Job. https://github.com/rubygems/rubygems/commit/6221241ad4
2021-11-30[rubygems/rubygems] Fix race condition when reading & writing gemspecs ↵David Rodríguez
concurrently When bundler parallel installer installs gems concurrently, one can get confusing warnings like the following: ``` "[/home/runner/work/rubygems/rubygems/bundler/tmp/2/gems/system/specifications/zeitwerk-2.4.2.gemspec] isn't a Gem::Specification (NilClass instead). ``` I've got these warnings several times in the past, but I never managed to reproduce them, and never look deeply into the root cause, but this time a got a cause that reproduced quite frequently, so I looked into it. The problem is one thread reading a gemspec while another thread is writing it. The write of the gemspec was not protected, so `Gem::Specification.load` could end up seeing a truncated gemspec and thus throw this warning. The fix involve two changes: * Change the methods that write gemspecs to use `Gem.binary_write` which is protected by a lock. * Fix `Gem.binary_write` to create the file lock at file creation time, not when the file already exists after. The realworld user problem caused by this issue happens in bundler, but I'm fixing it in rubygems first, and then I'll backport to bundler whatever needs backporting to fix the issue on the bundler side. https://github.com/rubygems/rubygems/commit/a672e7555c
2021-11-30[rubygems/rubygems] Revert "Remove spec file before building"David Rodríguez
This reverts commit af604436d8141c34cb2e1e645b9b0d47bfd55a55. The issue that led to introducing it was never reproduced. I tried to repro with this patch and it still works just fine. Since this removal is getting in the middle for some race conditions I'm facing, I'm reverting the patch. https://github.com/rubygems/rubygems/commit/2dd267f0e4
2021-11-30[ruby/error_highlight] Ignore all syscall errorsYusuke Endoh
At least, Error::ENOTSUP may be raised on some extreme environments https://github.com/ruby/error_highlight/commit/2787983ff7
2021-11-30lib/pp.rb (width_for): Ignore all syscall errorsYusuke Endoh
According to nobu, Errno::EBAD is raised on Windows.
2021-11-30lib/pp.rb (width_for): ignore Errno::EINVALYusuke Endoh
The error is raised on Solaris http://rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20211130T030003Z.fail.html.gz ``` 1) Failure: TestRubyOptions#test_require [/export/home/users/chkbuild/cb-gcc/tmp/build/20211130T030003Z/ruby/test/ruby/test_rubyoptions.rb:265]: pid 7386 exit 1 | /export/home/users/chkbuild/cb-gcc/tmp/build/20211130T030003Z/ruby/lib/pp.rb:67:in `winsize': Invalid argument - <STDOUT> (Errno::EINVAL) ```
2021-11-30lib/pp.rb (PP.pp): Use io/console's winsize by defaultYusuke Endoh
[Feature #12913]
2021-11-30[rubygems/rubygems] Fix escape of filenames in `bundle doctor`ooooooo-q
https://github.com/rubygems/rubygems/commit/3ede1435ea
2021-11-29[rubygems/rubygems] Deprecate typo nameNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/62d54cbf08
2021-11-29[ruby/readline] Suppress constant redefinition warningNobuyoshi Nakada
When already set by `use_lib_reline` in test/readline/helper.rb of readline-ext. https://github.com/ruby/readline/commit/0e3ca3b217
2021-11-28[ruby/ostruct] [DOC] Fix code markups [ci skip]Nobuyoshi Nakada
Backquotes are not special characters in RDoc. https://github.com/ruby/ostruct/commit/a901df26b9
2021-11-27[ruby/cgi] Exclude unused files from built packageNobuyoshi Nakada
https://github.com/ruby/cgi/commit/e840b6c368
2021-11-27[ruby/cgi] Set extconf.rb to extensionsNobuyoshi Nakada
Fix https://github.com/ruby/cgi/pull/11 https://github.com/ruby/cgi/commit/60d8f5e7d9
2021-11-27[rubygems/rubygems] Fix missing locked specs when depended on other platformDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0396e899db
2021-11-26mkmf: take `PKG_CONFIG_PATH` from `dir_config` library pathNobuyoshi Nakada
So that version dependent pkg-config files can override files in the default locations. Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-11-26mkmf: deal with environment variables in MakeMakefile#xpopenNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-11-26mkmf: MakeMakefile#xpopen may be passed an option hashNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-11-26[rubygems/rubygems] Fix `bundle info` sometimes claiming that bundler has ↵David Rodríguez
been deleted https://github.com/rubygems/rubygems/commit/fe1a31db31
2021-11-25[rubygems/rubygems] Don't replace ENV twice on non Windows platformsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8dc86b7096
2021-11-24[ruby/cgi] Bump versionYusuke Endoh
https://github.com/ruby/cgi/commit/c9c800715e