Skip to content

Commit

Permalink
Merge branch 'master' into wip/travis-arm64-allow-failures
Browse files Browse the repository at this point in the history
  • Loading branch information
XrXr authored Aug 30, 2024
2 parents 0b4a52c + eef2121 commit 6aa58a6
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 30 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ jobs:
sudo sysctl -w kern.coredump=1
sudo chmod -R +rwx /cores/
- name: Delete unused SDKs
# To free up disk space to not run out during the run
run: |
sudo rm -rf ~/.dotnet
sudo rm -rf /Library/Android
sudo rm -rf /Library/Developer/CoreSimulator
continue-on-error: true

- name: Run configure
run: ../src/configure -C --disable-install-doc ${ruby_configure_args}

Expand Down
34 changes: 10 additions & 24 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2111,19 +2111,16 @@ each_location(register const VALUE *x, register long n, void (*cb)(void *data, V
}

static void
gc_mark_locations(const VALUE *start, const VALUE *end, void (*cb)(void *, VALUE), void *data)
each_location_ptr(const VALUE *start, const VALUE *end, void (*cb)(void *, VALUE), void *data)
{
long n;

if (end <= start) return;
n = end - start;
each_location(start, n, cb, data);
each_location(start, end - start, cb, data);
}

void
rb_gc_mark_locations(const VALUE *start, const VALUE *end)
{
gc_mark_locations(start, end, rb_gc_impl_mark_maybe, rb_gc_get_objspace());
each_location_ptr(start, end, rb_gc_impl_mark_maybe, rb_gc_get_objspace());
}

void
Expand Down Expand Up @@ -2240,17 +2237,6 @@ mark_m_tbl(void *objspace, struct rb_id_table *tbl)
((start) = STACK_END, (end) = STACK_START) : ((start) = STACK_START, (end) = STACK_END+(appendix)))
#endif

static void
each_stack_location(const VALUE *stack_start, const VALUE *stack_end, void (*cb)(void *data, VALUE obj), void *data)
{
gc_mark_locations(stack_start, stack_end, cb, data);

#if defined(__mc68000__)
gc_mark_locations((VALUE*)((char*)stack_start + 2),
(VALUE*)((char*)stack_end - 2), cb, data);
#endif
}

struct mark_machine_stack_location_maybe_data {
void *objspace;
#ifdef RUBY_ASAN_ENABLED
Expand All @@ -2275,7 +2261,7 @@ gc_mark_machine_stack_location_maybe(void *data, VALUE obj)
&fake_frame_start, &fake_frame_end
);
if (is_fake_frame) {
each_stack_location(fake_frame_start, fake_frame_end, rb_gc_impl_mark_maybe, objspace);
each_location_ptr(fake_frame_start, fake_frame_end, rb_gc_impl_mark_maybe, objspace);
}
#endif
}
Expand All @@ -2298,10 +2284,10 @@ static void
mark_current_machine_context(void *objspace, rb_execution_context_t *ec)
{
emscripten_scan_stack(rb_mark_locations);
each_stack_location(rb_stack_range_tmp[0], rb_stack_range_tmp[1], rb_gc_impl_mark_maybe, objspace);
each_location_ptr(rb_stack_range_tmp[0], rb_stack_range_tmp[1], rb_gc_impl_mark_maybe, objspace);

emscripten_scan_registers(rb_mark_locations);
each_stack_location(rb_stack_range_tmp[0], rb_stack_range_tmp[1], rb_gc_impl_mark_maybe, objspace);
each_location_ptr(rb_stack_range_tmp[0], rb_stack_range_tmp[1], rb_gc_impl_mark_maybe, objspace);
}
# else // use Asyncify version

Expand All @@ -2311,10 +2297,10 @@ mark_current_machine_context(void *objspace, rb_execution_context_t *ec)
VALUE *stack_start, *stack_end;
SET_STACK_END;
GET_STACK_BOUNDS(stack_start, stack_end, 1);
each_stack_location(stack_start, stack_end, rb_gc_impl_mark_maybe, objspace);
each_location_ptr(stack_start, stack_end, rb_gc_impl_mark_maybe, objspace);

rb_wasm_scan_locals(rb_mark_locations);
each_stack_location(rb_stack_range_tmp[0], rb_stack_range_tmp[1], rb_gc_impl_mark_maybe, objspace);
each_location_ptr(rb_stack_range_tmp[0], rb_stack_range_tmp[1], rb_gc_impl_mark_maybe, objspace);
}

# endif
Expand Down Expand Up @@ -2349,7 +2335,7 @@ mark_current_machine_context(void *objspace, rb_execution_context_t *ec)
};

