Skip to content

erlang: update to 25.3#5829

Merged
mreid-tt merged 24 commits intoSynoCommunity:masterfrom
hgy59:update_erlang
Feb 25, 2026
Merged

erlang: update to 25.3#5829
mreid-tt merged 24 commits intoSynoCommunity:masterfrom
hgy59:update_erlang

Conversation

@hgy59
Copy link
Contributor

@hgy59 hgy59 commented Aug 4, 2023

Description

This PR updates the Erlang ecosystem packages (Erlang, Elixir, RabbitMQ, ejabberd) and fixes critical DSM 7 upgrade issues.

Version Updates

Package Old Version New Version
Erlang 25.0.4 25.3.2.21
Elixir (native) 1.14.0 1.15.8
RabbitMQ 3.10.7 3.11.28
ejabberd 21.07 23.10

Key Improvements

ejabberd

  • Fixed configuration paths for DSM 7+ (SYNOPKG_PKGVAR instead of SYNOPKG_PKGDEST)
  • Added dynamic upgrade wizard that detects missing admin ACL and prompts for credentials
  • Added automatic data migration from old paths during DSM 7 upgrades
  • Added CLI wrapper with proper permission handling for ejabberdctl
  • Added web interface shortcut in DSM

RabbitMQ

  • Fixed configuration for DSM 7
  • Added DSM 7 upgrade data migration (cookie and var folder)
  • Added CLI wrappers with proper permission handling for all management tools
  • Added web interface shortcut to RabbitMQ Management UI (port 15672)

Erlang

  • Fixed OpenSSL include order to resolve build issues
  • Disabled parallel make for Elixir bootstrap to fix race condition

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Package update

hgy59 added 5 commits August 7, 2023 21:30
- update erlang to v25.3.2.5
- includes update to cross/openssl3
- add a git tag for the time of the build as included packages evaluate the rabbitmq version with "git describe --tag"
@mreid-tt mreid-tt mentioned this pull request Jan 6, 2026
7 tasks
@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 7, 2026

hey @hgy59, based on your #6886 (comment), this should be merged before any other updates to Erlang. From what I see the latest version in the 25.3.x train is OTP 25.3.2.21. Would you like me to bump to the latest versions compatible with this (RabbitMQ 3.11.28 and ejabberd 25.10), test and publish for you? Any other things need to be completed in this PR?

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 8, 2026

From what I see the latest version in the 25.3.x train is OTP 25.3.2.21

I tried to build Erlang 25.3.2.21 but it fails (conflicts with openssl) the latest 25.3.x that builds is 25.3.2.7 (we already have 25.3.2.5 that is almoste the same).

rabbitmq that is compatible with erlang 25.3.x fails to build, this must be fixed first.

@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 9, 2026

hey @hgy59, may I add some commits to your PR to get the build to work again?

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 9, 2026

hey @hgy59, may I add some commits to your PR to get the build to work again?

Yes, please, if you have a solution...

Elixir's Makefile has .NOTPARALLEL: compile but spksrc's make -j
overwrites this, causing race conditions during bootstrap that
result in 'init terminating in do_boot' errors in CI.
Adds patch to fix erl_interface and erts/emulator build when
cross-compiling. The issue is that the staging directory's OpenSSL
headers get picked up before Erlang's custom headers, preventing
proper MD5 function renaming (ei_MD5Init/ei_MD5Update/ei_MD5Final).

The patch prepends -Iopenssl/include to CFLAGS to ensure Erlang's
custom OpenSSL headers are found first.
@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 9, 2026

Yes, please, if you have a solution...

My solutions have beed added. As you will note I've gone to the latest compatible versions as follows:

  • erlang to 25.3.2.21 (with OpenSSL include fix)
  • rabbitmq to 3.11.28
  • ejabberd to 23.10

The native libraries have also been updated to latest compatible versions:

  • native/elixir: update to 1.15.8 (with disable parallel make fix)
  • native/erlang: update to 25.3.2.21

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 9, 2026

  • native/erlang: update to 25.3.2.21

This can stay on 25.3 as before. It must not match the cross/erlang version (this is different to other systems like native/python*).
Only major.minor version must match, patch version is not relevant.

@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 9, 2026

This can stay on 25.3 as before. It must not match the cross/erlang version (this is different to other systems like native/python*).
Only major.minor version must match

Can you explain why this may be? Happy to roll it back but was curious about this.

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 10, 2026

Can you explain why this may be? Happy to roll it back but was curious about this.

I did it this way since first erlang package and it was confirmed by an AI query.
AI confirmed that it is not officially documented, but says

The "major.minor must match" requirement is essentially this combination of:

  • Patch-level compatibility guarantee
  • No guarantee regarding minor boundaries
  • Years of build experience in the Erlang/OTP project

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 10, 2026

@mreid-tt thanks for your fixes!

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 10, 2026

just found that rabbitmq never worked on DSM 7+...

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 10, 2026

ejabberd (also the current version) does not work in DSM 7+.

But the fix is not so easy as for rabbitmq.
ejabberd installs some files and folders to ejabberd/target/var instead of ejabberd/var.
This comes from the localstatedir i.e. INSTALL_PREFIX_VAR and is related to the spksrc framwork.
Also patching Makefile.in (by patch) and sbin/ejabberdctl (by post_install_target) might need adjustment...

@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 10, 2026

ejabberd installs some files and folders to ejabberd/target/var instead of ejabberd/var.
This comes from the localstatedir i.e. INSTALL_PREFIX_VAR and is related to the spksrc framwork.
Also patching Makefile.in (by patch) and sbin/ejabberdctl (by post_install_target) might need adjustment...

If you can spell out the precise issues to be resolved I can try to tackle them for you.

EDIT: hey @hgy59, I've proposed a fix. Feel free to revert it if this was not what you were taking about.

Fix ejabberdctl paths to use /var/packages/ejabberd/var instead of
/var/packages/ejabberd/target/var for CONFIG_DIR, LOGS_DIR, and
SPOOL_DIR.

This uses the INSTALL_PREFIX_VAR variable which is correctly set by
the framework for DSM 7+ packages.
@mreid-tt

This comment was marked as resolved.

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 10, 2026

@mreid-tt good catch, ../../mk/spksrc.common.mk must always be included before use of version_ge et. al.

