mirror of
https://github.com/ruby/ruby.git
synced 2026-08-01 02:20:48 +08:00
[ruby/psych] Require libfyaml 0.9 and build it from source in CI
The libfyaml-dev package on Ubuntu is 0.8, which segfaults psych's emitter, while 0.9.6 (used on macOS via Homebrew) passes the whole suite. Build the same 0.9.6 release from source in the Linux CI job, and reject libfyaml older than 0.9 in extconf so users get a clear error instead of a runtime crash. Also drop an unused variable in set_canonical. https://github.com/ruby/psych/commit/88ac4a0cc0 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
82ab14ecb0
commit
5ef8b6ef81
@ -12,6 +12,12 @@ if enable_config("libfyaml", false)
|
||||
unless pkg_config('libfyaml')
|
||||
abort "libfyaml was requested with --enable-libfyaml but was not found via pkg-config"
|
||||
end
|
||||
# libfyaml 0.8 and earlier crash psych's emitter, so require a known-good
|
||||
# version rather than building something that segfaults at runtime.
|
||||
pkgconfig = ENV["PKG_CONFIG"] || "pkg-config"
|
||||
unless system(pkgconfig, "--atleast-version=0.9", "libfyaml")
|
||||
abort "The libfyaml backend requires libfyaml 0.9 or newer"
|
||||
end
|
||||
$defs << "-DPSYCH_USE_LIBFYAML"
|
||||
|
||||
create_makefile 'psych'
|
||||
|
||||
@ -408,8 +408,6 @@ static VALUE alias(VALUE self, VALUE anchor)
|
||||
|
||||
static VALUE set_canonical(VALUE self, VALUE style)
|
||||
{
|
||||
psych_fy_emitter_t *e;
|
||||
TypedData_Get_Struct(self, psych_fy_emitter_t, &psych_emitter_type, e);
|
||||
/* libfyaml has no canonical emit mode, so reject enabling it rather than
|
||||
* pretending to honor the request. */
|
||||
if (RTEST(style)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user