each_location(save_regs_gc_mark.v, numberof(save_regs_gc_mark.v), gc_mark_machine_stack_location_maybe, &data);
each_stack_location(stack_start, stack_end, gc_mark_machine_stack_location_maybe, &data);
each_location_ptr(stack_start, stack_end, gc_mark_machine_stack_location_maybe, &data);
}
#endif

Expand All @@ -2368,7 +2354,7 @@ rb_gc_mark_machine_context(const rb_execution_context_t *ec)
#endif
};

each_stack_location(stack_start, stack_end, gc_mark_machine_stack_location_maybe, &data);
each_location_ptr(stack_start, stack_end, gc_mark_machine_stack_location_maybe, &data);
int num_regs = sizeof(ec->machine.regs)/(sizeof(VALUE));
each_location((VALUE*)&ec->machine.regs, num_regs, gc_mark_machine_stack_location_maybe, &data);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/cli/outdated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def run
end

if options[:parseable]
Bundler.ui.silence(&definition_resolution)
Bundler.ui.progress(&definition_resolution)
else
definition_resolution.call
end
Expand Down
4 changes: 2 additions & 2 deletions lib/bundler/source/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def to_gemfile
end

def hash
[self.class, uri, ref, branch, name, version, glob, submodules].hash
[self.class, uri, ref, branch, name, glob, submodules].hash
end

def eql?(other)
other.is_a?(Git) && uri == other.uri && ref == other.ref &&
branch == other.branch && name == other.name &&
version == other.version && glob == other.glob &&
glob == other.glob &&
submodules == other.submodules
end

Expand Down
12 changes: 12 additions & 0 deletions lib/bundler/ui/shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ def silence(&blk)
with_level("silent", &blk)
end

def progress(&blk)
with_output_stream(:stderr, &blk)
end

def unprinted_warnings
[]
end
Expand Down Expand Up @@ -170,6 +174,14 @@ def with_level(level)
ensure
@level = original
end

def with_output_stream(symbol)
original = output_stream
self.output_stream = symbol
yield
ensure
@output_stream = original
end
end
end
end
4 changes: 4 additions & 0 deletions lib/bundler/ui/silent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def silence
yield
end

def progress
yield
end

def unprinted_warnings
@warnings
end
Expand Down
25 changes: 23 additions & 2 deletions spec/bundler/commands/outdated_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,19 +438,40 @@ def test_group_option(group)
G
end

it "outputs a sorted list of outdated gems with a more minimal format" do
it "outputs a sorted list of outdated gems with a more minimal format to stdout" do
minimal_output = "activesupport (newest 3.0, installed 2.3.5, requested = 2.3.5)\n" \
"weakling (newest 0.2, installed 0.0.3, requested ~> 0.0.1)"
subject
expect(out).to eq(minimal_output)
end

it "outputs progress to stderr" do
subject
expect(err).to include("Fetching gem metadata")
end
end

context "and no gems are outdated" do
it "has empty output" do
before do
build_repo2 do
build_gem "activesupport", "3.0"
end

install_gemfile <<-G
source "https://gem.repo2"
gem "activesupport", "3.0"
G
end

it "does not output to stdout" do
subject
expect(out).to be_empty
end

it "outputs progress to stderr" do
subject
expect(err).to include("Fetching gem metadata")
end
end
end

Expand Down
19 changes: 19 additions & 0 deletions spec/bundler/install/gemfile/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,25 @@
run "require 'new_file'"
expect(out).to eq("USING GIT")
end

it "doesn't explode when removing an explicit exact version from a git gem with dependencies" do
build_lib "activesupport", "7.1.4", path: lib_path("rails/activesupport")
build_git "rails", "7.1.4", path: lib_path("rails") do |s|
s.add_dependency "activesupport", "= 7.1.4"
end

install_gemfile <<-G
source "https://gem.repo1"
gem "rails", "7.1.4", :git => "#{lib_path("rails")}"
G

install_gemfile <<-G
source "https://gem.repo1"
gem "rails", :git => "#{lib_path("rails")}"
G

expect(the_bundle).to include_gem "rails 7.1.4", "activesupport 7.1.4"
end
end

describe "bundle install after the remote has been updated" do
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/install/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
expect(the_bundle).to include_gems "foo 2.0", source: "git@#{lib_path("foo")}"
end

it "should allows git repos that are missing but not being installed" do
it "allows git repos that are missing but not being installed" do
revision = build_git("foo").ref_for("HEAD")

gemfile <<-G
Expand Down

0 comments on commit 6aa58a6

Please sign in to comment.