When INSTALL_PREFIX_VAR will be fixed, we will need to handle the files that are installed to the var folder differently, because the PLIST file can handle only files that are installed under package/target (all under package/var must be installed in spk Makefile and can't be installed in cross Makefile).
And when this is fixed, we wouldn't need to replace /target/var by /var in sbin/ejabberdctl.

@th0ma7
Copy link
Contributor

th0ma7 commented Jan 10, 2026

@mreid-tt indeed good catch. I suggest you make the change, either here and confirm it runs as expected or through a standalone PR with a few test build to confirm.

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 10, 2026

@mreid-tt indeed good catch. I suggest you make the change, either here and confirm it runs as expected or through a standalone PR with a few test build to confirm.

This is not a small framework change
IMHO we have to split spksrc.common.mk into two files
one that is included before include of spksrc.directories.mk that does not depend on any directory (like CURDIR, BASEDIR, WORK_DIR, ...)
and the otherone that is included after include of spksrc.directories.mk

I would like a dedicated PR and continue here with a workaround that does not need this fix.

Except we can avoid the use of version_ge in spksrc.directories.mk by definition of INSTALL_PREFIX_VAR the same for all DSM versions...

@th0ma7
Copy link
Contributor

th0ma7 commented Jan 10, 2026

@hgy59 can or can't? DSM7's var environment is indeed different, thus this variable. Personally the option 1 of reordering is limited in scope and would suffice for now. spksrc.common.mk could be added to the META issue and done at a later time into its own PR indeed.

hgy59 added 2 commits January 11, 2026 02:05
- use the same approach for all DSM versions
- install several config files to var folder
- use bin instead of sbin folder to avoid additional patch
- add missing artifacts to PLIST
- PLIST: remove files in var folder
- configure web admin authentication in ejabberd.yml
@hgy59
Copy link
Contributor Author

hgy59 commented Jan 11, 2026

DSM7's var environment is indeed different,

The generic installer of spksrc ensures the $(INSTALL_DIR)/var folder for all DSM versions.
So all DSM version have a DSM 7 compatible var folder.

@mreid-tt

This comment was marked as outdated.

mreid-tt added a commit to mreid-tt/spksrc that referenced this pull request Jan 13, 2026
Replace the call to version_ge with an inline shell comparison
to avoid the circular dependency issue where spksrc.directories.mk
is included before spksrc.common.mk (where version_ge is defined).

This fixes the INSTALL_PREFIX_VAR evaluation for packages like erlang
where the version conditional was silently failing.

Ref: PR SynoCommunity#5829 discussion
@mreid-tt mreid-tt removed the framework label Feb 3, 2026
- Fix SPK_DEPENDS decimal format (erlang>=25.0:erlang<25.4)
- Add wrapper scripts for CLI tools (rabbitmqctl, rabbitmq-diagnostics,
  rabbitmq-plugins, rabbitmq-queues, rabbitmq-streams, rabbitmq-upgrade)
- CLI wrappers run as package user (sc-rabbitmq) via sudo to access
  the Erlang cookie (which must be mode 400 per Erlang requirements)
- Set HOME to SYNOPKG_PKGVAR in service-setup.sh and rabbitmq-env.conf
- Add SPK_COMMANDS for CLI tool symlinks in PATH
- Display user-friendly message when sudo password is required
@mreid-tt
Copy link
Contributor

hey @hgy59 — hope you don’t mind, I was trying to help get this one over the line and ready for publishing. I saw your earlier concern about RabbitMQ not working on DSM 7, so I did some upgrade testing on my end.

During testing, I found that SPK_DEPENDS needed consistent decimal version formatting; otherwise, upgrades would fail. I’ve adjusted that accordingly. I also added wrappers for the existing CLI tools to make RabbitMQ easier to test, and set HOME to SYNOPKG_PKGVAR so Erlang can correctly locate the cookie file.

Based on my DSM 7.1 testing, everything appears to be working now.

@mreid-tt

This comment was marked as resolved.

During upgrades, check if the existing ejabberd.yml has a properly
configured admin ACL. If the admin ACL section is missing or has no
valid user entries (or still has the @@adminuser@@ placeholder),
the upgrade wizard prompts the user for their existing admin credentials.

The admin account is validated against the ejabberd database using
ejabberdctl check_account before the upgrade proceeds, ensuring the
credentials match an actual account in the system.

This approach detects the actual configuration state regardless of
which version the user is upgrading from.
@mreid-tt
Copy link
Contributor

mreid-tt commented Feb 24, 2026

Summary of Changes

I've tested and extended this PR with additional fixes for upgrade scenarios for ejabberd. The changes are added in the commit 8ee216a.

New Features

Admin ACL Migration for Upgrades

  • Added dynamic upgrade wizard (upgrade_uifile.sh) that detects when the admin ACL is missing from ejabberd.yml
  • Wizard prompts for existing admin credentials and validates them against the ejabberd database before proceeding
  • On successful validation, the admin ACL section is automatically added to the config file

CLI Wrapper Script

  • Added bin/ejabberdctl wrapper for SPK_COMMANDS that handles running as the package user
  • Wrapper uses sudo -u sc-ejabberd with proper HOME environment for cookie access
  • Provides user-friendly prompts when sudo authentication is required

Bug Fixes

DSM 7 Data Migration

  • Fixed HOME path from SYNOPKG_PKGDEST to SYNOPKG_PKGVAR for proper cookie location on DSM 7
  • Added service_save and service_restore functions to migrate data from target/var to var (required because DSM 7 uses different paths: @appstore vs @appdata)
  • Cookie file is also migrated from old HOME location (target/.erlang.cookie) to new location (var/.erlang.cookie)

Upgrade Validation

  • validate_preupgrade temporarily starts ejabberd to validate admin credentials against the live database
  • Uses correct HOME path based on where the erlang cookie exists (handles both old and new installations)
  • Properly stops ejabberd after validation regardless of success or failure

Technical Details

  • Upgrade wizard only appears when acl: admin: user: is missing or empty in the existing config
  • Config file detection handles both DSM 6 (/var/packages/ejabberd/var/) and DSM 7 (/var/packages/ejabberd/target/var/) paths
  • AWK-based config modification inserts admin ACL section after loopback: block within the acl: section
  • All ejabberdctl commands during upgrade use hardcoded installed paths since SYNOPKG_PKGDEST points to the new package being installed, not the current installation

Testing

Built and tested on:

  • DSM 7.1 x64 - upgrade from previous version with missing admin ACL ✓
  • DSM 6.2.4 x64 - upgrade from previous version with missing admin ACL ✓

@mreid-tt mreid-tt self-assigned this Feb 24, 2026
@mreid-tt
Copy link
Contributor

hey @hgy59 - I've reviewed, tested, and enhanced this PR. The changes are now ready for merging.

Testing completed:

  • Fresh installs of ejabberd and RabbitMQ on DSM 7.1 x64
  • Upgrades from existing installed versions on DSM 7.1 x64
  • Verified ejabberd admin ACL migration wizard works correctly
  • Verified RabbitMQ data migration during upgrade
  • Confirmed web interface shortcuts function properly for both packages

Functional testing:

Erlang:

$ erl -s erlang halt
Erlang/OTP 25 [erts-13.2.2.16] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

RabbitMQ:

$ rabbitmqctl status
Status of node rabbit@DSM71 ...
RabbitMQ version: 3.11.28
Erlang configuration: Erlang/OTP 25 [erts-13.2.2.16] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]
Crypto library: OpenSSL 3.5.4 30 Sep 2025
Plugins: rabbitmq_management, rabbitmq_management_agent, rabbitmq_web_dispatch, amqp_client, cowboy, cowlib

