Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zlib version to resolve build errors. #274

Merged
merged 2 commits into from Aug 25, 2023
Merged

Conversation

ledsun
Copy link
Contributor

@ledsun ledsun commented Aug 25, 2023

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:

*** Following extensions are not compiled:
zlib:
	Could not be configured. It will not be installed.
	Check ext/zlib/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.

Also, build/wasm32-unknown-wasi/head-wasm32-unknown-wasi-full-js-debug/ext/zlib/mkmf.log shows that ruby/zlib compilation fails because zlib.h is missing. The zlib referred to in this case is not the zlib installed on the system, but the zlib obtained by lib/ruby_wasm/build_system/product/zlib.rb.

Cause

zlib.rb tries to download zlib 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 and zlib 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.

Due to the release of zlib 1.3, zlib 1.2.13 is no longer available for download.
This is to cause an immediate build error if the zlib download fails.
@ko1 ko1 merged commit a7c09b8 into ruby:main Aug 25, 2023
31 checks passed
@ledsun ledsun deleted the update_zlib branch December 3, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants