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

feat(24.04): add erlang slices #384

Open
wants to merge 3 commits into
base: ubuntu-24.04
Choose a base branch
from

Conversation

linostar
Copy link
Collaborator

@linostar linostar commented Nov 8, 2024

Proposed changes

Add erlang-* slices to 24.04

Note that erlang packages are not available for i386 arch.

I tried to add tests for all erlang binaries , but some of them needs the erl server to be running in the background, and attempting to run it with & or with nohup has failed in the spread container (although it works locally).

Related issues/PRs

PR #258

Forward porting

N/A

Checklist

  • I have read the contributing guidelines
  • I have tested my changes (see how)
  • I have already submitted the CLA form

Additional Context

N/A

Copy link

github-actions bot commented Nov 8, 2024

Diff of dependencies:

slices/erlang-base.yaml
@@ -1,8 +1,9 @@
-adduser
+bash
+coreutils
 libc6
 libgcc-s1
+libreadline8t64
 libstdc++6
 libsystemd0
 libtinfo6
-procps
 zlib1g

@linostar linostar requested review from ROCKsBot and a team and removed request for ROCKsBot November 8, 2024 10:30
@linostar linostar marked this pull request as ready for review November 8, 2024 10:35
@linostar linostar added the Priority Look at me first label Nov 8, 2024
@linostar linostar changed the title feat(24.04) add erlang slices feat(24.04): add erlang slices Nov 8, 2024
slices/erlang-asn1.yaml Outdated Show resolved Hide resolved
/usr/lib/erlang/lib/sasl-*/ebin/**:
/usr/lib/erlang/lib/stdlib-*/ebin/**:
/usr/lib/erlang/lib/stdlib-*/include/**:
/usr/lib/erlang/releases/**:
Copy link
Member

Choose a reason for hiding this comment

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

Are these files necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, those are modules and header files that are needed and present core functionailty that other erlang packages depend on.

slices/erlang-crypto.yaml Show resolved Hide resolved
slices/erlang-eldap.yaml Show resolved Hide resolved
Comment on lines +9 to +14
- bash_bins
- coreutils_bins
- erlang-base_modules
- libc6_libs
- libgcc-s1_libs
- libreadline8t64_libs
Copy link
Member

Choose a reason for hiding this comment

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

Why are we including the following packages?

  - bash_bins
  - coreutils_bins
  - libreadline8t64_libs

I did the following to check if we needed libreadline8t64, but seems like we do not need it.

root@9808cd76eaf4:~/erlang-base# find . | xargs ldd 2>/dev/null | grep libreadline
root@9808cd76eaf4:~/erlang-base# find . | xargs ldd 2>/dev/null | grep libhistory

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • bash is needed because there are several erlang packages that have shell scripts, and they all depend on erlang-base, so it makes sense to put bash as dependency in erlang-base.
  • coreutils is needed because some bash scripts use /usr/bin/env to detect the path of escript, and env is found in coreutils
  • as for libtinfo8t64, I found that some of the binaries in erlnag-snmp are trying to open libtinfo so file (from strace output), and I am not sure if there are others that use it as well, so I put it in erlang-base's essential as a precaution.

slices/erlang-mnesia.yaml Show resolved Hide resolved
slices/erlang-runtime-tools.yaml Outdated Show resolved Hide resolved
slices/erlang-tools.yaml Outdated Show resolved Hide resolved
tests/spread/integration/erlang/task.yaml Outdated Show resolved Hide resolved
Comment on lines 4 to 13
rootfs="$(install-slices erlang-base_bins erlang-inets_scripts erlang-os-mon_bins erlang-crypto_modules erlang-eldap_modules erlang-mnesia_modules erlang-parsetools_modules erlang-public-key_modules erlang-runtime-tools_modules erlang-ssl_modules erlang-syntax-tools_modules erlang-tools_modules erlang-xmerl_modules base-files_base bash_bins coreutils_bins)"

mkdir -p "$rootfs"/bin "$rootfs"/etc "$rootfs"/dev "$rootfs"/root
cp /bin/sh "$rootfs"/bin/
cp /etc/resolv.conf "$rootfs"/etc/
cp /etc/nsswitch.conf "$rootfs"/etc/
touch "$rootfs"/dev/null
chmod 777 "$rootfs"/dev/null
echo "cookie" > "$rootfs"/root/.erlang.cookie
chroot "$rootfs" chmod 400 /root/.erlang.cookie
Copy link
Member

Choose a reason for hiding this comment

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

I think this block could have gone on to the prepare: section.

In any case, let's please use empty lines to separate logical blocks. Easier to read and follow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can't really use prepare: here because we won't be able to use the $rootfs env var in execute: then.

@linostar linostar requested review from rebornplusplus and a team November 13, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority Look at me first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants