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

Patch Erlang build on Alpine #751

Merged
merged 1 commit into from
Jan 7, 2025
Merged

Patch Erlang build on Alpine #751

merged 1 commit into from
Jan 7, 2025

Conversation

lukebakken
Copy link
Collaborator

@lukebakken lukebakken commented Dec 18, 2024

Works around this issue: erlang/otp#9211

Fixes #752

@lukebakken lukebakken self-assigned this Dec 18, 2024
@lukebakken lukebakken force-pushed the docker-library-rabbitmq-749 branch from 66a7829 to f086e28 Compare December 18, 2024 20:01
@lukebakken lukebakken marked this pull request as ready for review December 18, 2024 20:06
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not an Alpine expert or user but the patches that avoid warnings on modern GCC look correct to me.

@tianon
Copy link
Member

tianon commented Jan 7, 2025

I don't love the patch management introduced here -- it's kind of heavy for what's a hopefully temporary patch (we don't want to make patching Erlang a habit, I hope). 🙈 😅 ❤️

Since you've submitted this upstream in erlang/otp#9212, perhaps we can instead lean on that pushed commit (erlang/otp@e2604aa) and download the patch during build?

diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template
index cb0b8c4..877af1f 100644
--- a/Dockerfile-alpine.template
+++ b/Dockerfile-alpine.template
@@ -134,6 +134,11 @@ RUN set -eux; \
 	echo "$OTP_SOURCE_SHA256 *$OTP_PATH.tar.gz" | sha256sum -c -; \
 	tar --extract --file "$OTP_PATH.tar.gz" --directory "$OTP_PATH" --strip-components 1; \
 	\
+# https://github.com/erlang/otp/pull/9212
+	wget --output-document otp-9212.patch 'https://github.com/erlang/otp/commit/e2604aa7a92b3bb7c1293afd12705c7ce9c952a4.patch?full_index=1'; \
+	echo '35ec51529bdd6cab4b173b4e1fe844efa82f74eba76a99a74f746778d64dffa7 *otp-9212.patch' | sha256sum -c -; \
+	patch --input="$PWD/otp-9212.patch" --directory="$OTP_PATH" --strip=1; \
+	\
 # Configure Erlang/OTP for compilation, disable unused features & applications
 # https://erlang.org/doc/applications.html
 # ERL_TOP is required for Erlang/OTP makefiles to find the absolute path for the installation
# https://github.com/erlang/otp/pull/9212
	wget --output-document otp-9212.patch 'https://github.com/erlang/otp/commit/e2604aa7a92b3bb7c1293afd12705c7ce9c952a4.patch?full_index=1'; \
	echo '35ec51529bdd6cab4b173b4e1fe844efa82f74eba76a99a74f746778d64dffa7 *otp-9212.patch' | sha256sum -c -; \
	patch --input="$PWD/otp-9212.patch" --directory="$OTP_PATH" --strip=1; \
...
+ wget --output-document otp-9212.patch 'https://github.com/erlang/otp/commit/e2604aa7a92b3bb7c1293afd12705c7ce9c952a4.patch?full_index=1'
Connecting to github.com (140.82.116.4:443)
saving to 'otp-9212.patch'
otp-9212.patch       100% |********************************|  1749  0:00:00 ETA
'otp-9212.patch' saved
+ echo '35ec51529bdd6cab4b173b4e1fe844efa82f74eba76a99a74f746778d64dffa7 *otp-9212.patch'
+ sha256sum -c -
otp-9212.patch: OK
+ patch '--input=//otp-9212.patch' '--directory=/usr/local/src/otp-27.2' '--strip=1'
patching file erts/configure
Hunk #1 succeeded at 21677 (offset -56 lines).
Hunk #2 succeeded at 25867 (offset -56 lines).
patching file erts/configure.ac
Hunk #1 succeeded at 2439 (offset -4 lines).
Hunk #2 succeeded at 3134 (offset -4 lines).
+ cd /usr/local/src/otp-27.2
...
checking for working poll()... yes
...

Fixes #749

Code suggested by @tianon
@lukebakken lukebakken force-pushed the docker-library-rabbitmq-749 branch from f086e28 to 942e3c7 Compare January 7, 2025 02:28
@lukebakken
Copy link
Collaborator Author

@tianon - I've modified this PR to use your much simpler approach. Thanks!

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You applied it faster than I could get back around to the PR in my PTO backlog 😂 ❤️ 🚀

@tianon tianon merged commit dd27cf7 into master Jan 7, 2025
22 checks passed
@tianon tianon deleted the docker-library-rabbitmq-749 branch January 7, 2025 23:13
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Jan 7, 2025
Changes:

- docker-library/rabbitmq@dd27cf7: Merge pull request docker-library/rabbitmq#751 from docker-library/docker-library-rabbitmq-749
- docker-library/rabbitmq@942e3c7: Patch Erlang build on Alpine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alpine Linux variant: Not enough file descriptors to handle queues
3 participants