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

lmp-base: update meta-lts-mixins-go layer #425

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

quaresmajose
Copy link
Member

No description provided.

@quaresmajose quaresmajose added the ok-to-test Requires OK for testing to proceed label Feb 28, 2024
@quaresmajose
Copy link
Member Author

ci-retest

@quaresmajose quaresmajose force-pushed the go-bump branch 3 times, most recently from 1dcfe36 to a7fc9cf Compare March 7, 2024 00:08
@quaresmajose quaresmajose changed the title [WIP] lmp-base: update meta-lts-mixins-go layer lmp-base: update meta-lts-mixins-go layer Mar 7, 2024
@quaresmajose quaresmajose marked this pull request as ready for review March 7, 2024 00:09
@quaresmajose quaresmajose requested a review from a team March 7, 2024 00:09
@ricardosalveti
Copy link
Member

Since dynlink is now disabled, did you compare the lmp-base-console-image size to see if there is any significant difference? We do have several apps that are go based.

@quaresmajose
Copy link
Member Author

quaresmajose commented Mar 12, 2024

The size will increase for sure but don't have the number how much will this be. I will check this and come back with the result

@quaresmajose
Copy link
Member Author

A little unexpected for me but in the end the image size is about 20MB lower than it was. Looks like some go based tools we use were already statically linked like the ones from meta-virt.

Here is the buildhistory:

--- a/images/intel_corei7_64/glibc/lmp-base-console-image/files-in-image.txt
+++ b/images/intel_corei7_64/glibc/lmp-base-console-image/files-in-image.txt
@@ -642,13 +642,13 @@ lrwxrwxrwx 0          0                  23 ./usr/bin/cmp -> /usr/bin/busybox.no
 -rwxr-xr-x 0          0               14192 ./usr/bin/colcrt
 -rwxr-xr-x 0          0               30584 ./usr/bin/colrm
 -rwxr-xr-x 0          0               55160 ./usr/bin/column
--rwxr-xr-x 0          0             9411368 ./usr/bin/composectl
+-rwxr-xr-x 0          0            14052288 ./usr/bin/composectl
 -rwxr-xr-x 0          0               14048 ./usr/bin/conflict
--rwxr-xr-x 0          0            53719736 ./usr/bin/containerd
--rwxr-xr-x 0          0            26295288 ./usr/bin/containerd-ctr
--rwxr-xr-x 0          0             7223672 ./usr/bin/containerd-shim
--rwxr-xr-x 0          0             9978768 ./usr/bin/containerd-shim-runc-v1
--rwxr-xr-x 0          0            13477040 ./usr/bin/containerd-shim-runc-v2
+-rwxr-xr-x 0          0            53937848 ./usr/bin/containerd
+-rwxr-xr-x 0          0            26822464 ./usr/bin/containerd-ctr
+-rwxr-xr-x 0          0             7377336 ./usr/bin/containerd-shim
+-rwxr-xr-x 0          0            10309264 ./usr/bin/containerd-shim-runc-v1
+-rwxr-xr-x 0          0            13741616 ./usr/bin/containerd-shim-runc-v2
 lrwxrwxrwx 0          0                  23 ./usr/bin/cpio -> /usr/bin/busybox.nosuid
 lrwxrwxrwx 0          0                  23 ./usr/bin/cp -> /usr/bin/busybox.nosuid
 lrwxrwxrwx 0          0                  23 ./usr/bin/crc32 -> /usr/bin/busybox.nosuid
@@ -685,14 +685,14 @@ lrwxrwxrwx 0          0                  25 ./usr/bin/dmesg -> /usr/bin/dmesg.ut
 -rwxr-xr-x 0          0               26552 ./usr/bin/dnie-tool
 lrwxrwxrwx 0          0                  23 ./usr/bin/dnsdomainname -> /usr/bin/busybox.nosuid
 -rwxr-xr-x 0          0              393536 ./usr/bin/dnsmasq
--rwxr-xr-x 0          0            26655144 ./usr/bin/docker
+-rwxr-xr-x 0          0            26777416 ./usr/bin/docker
 lrwxrwxrwx 0          0                  10 ./usr/bin/docker-containerd -> containerd
 lrwxrwxrwx 0          0                  14 ./usr/bin/docker-containerd-ctr -> containerd-ctr
 lrwxrwxrwx 0          0                  15 ./usr/bin/docker-containerd-shim -> containerd-shim
 -rwxr-xr-x 0          0                 641 ./usr/bin/docker-credential-fio-helper
