Граф коммитов

2105 Коммитов

Автор SHA1 Сообщение Дата
Ellen Marie Dash 4f2f1ddf22 [rubygems/rubygems] Test that git sources in lockfiles have stable sort order
https://github.com/rubygems/rubygems/commit/4c982684ea
2023-07-04 14:54:26 +09:00
David Rodríguez 09382135de [rubygems/rubygems] Fix git source lockfile unstability
We have some flags that limit running git commit commands under certain
situations, for example, when running under `--local`. However, those
should only affect remote git operations, not local read-only operations
like `git --version`, or `git rev-parse --abbrev-ref HEAD`.

This commit refactors things to achieve that.

By doing this, the `#to_s` representation of a source is more
consistent, since we don't get any errors when reading the checked out
branch, and we avoid some flip-flop lockfile issues.

https://github.com/rubygems/rubygems/commit/4a529fce81
2023-07-04 14:54:26 +09:00
David Rodríguez 0fcb4c6af7 [rubygems/rubygems] Fix another incorrect removal of "ruby" platform from lockfile
When dependencies in path sources have changed, we'll be re-resolving,
and we can't really know whether the resolution will be valid or invalid
for the Ruby platform, so skip the removal in that case.

https://github.com/rubygems/rubygems/commit/afc3b0956f
2023-07-04 14:54:25 +09:00
Benoit Daloze 515bd42144 Update to ruby/spec@30e1c35 2023-06-26 15:55:11 +02:00
Benoit Daloze f73fa29927 Update to ruby/mspec@3cf2d16 2023-06-26 15:55:09 +02:00
Samuel Williams a87bce86bb
Allow setting the name of a class or module. (#7483)
Introduce `Module#set_temporary_name` for setting identifiers for otherwise
anonymous modules/classes.
2023-06-21 16:49:51 +09:00
Hiroshi SHIBATA 1edbaa850f Merge rubygems/rubygems HEAD
Pick from 880dd95996
2023-06-20 13:35:13 +09:00
Hiroshi SHIBATA 2c219ab215 [rubygems/rubygems] Rubocop 1.51.0 or later didn't support Ruby 2.6
https://github.com/rubygems/rubygems/commit/522b5f1ecd
2023-06-15 07:01:27 +09:00
David Rodríguez 3e7f5b02ae [rubygems/rubygems] Improve error message in frozen mode edge case
When a top level dependency is missing from the lockfile, and we're in
frozen mode, we should also print a "frozen error".

https://github.com/rubygems/rubygems/commit/3e82b835e3
2023-06-15 07:01:25 +09:00
David Rodríguez e86f4c581b [rubygems/rubygems] Improve frozen mode error message
This error message is also printed when using `bundler/setup` in frozen
model, so we're not necessarily installing any gems when it happens.

This new message play nicer with all situations.

https://github.com/rubygems/rubygems/commit/6874bbacce
2023-06-15 07:01:25 +09:00
David Rodríguez 23ecaab8dd [rubygems/rubygems] Use "frozen" rather than "deployment" in error message
I think it communicates better what's going on.

https://github.com/rubygems/rubygems/commit/07a25767a4
2023-06-15 07:01:24 +09:00
David Rodríguez 2ff9b7b93d [rubygems/rubygems] Show missing spec in lockfile incomplete error message
https://github.com/rubygems/rubygems/commit/b86caaa3d5
2023-06-15 07:01:24 +09:00
David Rodríguez e7749c4dea [rubygems/rubygems] Remove weird line breaks in the middle of error message
https://github.com/rubygems/rubygems/commit/22b8caf42f
2023-06-15 07:01:21 +09:00
David Rodríguez 96e3f31c1e [rubygems/rubygems] Make frozen mode spec also pass on Bundler 3
https://github.com/rubygems/rubygems/commit/ad52f840f2
2023-06-15 07:01:20 +09:00
David Rodríguez e1038f943f [rubygems/rubygems] This spec is independent from global sources
https://github.com/rubygems/rubygems/commit/d91c245921
2023-06-15 07:01:20 +09:00
Gareth Adams eaf11d3dd4 [rubygems/rubygems] Stop publishing Gemfile in default gem template
Similarly to how the other ignored files are intended for local
development and not for production, the Gemfile and Gemfile.lock files
for a gem only relate to local development and aren't useful to people
installing the gem.

https://github.com/rubygems/rubygems/commit/59049c04be
2023-06-08 15:20:05 +00:00
David Rodríguez 03246719cc [rubygems/rubygems] Fix `path` vs `deployment` precedence when path set through ENV
The `deployment` setting sets `path` to `vendor/bundle` implicitly, but
that should only apply if `path` is not set explicitly, at any level.

https://github.com/rubygems/rubygems/commit/3552c064c1
2023-06-06 10:52:57 +09:00
David Rodríguez 7b317243ad [rubygems/rubygems] Unexclude some specs on bundler 3
These should all be passing on Bundler 3.

https://github.com/rubygems/rubygems/commit/4a8c172965
2023-06-06 10:52:56 +09:00
David Rodríguez 6353f1d5e8 [rubygems/rubygems] Fill in missing deployment specs
https://github.com/rubygems/rubygems/commit/e16aa47b8f
2023-06-06 10:52:56 +09:00
David Rodríguez 603772440c [rubygems/rubygems] Remove redundant specs
They are already tested above.

https://github.com/rubygems/rubygems/commit/23073dcece
2023-06-06 10:52:55 +09:00
David Rodríguez 1f9e66836b [rubygems/rubygems] Fix inline mode with multiple sources
If we're in inline mode, Bundler first resolves using only local gems,
and if some gems are missing, then it re-resolves using remote gems.
However, "source resolution" from the initial "local" try was being
memoized, resulting in Bundler not looking for some gems remotely in the
second resolution.

This commit forces a proper re-resolve in this case.

https://github.com/rubygems/rubygems/commit/fdc631075e
2023-06-06 10:52:53 +09:00
Benoit Daloze 957b6a491f rb_io_descriptor() is available since 3.1 2023-06-01 11:41:41 +02:00
Samuel Williams a218ed5692
Hide the usage of `rb_io_t` where possible. (#7880)
This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
2023-06-01 14:23:30 +09:00
NARUSE, Yui 85dcc4866d Revert "Hide most of the implementation of `struct rb_io`. (#6511)"
This reverts commit 18e55fc1e1.

fix [Bug #19704]
https://bugs.ruby-lang.org/issues/19704
This breaks compatibility for extension libraries. Such changes
need a discussion.
2023-06-01 08:43:22 +09:00
Hiroshi SHIBATA 3bc5f6b240
[rubygems/rubygems] tool_dir needs to handle ruby/ruby repo now
https://github.com/rubygems/rubygems/commit/550d90f4ba
2023-05-31 13:55:30 +09:00
Hiroshi SHIBATA 4bbeed6134 Merge RubyGems/Bundler master from 4076391fce5847689bf2ec402b17133fe4e32285 2023-05-30 21:50:07 +09:00
Samuel Williams 18e55fc1e1
Hide most of the implementation of `struct rb_io`. (#6511)
* Add rb_io_path and rb_io_open_descriptor.

* Use rb_io_open_descriptor to create PTY objects

* Rename FMODE_PREP -> FMODE_EXTERNAL and expose it

FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but
FMODE_EXTERNAL is clearer about what the file descriptor represents and
aligns with language in the IO::Buffer module.

* Ensure that rb_io_open_descriptor closes the FD if it fails

If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be
responsible for closing your file, eventually, if you pass it to
rb_io_open_descriptor, even if it raises an exception.

* Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P

* Expose `rb_io_closed_p`.

* Add `rb_io_mode` to get IO mode.

---------

Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
2023-05-30 10:02:40 +09:00
Benoit Daloze 99ce41564e Refactor guards for Time.new spec 2023-05-29 18:33:51 +02:00
Peter Zhu b7a26dfa16 Unify error messages of rb_num2ulong and rb_num2ull
The error messages were slightly different due, which causes different
behaviour on 32-bit and 64-bit systems.
2023-05-29 11:55:39 -04:00
Benoit Daloze c48d496e8c Update to ruby/spec@c3677cf 2023-05-29 15:27:57 +02:00
Samuel Williams 6d976eb534
Fix "runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO" on Windows. (#7848)
* Enable borked spec.

* Ensure win32 wrappers are visible and used.

* Reorganise `read`/`write`/`pipe` in `thread_spec.c`.
2023-05-24 22:45:34 +09:00
Nobuyoshi Nakada d8da563f9e
Add a newline at EOF [ci skip] 2023-05-24 15:04:07 +09:00
Samuel Williams 28056a6d16
Add support for pread/pwrite on windows. (#7827) 2023-05-24 09:15:20 +09:00
Jean byroot Boussier 31ac8efca8
Hash.new: print a deprecation warning when receiving keyword arguments (#7828)
[Feature #19236]

In Ruby 3.3, `Hash.new` shall print a deprecation warning if keyword arguments
are passed instead of treating them as an implicit positional Hash.

This will allow to safely introduce a `capacity` keyword argument in 3.4

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2023-05-23 15:51:28 +02:00
Hiroshi SHIBATA a7d7032100
Manually merge syntax_suggest-1.1.0 2023-05-23 10:05:47 +09:00
schneems c638ffa700
[ruby/syntax_suggest] Fix
https://github.com/ruby/syntax_suggest/pull/187 Handle if/else with
empty/comment
line

Reported in #187 this code:

```
class Foo
  def foo
    if cond?
      foo
    else
      # comment
    end
  end

  # ...

  def bar
    if @recv
    end_is_missing_here
  end
end
```

Triggers an incorrect suggestion:

```
Unmatched keyword, missing `end' ?
   1  class Foo
   2    def foo
>  3      if cond?
>  5      else
   8    end
  16  end
```

Part of the issue is that while scanning we're using newlines to determine when to stop and pause. This is useful for determining logically smaller chunks to evaluate but in this case it causes us to pause before grabbing the "end" that is right below the newline. This problem is similar to https://github.com/ruby/syntax_suggest/pull/179.

However in the case of expanding same indentation "neighbors" I want to always grab all empty values at the end of the scan. I don't want to do that when changing indentation levels as it affects scan results.

There may be some way to normalize this behavior between the two, but the tests really don't like that change.

To fix this issue for expanding against different indentation I needed a way to first try and grab any additional newlines with the ability to rollback that guess. In #192 I experimented with decoupling scanning from the AroundBlockScan logic. It also added the ability to take a snapshot of the current scanner and rollback to prior changes.

With this ability in place now we:

- Grab extra empties before looking at the above/below line for the matching keyword/end statement
- If there's a match, grab it
- If there's no match, discard the newlines we picked up in the evaluation

That solves the issue.

https://github.com/ruby/syntax_suggest/commit/513646b912
2023-05-23 10:05:47 +09:00
schneems aaf815c626
[ruby/syntax_suggest] Refactor Scanner logic out of AroundBlockScan introduce history
AroundBlockScan started as a utility class that was meant to be used as a DSL for scanning and making new blocks. As logic got added to this class it became hard to reason about what exactly is being mutated when. I pulled the scanning logic out into it's own class which gives us a clean separation of concerns. This allowed me to remove a lot of accessors that aren't core to the logic provided by AroundBlockScan.

In addition to this refactor the ScanHistory class can snapshot a scan. This allows us to be more aggressive with scans in the future as we can now snapshot and rollback if it didn't turn out the way we wanted.

The change comes with a minor perf impact:

before: 5.092678   0.104299   5.196977 (  5.226494)
after: 5.128536   0.099871   5.228407 (  5.249542)

This represents a 0.996x change in speed (where 1x would be no change and 2x would be twice as fast). This is a 0.38% decrease in performance which is negligible. It's likely coming from the extra blocks being created while scanning. This is negligible and if the history feature works well we might be able to make better block decisions which is means fewer calls to ripper which is the biggest bottleneck.

While this doesn't fix https://github.com/ruby/syntax_suggest/issues/187 it's a good intermediate step that will hopefully make working on that issue easier.

https://github.com/ruby/syntax_suggest/commit/ad8487d8aa
2023-05-23 10:05:47 +09:00
Ivanov-Anton 1dd5427abe
Fix typo in spec file description [ci skip]
fixed typo for spec description
2023-05-21 09:59:34 +09:00
Samuel Williams 2df5a697e2
Add Fiber#kill, similar to Thread#kill. (#7823) 2023-05-18 23:33:42 +09:00
Martin Dürst 30326844c7 fix wording of spec description [ci skip] 2023-05-13 10:07:00 +09:00
Nobuyoshi Nakada 2d9bc3efe5 [Bug #19597] Freeze script name 2023-05-10 17:14:20 +09:00
Hiroshi SHIBATA 0ef6e718d9
Merge https://github.com/rubygems/rubygems/pull/6655 manually. 2023-05-10 15:02:29 +09:00
Hiroshi SHIBATA 9d3ab15827 Relax regexp for console assertion 2023-05-09 12:57:12 +09:00
Jean Boussier 6339cb70c3 marshal.c: shallow freeze user objects
When `freeze: true` argument is passed.

[Bug #19427]
2023-04-26 16:54:25 +02:00
Benoit Daloze 82995d4615 Update to ruby/spec@7f6ca5b 2023-04-25 17:27:57 +02:00
Benoit Daloze e3d05001ed Workaround CRuby adding x86_64-linux-fake in $LOADED_FEATURES 2023-04-25 17:09:53 +02:00
Benoit Daloze d562663e40 Update to ruby/spec@7f69c86 2023-04-25 17:09:53 +02:00
Benoit Daloze d3da01cd11 Update to ruby/mspec@1d8cf64 2023-04-25 17:09:53 +02:00
schneems 3d5febf65b [ruby/syntax_suggest] Clean up output
I previously left a comment stating I didn't know why a certain method existed. In investigating the code in `CaptureCodeContext#capture_before_after_kws` I found that it was added as to give a slightly less noisy output.

The docs for AroundBlockScan#capture_neighbor_context only describe keywords as being a primary concern. I modified that code to only include lines that are keywords or ends. This reduces the output noise even more.

This allows me to remove that `start_at_next_line` method.

One weird side effect of the prior logic is it would cause this code to produce this output:

```
        class OH
          def hello

          def hai
          end
        end
```

```
          1  class OH
        > 2    def hello
          4    def hai
          5    end
          6  end
```

But this code to produce this output:

```
        class OH
          def hello
          def hai
          end
        end
```

```
          1  class OH
        > 2    def hello
          4    end
          5  end
```
Note the missing `def hai`. The only difference between them is that space.

With this change, they're now both consistent.

https://github.com/ruby/syntax_suggest/commit/4a54767a3e
2023-04-25 14:43:06 +09:00
Hiroshi SHIBATA f77dc6fb16 [ruby/syntax_suggest] standardrb --fix-unsafely spec/spec_helper.rb
https://github.com/ruby/syntax_suggest/commit/6e266b3b2b
2023-04-25 14:43:05 +09:00