Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,30 +177,30 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
if: ${{ failure() }}

# make-ibm:
# strategy:
# matrix:
# include:
# - test_task: check
# os: ubuntu-24.04-ppc64le
# - test_task: check
# os: ubuntu-24.04-s390x
# fail-fast: false

# env: *make-env

# runs-on: ${{ matrix.os }}

# if: >-
# ${{github.repository == 'ruby/ruby'
# && !(false
# || contains(github.event.head_commit.message, '[DOC]')
# || contains(github.event.pull_request.title, '[DOC]')
# || contains(github.event.pull_request.labels.*.name, 'Documentation')
# || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
# )}}

# steps: *make-steps
make-ibm:
strategy:
matrix:
include:
- test_task: check
os: ubuntu-24.04-ppc64le
- test_task: check
os: ubuntu-24.04-s390x
fail-fast: false

env: *make-env

runs-on: ${{ matrix.os }}

if: >-
${{github.repository == 'ruby/ruby'
&& !(false
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps: *make-steps

# Separated from `make` job to avoid making it a required status check
ruby-bench:
Expand Down
4 changes: 4 additions & 0 deletions depend
Original file line number Diff line number Diff line change
Expand Up @@ -11091,6 +11091,7 @@ pathname.$(OBJEXT): {$(VPATH)}st.h
pathname.$(OBJEXT): {$(VPATH)}subst.h
prism/api_node.$(OBJEXT): $(hdrdir)/ruby.h
prism/api_node.$(OBJEXT): $(hdrdir)/ruby/ruby.h
prism/api_node.$(OBJEXT): $(hdrdir)/ruby/version.h
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/api_node.c
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/ast.h
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/defines.h
Expand Down Expand Up @@ -11286,6 +11287,7 @@ prism/api_node.$(OBJEXT): {$(VPATH)}st.h
prism/api_node.$(OBJEXT): {$(VPATH)}subst.h
prism/api_pack.$(OBJEXT): $(hdrdir)/ruby.h
prism/api_pack.$(OBJEXT): $(hdrdir)/ruby/ruby.h
prism/api_pack.$(OBJEXT): $(hdrdir)/ruby/version.h
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/api_pack.c
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/ast.h
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/defines.h
Expand Down Expand Up @@ -11496,6 +11498,7 @@ prism/encoding.$(OBJEXT): $(top_srcdir)/prism/encoding.h
prism/encoding.$(OBJEXT): $(top_srcdir)/prism/util/pm_strncasecmp.h
prism/extension.$(OBJEXT): $(hdrdir)/ruby.h
prism/extension.$(OBJEXT): $(hdrdir)/ruby/ruby.h
prism/extension.$(OBJEXT): $(hdrdir)/ruby/version.h
prism/extension.$(OBJEXT): $(top_srcdir)/prism/ast.h
prism/extension.$(OBJEXT): $(top_srcdir)/prism/defines.h
prism/extension.$(OBJEXT): $(top_srcdir)/prism/diagnostic.h
Expand Down Expand Up @@ -11885,6 +11888,7 @@ prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/util/pm_strpbrk.c
prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/util/pm_strpbrk.h
prism_init.$(OBJEXT): $(hdrdir)/ruby.h
prism_init.$(OBJEXT): $(hdrdir)/ruby/ruby.h
prism_init.$(OBJEXT): $(hdrdir)/ruby/version.h
prism_init.$(OBJEXT): $(top_srcdir)/prism/ast.h
prism_init.$(OBJEXT): $(top_srcdir)/prism/defines.h
prism_init.$(OBJEXT): $(top_srcdir)/prism/diagnostic.h
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ def converge_specs(specs)
end
end

if parent_dep && parent_dep.source.is_a?(Source::Path)
if parent_dep && parent_dep.source.is_a?(Source::Path) && parent_dep.source.specs[s]&.any?
replacement_source = parent_dep.source
else
replacement_source = sources.get(lockfile_source)
Expand Down
47 changes: 36 additions & 11 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -13839,16 +13839,17 @@ value_expr_check(struct parser_params *p, NODE *node)
case NODE_RESCUE:
/* void only if all children are void */
vn = RNODE_RESCUE(node)->nd_head;
if (!vn || !(vn = value_expr_check(p, vn))) return NULL;
if (!vn || !(vn = value_expr_check(p, vn))) {
if (!RNODE_RESCUE(node)->nd_else) return NULL;
}
if (!void_node) void_node = vn;
for (NODE *r = RNODE_RESCUE(node)->nd_resq; r; r = RNODE_RESBODY(r)->nd_next) {
if (!nd_type_p(r, NODE_RESBODY)) {
compile_error(p, "unexpected node");
return NULL;
}
if (!(vn = value_expr_check(p, RNODE_RESBODY(r)->nd_body))) {
void_node = 0;
break;
return NULL;
}
if (!void_node) void_node = vn;
}
Expand All @@ -13863,19 +13864,43 @@ value_expr_check(struct parser_params *p, NODE *node)
case NODE_RETRY:
goto found;

case NODE_CASE3:
if (!RNODE_CASE3(node)->nd_body || !nd_type_p(RNODE_CASE3(node)->nd_body, NODE_IN)) {
compile_error(p, "unexpected node");
return NULL;
case NODE_CASE:
case NODE_CASE2:
for (node = RNODE_CASE(node)->nd_body;
node && nd_type_p(node, NODE_WHEN);
node = RNODE_WHEN(node)->nd_next) {
if (!(vn = value_expr_check(p, RNODE_WHEN(node)->nd_body))) {
return NULL;
}
if (!void_node) void_node = vn;
}
if (RNODE_IN(RNODE_CASE3(node)->nd_body)->nd_body) {
return NULL;
break;

case NODE_CASE3:
{
NODE *in = RNODE_CASE3(node)->nd_body;
if (!in || !nd_type_p(in, NODE_IN)) {
compile_error(p, "unexpected node");
return NULL;
}
if (!RNODE_IN(in)->nd_body) {
/* single line pattern matching with "=>" operator */
goto found;
}
do {
vn = value_expr_check(p, RNODE_IN(in)->nd_body);
if (!vn) return NULL;
if (!void_node) void_node = vn;
in = RNODE_IN(in)->nd_next;
} while (in && nd_type_p(in, NODE_IN));
node = in; /* else */
}
/* single line pattern matching with "=>" operator */
goto found;
break;

case NODE_BLOCK:
while (RNODE_BLOCK(node)->nd_next) {
vn = value_expr_check(p, RNODE_BLOCK(node)->nd_head);
if (vn) return vn;
node = RNODE_BLOCK(node)->nd_next;
}
node = RNODE_BLOCK(node)->nd_head;
Expand Down
20 changes: 1 addition & 19 deletions rubyparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,25 +289,7 @@ typedef struct RNode_CASE {
struct RNode *nd_body;
rb_code_location_t case_keyword_loc;
rb_code_location_t end_keyword_loc;
} rb_node_case_t;

typedef struct RNode_CASE2 {
NODE node;

struct RNode *nd_head;
struct RNode *nd_body;
rb_code_location_t case_keyword_loc;
rb_code_location_t end_keyword_loc;
} rb_node_case2_t;

typedef struct RNode_CASE3 {
NODE node;

struct RNode *nd_head;
struct RNode *nd_body;
rb_code_location_t case_keyword_loc;
rb_code_location_t end_keyword_loc;
} rb_node_case3_t;
} rb_node_case_t, rb_node_case2_t, rb_node_case3_t;

typedef struct RNode_WHEN {
NODE node;
Expand Down
2 changes: 1 addition & 1 deletion spec/bundled_gems_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def my
# Original issue is childprocess 5.0.0 and logger.
build_lib "fileutils2", "5.0.0" do |s|
# bootsnap expand required feature to full path
rubylibpath = File.expand_path(File.join(__dir__, "..", "lib"))
rubylibpath = File.realpath(File.join(__dir__, "..", "lib"))
s.write "lib/fileutils2.rb", "require '#{rubylibpath}/fileutils'"
end

Expand Down
74 changes: 74 additions & 0 deletions spec/bundler/install/gemfile/sources_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1236,4 +1236,78 @@
expect(the_bundle).to include_gems("fallback_dep 1.0.0", source: "remote2")
end
end

context "when a path gem has a transitive dependency that does not exist in the path source" do
before do
build_repo2 do
build_gem "missing_dep", "1.0.0"
build_gem "foo", "1.0.0"
end

build_lib "parent_gem", "1.0.0", path: lib_path("parent_gem") do |s|
s.add_dependency "missing_dep"
end

gemfile <<-G
source "https://gem.repo2"

gem "foo"

gem "parent_gem", path: "#{lib_path("parent_gem")}"
G

bundle :install, artifice: "compact_index"
end

it "falls back to the default rubygems source for that dependency when updating" do
build_repo2 do
build_gem "foo", "2.0.0"
end

system_gems []

bundle "update foo", artifice: "compact_index"

expect(the_bundle).to include_gems("parent_gem 1.0.0", "missing_dep 1.0.0", "foo 2.0.0")
expect(the_bundle).to include_gems("parent_gem 1.0.0", source: "path@#{lib_path("parent_gem")}")
expect(the_bundle).to include_gems("missing_dep 1.0.0", source: "remote2")
end
end

context "when a git gem has a transitive dependency that does not exist in the git source" do
before do
build_repo2 do
build_gem "missing_dep", "1.0.0"
build_gem "foo", "1.0.0"
end

build_git "parent_gem", "1.0.0", path: lib_path("parent_gem") do |s|
s.add_dependency "missing_dep"
end

gemfile <<-G
source "https://gem.repo2"

gem "foo"

gem "parent_gem", git: "#{lib_path("parent_gem")}"
G

bundle :install, artifice: "compact_index"
end

it "falls back to the default rubygems source for that dependency when updating" do
build_repo2 do
build_gem "foo", "2.0.0"
end

system_gems []

bundle "update foo", artifice: "compact_index"

expect(the_bundle).to include_gems("parent_gem 1.0.0", "missing_dep 1.0.0", "foo 2.0.0")
expect(the_bundle).to include_gems("parent_gem 1.0.0", source: "git@#{lib_path("parent_gem")}")
expect(the_bundle).to include_gems("missing_dep 1.0.0", source: "remote2")
end
end
end
2 changes: 1 addition & 1 deletion spec/bundler/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# If we use shared GEM_HOME and install multiple versions, it may cause
# unexpected test failures.
gem "diff-lcs"
gem "diff-lcs", "< 2.0"

require "rspec/core"
require "rspec/expectations"
Expand Down
Loading