--rwxr-xr-x 0          0            86441968 ./usr/bin/dockerd
+-rwxr-xr-x 0          0            86327288 ./usr/bin/dockerd
 -rwxr-xr-x 0          0              794032 ./usr/bin/docker-init
--rwxr-xr-x 0          0             2018272 ./usr/bin/docker-proxy
+-rwxr-xr-x 0          0             2144928 ./usr/bin/docker-proxy
 lrwxrwxrwx 0          0                   4 ./usr/bin/docker-runc -> runc
 -rwxr-xr-x 0          0              178032 ./usr/bin/dumpkeys
 lrwxrwxrwx 0          0                  23 ./usr/bin/dumpkmap -> /usr/bin/busybox.nosuid
@@ -726,8 +726,8 @@ lrwxrwxrwx 0          0                  23 ./usr/bin/fgrep -> /usr/bin/busybox.
 -rwxr-xr-x 0          0               34712 ./usr/bin/fincore
 -rwxr-xr-x 0          0               68696 ./usr/bin/findmnt
 lrwxrwxrwx 0          0                  23 ./usr/bin/find -> /usr/bin/busybox.nosuid
--rwxr-xr-x 0          0             2676864 ./usr/bin/fioconfig
--rwxr-xr-x 0          0               88984 ./usr/bin/fio-docker-fsck
+-rwxr-xr-x 0          0             9536640 ./usr/bin/fioconfig
+-rwxr-xr-x 0          0             2044424 ./usr/bin/fio-docker-fsck
 -rwxr-xr-x 0          0              500888 ./usr/bin/fipstest
 -rwxr-xr-x 0          0               14720 ./usr/bin/flash-var
 lrwxrwxrwx 0          0                  25 ./usr/bin/flock -> /usr/bin/flock.util-linux
@@ -963,7 +963,7 @@ lrwxrwxrwx 0          0                  23 ./usr/bin/rmdir -> /usr/bin/busybox.
 lrwxrwxrwx 0          0                  23 ./usr/bin/rm -> /usr/bin/busybox.nosuid
 -rwxr-xr-x 0          0             1769408 ./usr/bin/rsaperf
 -rwxr-xr-x 0          0              100672 ./usr/bin/rsapoptst
--rwxr-xr-x 0          0             9725256 ./usr/bin/runc
+-rwxr-xr-x 0          0            10035048 ./usr/bin/runc
 lrwxrwxrwx 0          0                  23 ./usr/bin/run-parts -> /usr/bin/busybox.nosuid
 -rwxr-xr-x 0          0               51240 ./usr/bin/sc-hsm-tool
 -rwxr-xr-x 0          0               14120 ./usr/bin/scmp_sys_resolver
@@ -1240,7 +1240,7 @@ drwxr-xr-x 0          0                  20 ./usr/include
 drwxr-xr-x 0          0                  46 ./usr/include/python3.10
 -rw-r--r-- 0          0               51097 ./usr/include/python3.10/pyconfig-64.h
 -rw-r--r-- 0          0                 564 ./usr/include/python3.10/pyconfig.h
-drwxr-xr-x 0          0                9074 ./usr/lib
+drwxr-xr-x 0          0                9070 ./usr/lib
 drwxr-xr-x 0          0                  24 ./usr/lib/alsa
 -rw-r--r-- 0          0                  28 ./usr/lib/alsa/asound.state
 drwxr-xr-x 0          0                 144 ./usr/lib/cryptsetup
@@ -1251,7 +1251,7 @@ drwxr-xr-x 0          0                  46 ./usr/lib/depmod.d
 -rw-r--r-- 0          0                  71 ./usr/lib/depmod.d/search.conf
 drwxr-xr-x 0          0                  66 ./usr/lib/docker
 drwxr-xr-x 0          0                  28 ./usr/lib/docker/cli-plugins
--rwxr-xr-x 0          0            58625776 ./usr/lib/docker/cli-plugins/docker-compose
+-rwxr-xr-x 0          0            57942576 ./usr/lib/docker/cli-plugins/docker-compose
 -rw-r--r-- 0          0                  60 ./usr/lib/docker/config.json
 -rw-r--r-- 0          0                 141 ./usr/lib/docker/daemon.json
 -rwxr-xr-x 0          0               14120 ./usr/lib/e2initrd_helper
@@ -1986,10 +1986,6 @@ drwxr-xr-x 0          0                   0 ./usr/lib/gio/modules
 drwxr-xr-x 0          0                  64 ./usr/lib/girepository-1.0
 -rw-r--r-- 0          0              322504 ./usr/lib/girepository-1.0/NM-1.0.typelib
 -rw-r--r-- 0          0               80188 ./usr/lib/girepository-1.0/OSTree-1.0.typelib
