Skip to content

Fix mariadb install post script#7320

Merged
christopherco merged 2 commits intomicrosoft:mainfrom
AZaugg:mariadb-postscript-fix
Jan 19, 2024
Merged

Fix mariadb install post script#7320
christopherco merged 2 commits intomicrosoft:mainfrom
AZaugg:mariadb-postscript-fix

Conversation

@AZaugg
Copy link
Copy Markdown
Contributor

@AZaugg AZaugg commented Jan 18, 2024

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./SPECS/LICENSES-AND-NOTICES/data/licenses.json, ./SPECS/LICENSES-AND-NOTICES/LICENSES-MAP.md, ./SPECS/LICENSES-AND-NOTICES/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

The post scripts for mariadb don't run due to missing script. As part of cmake install, mariadb-install-db script is removed. Adding patch to ensure script is correctly added to buildroot

Installing/Updating: mariadb-connector-c-config-3.1.10-6.cm2.noarch
Installing/Updating: mariadb-server-10.6.9-5.cm2.x86_64
/var/tmp/rpm-tmp.wjMLcK: line 3: mysql_install_db: command not found
Change Log
  • patch upstream mariadb to ensure scripts that RPM post scripts need to finalise the install, work as expected
Does this affect the toolchain?

NO

Test Methodology
  • Rebuilt package and confirmed
    Rebuild mariadb package with CMake patch
INFO[0000][scheduler] Reading DOT graph from /home/azaugg/CBL-Mariner/build/pkg_artifacts/preprocessed_graph.dot
INFO[0000][scheduler] Reading DOT graph from /home/azaugg/CBL-Mariner/build/pkg_artifacts/preprocessed_graph.dot
INFO[0000][scheduler] Successfully created solvable subgraph
INFO[0000][scheduler] Building 43 nodes with 8 workers
INFO[0000][scheduler] Building: mariadb-10.6.9-6.cm2.src.rpm
INFO[0846][scheduler] Built: mariadb-10.6.9-6.cm2.src.rpm -> [/home/azaugg/CBL-Mariner/out/RPMS/x86_64/mariadb-10.6.9-6.cm2.x86_64.rpm /home/azaugg/CBL-Mariner/out/RPMS/x86_64/mariadb-debuginfo-10.6.9-6.cm2.x86_64.rpm /home/azaugg/CBL-Mariner/out/RPMS/x86_64/mariadb-devel-10.6.9-6.cm2.x86_64.rpm /home/azaugg/CBL-Mariner/out/RPMS/x86_64/mariadb-errmsg-10.6.9-6.cm2.x86_64.rpm /home/azaugg/CBL-Mariner/out/RPMS/x86_64/mariadb-server-10.6.9-6.cm2.x86_64.rpm /home/azaugg/CBL-Mariner/out/RPMS/x86_64/mariadb-server-galera-10.6.9-6.cm2.x86_64.rpm]
INFO[0846][scheduler] 0 currently active build(s): [].
INFO[0846][scheduler] All packages built
INFO[0847][scheduler] ---------------------------
INFO[0847][scheduler] --------- Summary ---------
INFO[0847][scheduler] ---------------------------
INFO[0847][scheduler] Number of built SRPMs:             1
INFO[0847][scheduler] Number of tested SRPMs:            0
INFO[0847][scheduler] Number of prebuilt SRPMs:          0
INFO[0847][scheduler] Number of prebuilt delta SRPMs:    0
INFO[0847][scheduler] Number of skipped SRPMs tests:     0
INFO[0847][scheduler] Number of failed SRPMs:            0
INFO[0847][scheduler] Number of failed SRPMs tests:      0
INFO[0847][scheduler] Number of blocked SRPMs:           0
INFO[0847][scheduler] Number of blocked SRPMs tests:     0
INFO[0847][scheduler] Number of unresolved dependencies: 0
INFO[0847][scheduler] Built SRPMs:
INFO[0847][scheduler] --> mariadb-10.6.9-6.cm2.src.rpm
INFO[0847][scheduler] Writing DOT graph to /home/azaugg/CBL-Mariner/build/pkg_artifacts/built_graph.dot
INFO[0847][scheduler] Waiting for outstanding processes to be created
Finished updating /home/azaugg/CBL-Mariner/out/RPMS
azaugg@azaugg-ld1 [ ~/CBL-Mariner/toolkit ] [ mysql-user-add ] $ cd /tmp/
azaugg@azaugg-ld1 [ /tmp ]  $ mkdir bu
azaugg@azaugg-ld1 [ /tmp ]  $ sudo cp /home/azaugg/CBL-Mariner/out/RPMS/x86_64/mariadb-10.6.9-6.cm2.x86_64.rpm bu/
[sudo] password for azaugg:
azaugg@azaugg-ld1 [ /tmp ]  $ cd bu/
azaugg@azaugg-ld1 [ /tmp/bu ]  $ ls
mariadb-10.6.9-6.cm2.x86_64.rpm
azaugg@azaugg-ld1 [ /tmp/bu ]  $ sudo chown azaugg: mariadb-10.6.9-6.cm2.x86_64.rpm
azaugg@azaugg-ld1 [ /tmp/bu ]  $ rpm2cpio mariadb-10.6.9-6.cm2.x86_64.rpm  | cpio -idm
395558 blocks
azaugg@azaugg-ld1 [ /tmp/bu ]  $ cd usr/bin/
azaugg@azaugg-ld1 [ /tmp/bu/usr/bin ]  $ ls -l mysql_install_db
lrwxrwxrwx 1 azaugg eng 18 Jan 18 06:13 mysql_install_db -> mariadb-install-db
azaugg@azaugg-ld1 [ /tmp/bu/usr/bin ]  $ ls -l mariadb-install-db
-rwxr-xr-x 1 azaugg eng 22013 Jan 18 05:59 mariadb-install-db

After exploding the package, you can see that the mariadb-install-db and the associated symlink is in place.

The post scripts for mariadb don't run due to missing script. As part
of cmake install, mariadb-install-db script is removed. Adding patch
to ensure script is correctly added to buildroot
@AZaugg AZaugg requested a review from a team as a code owner January 18, 2024 16:33
@microsoft-github-policy-service microsoft-github-policy-service Bot added the main PR Destined for main label Jan 18, 2024
/sbin/ldconfig
chown mysql:mysql %{_sharedstatedir}/mysql || :
mysql_install_db --datadir="%{_sharedstatedir}/mysql" --user="mysql" --basedir="%{_prefix}" >/dev/null || :
mariadb-install-db --datadir="%{_sharedstatedir}/mysql" --user="mysql" --basedir="%{_prefix}" >/dev/null || :
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fixes: #7297

Copy link
Copy Markdown
Member

@mfrw mfrw left a comment

Choose a reason for hiding this comment

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

Test Build:

Copy link
Copy Markdown
Member

@mfrw mfrw left a comment

Choose a reason for hiding this comment

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

LGTM :)
Thanks

@christopherco christopherco merged commit d311a29 into microsoft:main Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main PR Destined for main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants