Update zlib version to resolve build errors. #274
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
ruby.wasm has been failing to build for the past week.
For example, the following GitHub Actions job:
https://github.com/ruby/ruby.wasm/actions/runs/5965503425/job/16183103917
Errors are as follows:
Also,
build/wasm32-unknown-wasi/head-wasm32-unknown-wasi-full-js-debug/ext/zlib/mkmf.log
shows thatruby/zlib
compilation fails becausezlib.h
is missing. Thezlib
referred to in this case is not thezlib
installed on the system, but thezlib
obtained bylib/ruby_wasm/build_system/product/zlib.rb
.Cause
zlib.rb
tries to downloadzlib 1.2.13
from zlib.net. zlib.net distributes the latest zlib. 1.2.13 worked fine when it was up to date.zlib 1.3
was released andzlib 1.2.13
is no longer distributed.Solution
Update zlib version to 1.3 to be downloaded in
zlib.rb
.Of course this is not a radical solution. Once a new version of zlib is released, the same problem should occur again. Of course this is not a radical solution. Once a new version of zlib is released, the same problem should occur again. So, to make it easier to understand the cause of the build error, I have added an option to raise an exception when the zlib download fails.
Perhaps it would be better to check out the version from https://github.com/madler/zlib.