From e715708be19cc88dcdb767e12a88be3abbdd6fe9 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Fri, 28 Jun 2024 09:32:21 +0200 Subject: [PATCH] Remove override-stage Current `override-stage` has no effect on final rock I inspected the rock we're currently building (i.e. ghcr.io/canonical/charmed-mysql:8.0.37-22.04_edge), and it looks like it doesn't contain `/var/lib/mysql` ``` root@foo-0:/# find / -name mysql /home/mysql /usr/lib/x86_64-linux-gnu/perl5/5.34/DBD/mysql /usr/lib/x86_64-linux-gnu/perl5/5.34/auto/DBD/mysql /usr/lib/mysql /usr/share/mysql /usr/bin/mysql /var/log/mysql /etc/init.d/mysql /etc/mysql root@foo-0:/# mysqld --initialize-insecure -u mysql root@foo-0:/# find / -name mysql /home/mysql /usr/lib/x86_64-linux-gnu/perl5/5.34/DBD/mysql /usr/lib/x86_64-linux-gnu/perl5/5.34/auto/DBD/mysql /usr/lib/mysql /usr/share/mysql /usr/bin/mysql /var/log/mysql /var/lib/mysql /var/lib/mysql/mysql /etc/init.d/mysql /etc/mysql ``` so I think the entire `override-stage` in our rock is doing nothing --- rockcraft.yaml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/rockcraft.yaml b/rockcraft.yaml index 3882e1c..9a64d43 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -33,30 +33,6 @@ parts: - python3-yaml stage-snaps: - charmed-mysql/8.0/edge - override-stage: | - LIB_DIR=$CRAFT_STAGE/usr/lib/x86_64-linux-gnu - craftctl default - mkdir -p $CRAFT_STAGE/var/lib/mysql - ln -sf $LIB_DIR/libnuma.so.1 \ - /usr/lib/x86_64-linux-gnu/libnuma.so.1 - ln -sf $LIB_DIR/libaio.so.1 \ - /usr/lib/x86_64-linux-gnu/libaio.so.1 - ln -sf $LIB_DIR/libicuuc.so.70 \ - /usr/lib/x86_64-linux-gnu/libicuuc.so.70 - ln -sf $LIB_DIR/libicui18n.so.70 \ - /usr/lib/x86_64-linux-gnu/libicui18n.so.70 - ln -sf $LIB_DIR/libevent_core-2.1.so.7 \ - /usr/lib/x86_64-linux-gnu/libevent_core-2.1.so.7 - ln -sf $LIB_DIR/libevent_pthreads-2.1.so.7 \ - /usr/lib/x86_64-linux-gnu/libevent_pthreads-2.1.so.7 - ln -sf $LIB_DIR/libprotobuf-lite.so.23 \ - /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.23 - ln -sf $LIB_DIR/libicudata.so.70 \ - /usr/lib/x86_64-linux-gnu/libicudata.so.70 - rm -rf /var/lib/mysql/ - mysqld --initialize - cp -r /var/lib/mysql $CRAFT_STAGE/var/lib - chown 584788:584788 $CRAFT_STAGE/var/lib/mysql override-prime: | craftctl default mv -f $CRAFT_PRIME/etc/mysql/mysql.cnf $CRAFT_PRIME/etc/mysql/my.cnf