How to use how to use Version Catalog in a settings.gradle.kts for buildscript dependencies?

In Introduce Version Catalog, initially intentionally only for Glide by vorburger · Pull Request #2306 · google/android-fhir · GitHub I am successfully starting to migrate a project to Sharing dependency versions between projects.

In Use Version Catalog for Jackson Buildscript Dependencies by vorburger · Pull Request #2305 · google/android-fhir · GitHub I am attempting to use a libs.bundle from such a Version Catalog directly in a settings.gradle.kts inside a buildscript { dependencies { classpath(libs.bundles.jackson) but this fails with an Unresolved reference: libs error.

Am I just stupid and making a dumb typo like mistake here, or is this “impossible” - perhaps due to the “chicken and egg” problem which How to use version catalog in the root `settings.gradle.kts` file alludes to? If so, is the only solution / recommendation to simply not use the Version Catalog for buildscript dependencies?

Actually, my recommendation is to not use buildscript dependencies at all.
Most often when you feel the need to have buildscript dependencies, a better option would be to have some custom task or plugin in buildSrc or an included build, to keep the build scripts as declarative as possible. That would then also allow to use version catalog as it will then be a normal dependency of the plugin-building project.

But yes, you are right, within the settings script you have the chicken-and-egg problem for buildscript dependencies as well as settings plugins, because by design a settings plugin can define a version catalog in its implementation and so version catalogs are only available after the settings plugins are applied, which means that neither buildscript dependencies nor settings plugins can be taken from the version catalog, unless you throw in some custom parsing of the TOML to get the information you need from the file.