ejabberd:

$ ejabberdctl status
The node ejabberd@localhost is started with status: started
ejabberd 23.10 is running in that node

Additional improvements made:

  • ejabberd: Dynamic upgrade wizard that detects missing admin ACL and validates credentials before upgrade proceeds
  • ejabberd: Automatic migration of Erlang cookie and data from old paths (target/var) to new (var) on DSM 7
  • ejabberd: CLI wrapper (ejabberdctl) with proper HOME and permission handling
  • RabbitMQ: DSM 7 upgrade data migration for cookie and var folder
  • RabbitMQ: CLI wrappers for all management tools with proper permission handling
  • RabbitMQ: Web interface shortcut to Management UI (port 15672)
  • Reorganized Makefiles for consistency

The PR description has been updated to reflect all changes. Do you have any other comments or changes before we merge?

- Split wizard into two logical steps: Administrator Account and Server Domain
- Add introductory descriptions explaining ejabberd and XMPP
- Improve field labels for consistency with upgrade wizard
- Remove insecure default password (admin)
- Add minimum password length validation (4 characters)
- Clarify username format and login instructions
- Quote variables in register command to support passwords with spaces

Password validation follows XMPP ResourcePrep (RFC 6122) - special characters
are allowed; only non-printable and control characters are prohibited.
@mreid-tt mreid-tt merged commit 4dadc18 into SynoCommunity:master Feb 25, 2026
15 checks passed
@mreid-tt mreid-tt added status/published Published and activated (may take up to 48h until visible in DSM package manager) and removed status/ready-to-merge labels Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/published Published and activated (may take up to 48h until visible in DSM package manager)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants