-
Notifications
You must be signed in to change notification settings - Fork 51
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
base: ubuntu-24.04
Are you sure you want to change the base?
Conversation
Diff of dependencies: slices/erlang-base.yaml@@ -1,8 +1,9 @@
-adduser
+bash
+coreutils
libc6
libgcc-s1
+libreadline8t64
libstdc++6
libsystemd0
libtinfo6
-procps
zlib1g |
/usr/lib/erlang/lib/sasl-*/ebin/**: | ||
/usr/lib/erlang/lib/stdlib-*/ebin/**: | ||
/usr/lib/erlang/lib/stdlib-*/include/**: | ||
/usr/lib/erlang/releases/**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these files necessary?
There was a problem hiding this comment.
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.
- bash_bins | ||
- coreutils_bins | ||
- erlang-base_modules | ||
- libc6_libs | ||
- libgcc-s1_libs | ||
- libreadline8t64_libs |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ofescript
, andenv
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.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 withnohup
has failed in the spread container (although it works locally).Related issues/PRs
PR #258
Forward porting
N/A
Checklist
Additional Context
N/A