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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/actions/setup/macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ runs:
- name: brew
shell: bash
run: |
brew uninstall bicep
brew untap aws/tap azure/bicep
brew install --quiet jemalloc gmp libffi openssl@3 zlib autoconf automake libtool

- name: Set ENV
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ releases.
* 0.3.2 to [0.3.3][rss-0.3.3]
* net-imap 0.6.4.1
* 0.6.2 to [v0.6.3][net-imap-v0.6.3], [v0.6.4][net-imap-v0.6.4], [v0.6.4.1][net-imap-v0.6.4.1]
* rbs 4.0.2
* rbs 4.0.3
* 3.10.0 to [v3.10.1][rbs-v3.10.1], [v3.10.2][rbs-v3.10.2], [v3.10.3][rbs-v3.10.3], [v3.10.4][rbs-v3.10.4], [v4.0.0.dev.5][rbs-v4.0.0.dev.5], [v4.0.0][rbs-v4.0.0], [v4.0.2][rbs-v4.0.2]
* typeprof 0.32.0
* mutex_m 0.3.0
Expand Down
22 changes: 21 additions & 1 deletion gc/default/default.c
Original file line number Diff line number Diff line change
Expand Up @@ -4360,6 +4360,26 @@ gc_sweep_continue(rb_objspace_t *objspace, rb_heap_t *sweep_heap)
gc_sweeping_exit(objspace);
}

static void
gc_sweep_step_for_malloc(rb_objspace_t *objspace)
{
GC_ASSERT(is_lazy_sweeping(objspace));

unsigned int lock_lev;
gc_enter(objspace, gc_enter_event_continue, &lock_lev);

gc_sweeping_enter(objspace);

for (int i = 0; i < HEAP_COUNT; i++) {
rb_heap_t *heap = &heaps[i];
gc_sweep_step(objspace, heap);
}

gc_sweeping_exit(objspace);

gc_exit(objspace, gc_enter_event_continue, &lock_lev);
}

VALUE
rb_gc_impl_location(void *objspace_ptr, VALUE value)
{
Expand Down Expand Up @@ -8503,7 +8523,7 @@ objspace_malloc_increase_body(rb_objspace_t *objspace, void *mem, size_t new_siz
retry:
if (malloc_increase > malloc_limit && ruby_native_thread_p() && !dont_gc_val()) {
if (ruby_thread_has_gvl_p() && is_lazy_sweeping(objspace)) {
gc_rest(objspace); /* gc_rest can reduce malloc_increase */
gc_sweep_step_for_malloc(objspace); /* sweeping frees may reduce malloc_increase */
goto retry;
}
garbage_collect_with_gvl(objspace, GPR_FLAG_MALLOC);
Expand Down
2 changes: 1 addition & 1 deletion gems/bundled_gems
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ net-imap 0.6.4.1 https://github.com/ruby/net-imap
net-smtp 0.5.1 https://github.com/ruby/net-smtp
matrix 0.4.3 https://github.com/ruby/matrix
prime 0.1.4 https://github.com/ruby/prime
rbs 4.0.2 https://github.com/ruby/rbs 1582ce76429810b057a2816e5000cf5de4b1363d
rbs 4.0.3 https://github.com/ruby/rbs
typeprof 0.32.0 https://github.com/ruby/typeprof
debug 1.11.1 https://github.com/ruby/debug 6510cfbc7496c55ebbefa437a25c17ca58f7c5eb
racc 1.8.1 https://github.com/ruby/racc
Expand Down
48 changes: 33 additions & 15 deletions lib/bundler/installer/parallel_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,40 @@ def install_with_worker
end

def with_jobserver
r, w = IO.pipe
r.close_on_exec = false
w.close_on_exec = false
w.write("*" * @size)

old_makeflags = ENV["MAKEFLAGS"]
ENV["MAKEFLAGS"] = [old_makeflags, "--jobserver-auth=#{r.fileno},#{w.fileno}"].compact.join(" ")

yield
ensure
# Restore MAKEFLAGS before closing the pipe so a close failure can't
# leave the process with descriptors that point at a closed pipe.
old_makeflags ? ENV["MAKEFLAGS"] = old_makeflags : ENV.delete("MAKEFLAGS")
# The jobserver hands tokens to child `make` processes through MAKEFLAGS
# using the GNU make `--jobserver-auth` protocol. nmake, the default make
# on mswin, instead reads MAKEFLAGS as bare option letters and aborts
# every native extension build with `fatal error U1065: invalid option
# '-'`. Skip the jobserver when nmake is in use. Other Windows toolchains
# such as mingw use GNU make and keep working through the inherited pipe.
return yield if nmake?

begin
r, w = IO.pipe
r.close_on_exec = false
w.close_on_exec = false
w.write("*" * @size)

old_makeflags = ENV["MAKEFLAGS"]
ENV["MAKEFLAGS"] = [old_makeflags, "--jobserver-auth=#{r.fileno},#{w.fileno}"].compact.join(" ")

yield
ensure
# Restore MAKEFLAGS before closing the pipe so a close failure can't
# leave the process with descriptors that point at a closed pipe.
old_makeflags ? ENV["MAKEFLAGS"] = old_makeflags : ENV.delete("MAKEFLAGS")

r&.close
w&.close
end
end

r&.close
w&.close
# Mirror how RubyGems' extension builder picks the make program so the
# jobserver is only set up when a GNU-compatible make will consume it.
def nmake?
make = ENV["MAKE"] || ENV["make"]
make ||= "nmake" if RUBY_PLATFORM.include?("mswin")
/\bnmake/i.match?(make.to_s)
end

def install_serially
Expand Down
25 changes: 25 additions & 0 deletions spec/bundler/bundler/installer/parallel_installer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,29 @@ def redefine_build_jobs
Bundler::RubyGemsGemInstaller.define_method(:build_jobs, old_method)
end
end

describe "make jobserver with nmake" do
# nmake reads MAKEFLAGS from the environment and treats its contents as
# bare option letters, so a GNU make `--jobserver-auth` aborts the build
# with `fatal error U1065: invalid option '-'`. The jobserver must be
# skipped when nmake is the make program.
it "leaves MAKEFLAGS untouched" do
parallel_installer = Bundler::ParallelInstaller.new(nil, [], 5, false, false)

makeflags_before = ENV["MAKEFLAGS"]
makeflags_during = :not_yielded

old_make = ENV["MAKE"]
ENV["MAKE"] = "nmake"
begin
parallel_installer.send(:with_jobserver) do
makeflags_during = ENV["MAKEFLAGS"]
end
ensure
ENV["MAKE"] = old_make
end

expect(makeflags_during).to eq(makeflags_before)
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[123.456e-789]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/i_number_huge_exp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0.4e00669999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999969999999006]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-1e+9999]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1.5e+9999]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-123123e100000]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[123123e100000]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/i_number_real_underflow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[123e-10000000]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/i_number_too_big_neg_int.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-123123123123123123123123123123]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/i_number_too_big_pos_int.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[100000000000000000000]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-237462374673276894279832749832423479823246327846]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"\uDFAA":0}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\uDADA"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\uD888\u1234"]
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["日ш�"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["���"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\uD800\n"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\uDd1ea"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\uD800\uD800\n"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\ud800"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\ud800abc"]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/i_string_invalid_utf-8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["�"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\uDd1e\uD834"]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/i_string_iso_latin_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["�"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["\uDFAA"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["�"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["����"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["��"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["������"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["������"]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/i_string_truncated-utf-8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["��"]
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1 true]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_a_invalid_utf8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[a�]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["": 1]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[""],
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_comma_and_number.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[,1]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_double_comma.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1,,2]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["x",,]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_extra_close.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["x"]]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_extra_comma.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["",]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_incomplete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["x"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[x
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[3[4]]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_invalid_utf8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[�]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1:2]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_just_comma.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[,]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_just_minus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_missing_value.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ , ""]
3 changes: 3 additions & 0 deletions test/json/fixtures/minefield/n_array_newlines_unclosed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
["a",
4
,1,
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_number_and_comma.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1,]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1,,]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[" a"\f]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_star_inside.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[*]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_array_unclosed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1,
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[1,
1
,1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{}
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_incomplete_false.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[fals]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_incomplete_null.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[nul]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_incomplete_true.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[tru]
Binary file not shown.
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_++.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[++1234]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_+1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[+1]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_+Inf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[+Inf]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_-01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-01]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_-1.0..json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-1.0.]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_-2..json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-2.]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_-NaN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-NaN]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_.-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[.-1]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_.2e-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[.2e-3]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_0.1.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0.1.2]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_0.3e+.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0.3e+]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_0.3e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0.3e]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_0.e1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0.e1]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_0_capital_E+.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0E+]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_0_capital_E.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0E]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_0e+.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0e+]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_0e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[0e]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_1.0e+.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1.0e+]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_1.0e-.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1.0e-]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_1.0e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1.0e]
1 change: 1 addition & 0 deletions test/json/fixtures/minefield/n_number_1_000.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1 000.0]
Loading