-drwxr-xr-x 0          0                   6 ./usr/lib/go
-drwxr-xr-x 0          0                  38 ./usr/lib/go/pkg
-drwxr-xr-x 0          0                  18 ./usr/lib/go/pkg/linux_amd64_dynlink
--rw-r--r-- 0          0            36745272 ./usr/lib/go/pkg/linux_amd64_dynlink/libstd.so
 -rw-r--r-- 0          0                 722 ./usr/lib/group
 -r-------- 0          0                 604 ./usr/lib/gshadow
 -rw-r--r-- 0          0                 240 ./usr/lib/hosts
@@ -2249,7 +2245,7 @@ drwxr-xr-x 0          0                  36 ./usr/lib/modprobe.d
 -rw-r--r-- 0          0                 773 ./usr/lib/modprobe.d/systemd.conf
 drwxr-xr-x 0          0                  38 ./usr/lib/modules
 drwxr-xr-x 0          0                 482 ./usr/lib/modules/6.1.75-lmp-standard
--rw-r--r-- 0          0             8129511 ./usr/lib/modules/6.1.75-lmp-standard/initramfs.img
+-rw-r--r-- 0          0             8129514 ./usr/lib/modules/6.1.75-lmp-standard/initramfs.img
 drwxr-xr-x 0          0                  64 ./usr/lib/modules/6.1.75-lmp-standard/kernel
 drwxr-xr-x 0          0                   6 ./usr/lib/modules/6.1.75-lmp-standard/kernel/arch
 drwxr-xr-x 0          0                  18 ./usr/lib/modules/6.1.75-lmp-standard/kernel/arch/x86
diff --git a/images/intel_corei7_64/glibc/lmp-base-console-image/image-info.txt b/images/intel_corei7_64/glibc/lmp-base-console-image/image-info.txt
index ca63e1e..9e834f6 100644
--- a/images/intel_corei7_64/glibc/lmp-base-console-image/image-info.txt
+++ b/images/intel_corei7_64/glibc/lmp-base-console-image/image-info.txt
@@ -10,4 +10,4 @@ NO_RECOMMENDATIONS =
 PACKAGE_EXCLUDE = 
 ROOTFS_POSTPROCESS_COMMAND = write_package_manifest; license_create_manifest;    zap_empty_root_password;     rootfs_update_timestamp;   write_image_test_data;  set_systemd_default_target; systemd_create_users; empty_var_volatile;   sota_var_cleanup;  set_user_group; sort_passwd; rootfs_reproducible;
 IMAGE_POSTPROCESS_COMMAND =  buildhistory_get_imageinfo ;
-IMAGESIZE = 729276
+IMAGESIZE = 707756

@quaresmajose quaresmajose removed the ok-to-test Requires OK for testing to proceed label Mar 12, 2024
Relevant changes:
- 7b4c22b conf/layer: set GOPROXY
- 9454028 conf/layer: switch to golang 1.22
- 88a9d68 go: Drop linkmode with nativesdk/cross-canadian
- a809d8e go: Further tweak indentation in patch
- c7f5053 go-1.22: import recipes from openembedded-core
- a38d2f2 go: upgrade 1.21.5 -> 1.21.7
- f9c8583 go: upgrade 1.21.0 -> 1.21.5
- a55736d conf/layer: switch to golang 1.21
- 545e140 goarch: disable dynamic linking globally
- 64cf5e1 goarch: import bbclass from openembedded-core
- caab6d9 go-1.21: import recipes from openembedded-core
- 32b84b5 go: rework patch to avoid identation

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
@ricardosalveti
Copy link
Member

A little unexpected for me but in the end the image size is about 20MB lower than it was. Looks like some go based tools we use were already statically linked like the ones from meta-virt.

Quite interesting, it seems statically linking might be adding only the pieces that are actually used/required by the codebase, while dynlinking ends up creating a substantial libstd (as it needs to provide a larger set of functions).

Since mostly our own stuff is using dynlinking (fioconfig, etc), there is indeed not a big advantage at this stage. Once everything can be built with dynlinking things might change.

Copy link
Member

@ricardosalveti ricardosalveti left a comment

Choose a reason for hiding this comment

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

LGTM

@ricardosalveti ricardosalveti merged commit b7352cb into foundriesio:main Mar 18, 2024
@quaresmajose quaresmajose deleted the go-bump branch March 19, 2024 09:15
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.

3 participants