Repository: conan-io/conan
Pull request #17781 (2025-02-14 16:13:21)

Define syntax for env-vars custom separators in profile files
Changelog: Fix: Allow msys2 subsystem path inheriting from environment variables
Docs: Omit

Close https://github.com/conan-io/conan/issues/15908
Close https://github.com/conan-io/conan/pull/15957



Patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 02a8ad199..6297ae0f1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,17 +16,44 @@ concurrency:
   cancel-in-progress: true
 
 jobs:
+  set_python_versions:
+    runs-on: ubuntu-latest
+    outputs:
+      python_versions_linux_windows: ${{ steps.set_versions.outputs.python_versions_linux_windows }}
+      python_versions_macos: ${{ steps.set_versions.outputs.python_versions_macos }}
+    name: Determine Python versions
+    steps:
+      - name: Determine Python versions
+        id: set_versions
+        run: |
+          if [[ "${{ github.ref }}" == "refs/heads/develop2" || "${{ github.ref }}" == refs/heads/release/* ]]; then
+            echo "python_versions_linux_windows=['3.13', '3.6']" >> $GITHUB_OUTPUT
+            echo "python_versions_macos=['3.13', '3.8']" >> $GITHUB_OUTPUT
+          else
+            echo "python_versions_linux_windows=['3.10']" >> $GITHUB_OUTPUT
+            echo "python_versions_macos=['3.10']" >> $GITHUB_OUTPUT
+          fi
+
   linux_suite:
+    needs: set_python_versions
     uses: ./.github/workflows/linux-tests.yml
     name: Linux test suite
+    with:
+      python-versions: ${{ needs.set_python_versions.outputs.python_versions_linux_windows }}
 
   osx_suite:
+    needs: set_python_versions
     uses: ./.github/workflows/osx-tests.yml
     name: OSX test suite
+    with:
+      python-versions: ${{ needs.set_python_versions.outputs.python_versions_macos }}
 
   windows_suite:
+    needs: set_python_versions
     uses: ./.github/workflows/win-tests.yml
     name: Windows test suite
+    with:
+      python-versions: ${{ needs.set_python_versions.outputs.python_versions_linux_windows }}
 
   code_coverage:
     runs-on: ubuntu-latest
@@ -63,6 +90,7 @@ jobs:
     runs-on: ubuntu-latest
     name: Deploy to TestPyPI
     if: github.ref == 'refs/heads/develop2'
+    needs: [linux_suite, osx_suite, windows_suite]
     steps:
       - name: Checkout code
         uses: actions/checkout@v4
diff --git a/conan/api/model/list.py b/conan/api/model/list.py
index abd43e93c..c7149e1b2 100644
--- a/conan/api/model/list.py
+++ b/conan/api/model/list.py
@@ -16,9 +16,6 @@ class MultiPackagesList:
     def __init__(self):
         self.lists = {}
 
-    def setdefault(self, key, default):
-        return self.lists.setdefault(key, default)
-
     def __getitem__(self, name):
         try:
             return self.lists[name]
@@ -57,11 +54,6 @@ class MultiPackagesList:
         pkglist.lists = result
         return pkglist
 
-    @staticmethod
-    def from_graph(graph, graph_recipes=None, graph_binaries=None):
-        graph = {"graph": graph.serialize()}
-        return MultiPackagesList._define_graph(graph, graph_recipes, graph_binaries)
-
     @staticmethod
     def load_graph(graphfile, graph_recipes=None, graph_binaries=None):
         if not os.path.isfile(graphfile):
diff --git a/conan/api/output.py b/conan/api/output.py
index 25fa62698..6989abc07 100644
--- a/conan/api/output.py
+++ b/conan/api/output.py
@@ -175,7 +175,7 @@ class ConanOutput:
 
         return self
 
-    def _write_message(self, msg, fg=None, bg=None):
+    def _write_message(self, msg, fg=None, bg=None, newline=True):
         if isinstance(msg, dict):
             # For traces we can receive a dict already, we try to transform then into more natural
             # text
@@ -195,8 +195,11 @@ class ConanOutput:
         else:
             ret += "{}".format(msg)
 
+        if newline:
+            ret = "%s\n" % ret
+
         with self.lock:
-            self.stream.write("{}\n".format(ret))
+            self.stream.write(ret)
             self.stream.flush()
 
     def trace(self, msg):
diff --git a/conan/api/subapi/workspace.py b/conan/api/subapi/workspace.py
index 446d08347..8eb077496 100644
--- a/conan/api/subapi/workspace.py
+++ b/conan/api/subapi/workspace.py
@@ -3,16 +3,20 @@ import os
 import shutil
 from pathlib import Path
 
+from conan import ConanFile
+from conan.api.model import RecipeReference
 from conan.api.output import ConanOutput
 from conan.cli import make_abs_path
+from conan.errors import ConanException
 from conan.internal.conan_app import ConanApp
 from conan.internal.model.workspace import Workspace
 from conan.tools.scm import Git
-from conan.errors import ConanException
-from conans.client.graph.graph import RECIPE_EDITABLE
+from conans.client.graph.graph import RECIPE_EDITABLE, DepsGraph, CONTEXT_HOST, RECIPE_VIRTUAL, Node, \
+    RECIPE_CONSUMER
+from conans.client.graph.graph import TransitiveRequirement
+from conans.client.graph.profile_node_definer import consumer_definer
 from conans.client.loader import load_python_file
 from conans.client.source import retrieve_exports_sources
-from conan.api.model import RecipeReference
 from conans.util.files import merge_directories
 
 
@@ -203,3 +207,47 @@ class WorkspaceAPI:
         for ref, info in editables.items():
             if info["path"].replace("\\", "/") == path:
                 return RecipeReference.loads(ref)
+
+    def collapse_editables(self, deps_graph, profile_host, profile_build):
+        ConanOutput().title(f"Collapsing workspace editables")
+
+        root_class = self._ws.root_conanfile()
+        if root_class is not None:
+            conanfile = root_class("conanws.py base project Conanfile")
+            consumer_definer(conanfile, profile_host, profile_build)
+            root = Node(None, conanfile, context=CONTEXT_HOST, recipe=RECIPE_CONSUMER,
+                        path=self._folder)  # path lets use the conanws.py folder
+            root.should_build = True  # It is a consumer, this is something we are building
+            for field in ("requires", "build_requires", "test_requires", "requirements", "build",
+                          "source", "package"):
+                if getattr(conanfile, field, None):
+                    raise ConanException(f"Conanfile in conanws.py shouldn't have '{field}'")
+        else:
+            ConanOutput().info("Workspace conanfilews.py not found in the workspace folder, "
+                               "using default behavior")
+            conanfile = ConanFile(display_name="cli")
+            consumer_definer(conanfile, profile_host, profile_build)
+            root = Node(ref=None, conanfile=conanfile, context=CONTEXT_HOST, recipe=RECIPE_VIRTUAL)
+
+        result = DepsGraph()  # TODO: We might need to copy more information from the original graph
+        result.add_node(root)
+        for node in deps_graph.nodes[1:]:  # Exclude the current root
+            if node.recipe != RECIPE_EDITABLE:
+                result.add_node(node)
+                continue
+            for r, t in node.transitive_deps.items():
+                if t.node.recipe == RECIPE_EDITABLE:
+                    continue
+                existing = root.transitive_deps.pop(r, None)
+                if existing is None:
+                    root.transitive_deps[r] = t
+                else:
+                    require = existing.require
+                    require.aggregate(r)
+                    root.transitive_deps[require] = TransitiveRequirement(require, t.node)
+
+        # The graph edges must be defined too
+        for r, t in root.transitive_deps.items():
+            result.add_edge(root, t.node, r)
+
+        return result
diff --git a/conan/cli/commands/new.py b/conan/cli/commands/new.py
index 374f9548e..a4ea59b87 100644
--- a/conan/cli/commands/new.py
+++ b/conan/cli/commands/new.py
@@ -46,6 +46,7 @@ def new(conan_api, parser, *args):
             definitions[k] = v
 
     files = conan_api.new.get_template(args.template)  # First priority: user folder
+    is_builtin = False
     if not files:  # then, try the templates in the Conan home
         files = conan_api.new.get_home_template(args.template)
     if files:
@@ -53,10 +54,13 @@ def new(conan_api, parser, *args):
     else:
         template_files = conan_api.new.get_builtin_template(args.template)
         non_template_files = {}
+        is_builtin = True
 
     if not template_files and not non_template_files:
         raise ConanException("Template doesn't exist or not a folder: {}".format(args.template))
 
+    if is_builtin and args.template == "workspace":  # hardcoded for the workspace special case
+        definitions["name"] = "liba"
     template_files = conan_api.new.render(template_files, definitions)
 
     # Saving the resulting files
diff --git a/conan/cli/commands/remote.py b/conan/cli/commands/remote.py
index 2770f3f36..a22529f54 100644
--- a/conan/cli/commands/remote.py
+++ b/conan/cli/commands/remote.py
@@ -278,7 +278,7 @@ def print_auth_json(results):
 @conan_subcommand(formatters={"text": print_auth, "json": print_auth_json})
 def remote_auth(conan_api, parser, subparser, *args):
     """
-    Authenticate in the defined remotes. Use CONAN_LOGIN* and CONAN_PASSWORD* variables if available.
+    Authenticate in the defined remotes. Use CONAN_LOGIN_USERNAME* and CONAN_PASSWORD* variables if available.
     Ask for username and password interactively in case (re-)authentication is required and there are
     no CONAN_LOGIN* and CONAN_PASSWORD* variables available which could be used.
     Usually you'd use this method over conan remote login for scripting which needs to run in CI
@@ -288,7 +288,7 @@ def remote_auth(conan_api, parser, subparser, *args):
                                           " The pattern uses 'fnmatch' style wildcards.")
     subparser.add_argument("--with-user", action="store_true",
                            help="Only try to auth in those remotes that already "
-                                "have a username or a CONAN_LOGIN_ env-var defined")
+                                "have a username or a CONAN_LOGIN_USERNAME* env-var defined")
     subparser.add_argument("--force", action="store_true",
                            help="Force authentication for anonymous-enabled repositories. "
                                 "Can be used for force authentication in case your Artifactory "
diff --git a/conan/cli/commands/workspace.py b/conan/cli/commands/workspace.py
index 474068fdf..ed49e7820 100644
--- a/conan/cli/commands/workspace.py
+++ b/conan/cli/commands/workspace.py
@@ -3,6 +3,7 @@ import os
 
 from conan.api.conan_api import ConanAPI
 from conan.api.output import ConanOutput, cli_out_write
+from conan.api.subapi.workspace import WorkspaceAPI
 from conan.cli import make_abs_path
 from conan.cli.args import add_reference_args, add_common_install_arguments, add_lockfile_args
 from conan.cli.command import conan_command, conan_subcommand
@@ -163,8 +164,62 @@ def workspace_build(conan_api: ConanAPI, parser, subparser, *args):
         conan_api.local.build(conanfile)
 
 
+@conan_subcommand()
+def workspace_install(conan_api: ConanAPI, parser, subparser, *args):
+    """
+    Install the workspace as a monolith, installing only external dependencies to the workspace,
+    generating a single result (generators, etc) for the whole workspace.
+    """
+    subparser.add_argument("-g", "--generator", action="append", help='Generators to use')
+    subparser.add_argument("-of", "--output-folder",
+                           help='The root output folder for generated and build files')
+    subparser.add_argument("--envs-generation", default=None, choices=["false"],
+                           help="Generation strategy for virtual environment files for the root")
+    add_common_install_arguments(subparser)
+    add_lockfile_args(subparser)
+    args = parser.parse_args(*args)
+    # Basic collaborators: remotes, lockfile, profiles
+    remotes = conan_api.remotes.list(args.remote) if not args.no_remote else []
+    overrides = eval(args.lockfile_overrides) if args.lockfile_overrides else None
+    # The lockfile by default if not defined will be read from the root workspace folder
+    ws_folder = conan_api.workspace.folder()
+    lockfile = conan_api.lockfile.get_lockfile(lockfile=args.lockfile, conanfile_path=ws_folder,
+                                               cwd=None,
+                                               partial=args.lockfile_partial, overrides=overrides)
+    profile_host, profile_build = conan_api.profiles.get_profiles_from_args(args)
+    print_profiles(profile_host, profile_build)
+
+    conan_api.workspace.info()  # FIXME: Just to force error if WS not enabled
+    # Build a dependency graph with all editables as requirements
+    editables = conan_api.workspace.editable_packages
+    requires = [ref for ref in editables]
+    if not requires:
+        raise ConanException("This workspace cannot be installed, it doesn't have any editable")
+    deps_graph = conan_api.graph.load_graph_requires(requires, [],
+                                                     profile_host, profile_build, lockfile,
+                                                     remotes, args.build, args.update)
+    deps_graph.report_graph_error()
+    print_graph_basic(deps_graph)
+
+    # Collapsing the graph
+    ws_graph = conan_api.workspace.collapse_editables(deps_graph, profile_host, profile_build)
+    ConanOutput().subtitle("Collapsed graph")
+    print_graph_basic(ws_graph)
+
+    conan_api.graph.analyze_binaries(ws_graph, args.build, remotes=remotes, update=args.update,
+                                     lockfile=lockfile)
+    print_graph_packages(ws_graph)
+    conan_api.install.install_binaries(deps_graph=ws_graph, remotes=remotes)
+    output_folder = make_abs_path(args.output_folder) if args.output_folder else None
+    conan_api.install.install_consumer(ws_graph, args.generator, ws_folder, output_folder,
+                                       envs_generation=args.envs_generation)
+
+
 @conan_command(group="Consumer")
 def workspace(conan_api, parser, *args):  # noqa
     """
     Manage Conan workspaces (group of packages in editable mode)
     """
+    if (WorkspaceAPI.TEST_ENABLED or os.getenv("CONAN_WORKSPACE_ENABLE")) != "will_break_next":
+        raise ConanException("Workspace command disabled without CONAN_WORKSPACE_ENABLE env var,"
+                             "please read the docs about this 'incubating' feature")
diff --git a/conan/cps/cps.py b/conan/cps/cps.py
index 4fab7911a..d8c9fb15c 100644
--- a/conan/cps/cps.py
+++ b/conan/cps/cps.py
@@ -115,12 +115,16 @@ class CPS:
         self.description = None
         self.license = None
         self.website = None
+        self.prefix = None
 
     def serialize(self):
-        cps = {"cps_version": "0.12.0",
+        cps = {"cps_version": "0.13.0",
                "name": self.name,
                "version": self.version}
 
+        if self.prefix is not None:
+            cps["prefix"] = self.prefix
+
         # Supplemental
         for data in "license", "description", "website":
             if getattr(self, data, None):
@@ -143,6 +147,7 @@ class CPS:
     def deserialize(data):
         cps = CPS()
         cps.name = data.get("name")
+        cps.prefix = data.get("prefix")
         cps.version = data.get("version")
         cps.license = data.get("license")
         cps.description = data.get("description")
@@ -157,6 +162,7 @@ class CPS:
     @staticmethod
     def from_conan(dep):
         cps = CPS(dep.ref.name, str(dep.ref.version))
+        cps.prefix = dep.package_folder.replace("\\", "/")
         # supplemental
         cps.license = dep.license
         cps.description = dep.description
diff --git a/conan/internal/api/install/generators.py b/conan/internal/api/install/generators.py
index 61c0d7b85..fe553891f 100644
--- a/conan/internal/api/install/generators.py
+++ b/conan/internal/api/install/generators.py
@@ -11,6 +11,7 @@ from conans.util.files import save, mkdir, chdir
 
 _generators = {"CMakeToolchain": "conan.tools.cmake",
                "CMakeDeps": "conan.tools.cmake",
+               "CMakeConfigDeps": "conan.tools.cmake",
                "MesonToolchain": "conan.tools.meson",
                "MSBuildDeps": "conan.tools.microsoft",
                "MSBuildToolchain": "conan.tools.microsoft",
diff --git a/conan/internal/api/new/workspace.py b/conan/internal/api/new/workspace.py
index 7a56617eb..1a16b4476 100644
--- a/conan/internal/api/new/workspace.py
+++ b/conan/internal/api/new/workspace.py
@@ -15,19 +15,71 @@ products:
 - app1
 """
 
-workspace_files = {"conanws.yml": conanws_yml}
+cmake = """\
+cmake_minimum_required(VERSION 3.25)
+project(monorepo CXX)
 
-for lib in ("liba", "libb"):
-    definitions = {"name": lib}
-    if lib == "libb":
-        definitions["requires"] = ["liba/0.1"]
-    elif lib == "libc":
-        definitions["requires"] = ["libb/0.1"]
-    files = NewAPI.render(cmake_lib_files, definitions)
-    files = {f"{lib}/{k}": v for k, v in files.items()}
-    workspace_files.update(files)
+include(FetchContent)
 
+function(add_project SUBFOLDER)
+    message(STATUS "Adding project ${SUBFOLDER}")
+    FetchContent_Declare(
+        ${SUBFOLDER}
+        SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/${SUBFOLDER}
+        SYSTEM
+        OVERRIDE_FIND_PACKAGE
+    )
+    FetchContent_MakeAvailable(${SUBFOLDER})
+endfunction()
 
+add_project(liba)
+# They should be defined in the liba/CMakeLists.txt, but we can fix it here
+add_library(liba::liba ALIAS liba)
+add_project(libb)
+add_library(libb::libb ALIAS libb)
+add_project(app1)
+"""
+
+conanfile = '''\
+from conan import Workspace
+from conan import ConanFile
+from conan.tools.cmake import CMakeDeps, CMakeToolchain, cmake_layout
+
+
+class MyWs(ConanFile):
+    """ This is a special conanfile, used only for workspace definition of layout
+    and generators. It shouldn't have requirements, tool_requirements. It shouldn't have
+    build() or package() methods
+    """
+    settings = "os", "compiler", "build_type", "arch"
+
+    def generate(self):
+        deps = CMakeDeps(self)
+        deps.generate()
+        tc = CMakeToolchain(self)
+        tc.generate()
+
+    def layout(self):
+        cmake_layout(self)
+
+
+class Ws(Workspace):
+    def root_conanfile(self):
+        return MyWs
+'''
+
+workspace_files = {"conanws.yml": conanws_yml,
+                   "CMakeLists.txt": cmake,
+                   "conanws.py": conanfile,
+                   ".gitignore": "build"}
+# liba
+files = {f"liba/{k}": v for k, v in cmake_lib_files.items()}
+workspace_files.update(files)
+# libb
+files = NewAPI.render(cmake_lib_files, {"requires": ["liba/0.1"], "name": "libb"})
+files = {f"libb/{k}": v for k, v in files.items()}
+workspace_files.update(files)
+# app
 files = NewAPI.render(cmake_exe_files, definitions={"name": "app1", "requires": ["libb/0.1"]})
 files = {f"app1/{k}": v for k, v in files.items()}
 workspace_files.update(files)
diff --git a/conan/internal/conan_app.py b/conan/internal/conan_app.py
index 1d9a8540f..72196af08 100644
--- a/conan/internal/conan_app.py
+++ b/conan/internal/conan_app.py
@@ -8,7 +8,6 @@ from conans.client.graph.range_resolver import RangeResolver
 from conans.client.loader import ConanFileLoader, load_python_file
 from conans.client.remote_manager import RemoteManager
 from conans.client.rest.auth_manager import ConanApiAuthManager
-from conans.client.rest.conan_requester import ConanRequester
 from conan.internal.api.remotes.localdb import LocalDB
 
 
diff --git a/conan/internal/deploy.py b/conan/internal/deploy.py
index d3a42d89a..1c2889546 100644
--- a/conan/internal/deploy.py
+++ b/conan/internal/deploy.py
@@ -1,6 +1,7 @@
 import filecmp
 import os
 import shutil
+import fnmatch
 
 from conan.internal.cache.home_paths import HomePaths
 from conan.api.output import ConanOutput
@@ -99,6 +100,8 @@ def full_deploy(graph, output_folder):
 def runtime_deploy(graph, output_folder):
     """
     Deploy all the shared libraries and the executables of the dependencies in a flat directory.
+
+    It preserves symlinks in case the configuration tools.deployer:symlinks is True.
     """
     conanfile = graph.root.conanfile
     output = ConanOutput(scope="runtime_deploy")
@@ -125,7 +128,7 @@ def runtime_deploy(graph, output_folder):
             if not os.path.isdir(libdir):
                 output.warning(f"{dep.ref} {libdir} does not exist")
                 continue
-            count += _flatten_directory(dep, libdir, output_folder, symlinks, [".dylib", ".so"])
+            count += _flatten_directory(dep, libdir, output_folder, symlinks, [".dylib*", ".so*"])
 
         output.info(f"Copied {count} files from {dep.ref}")
     conanfile.output.success(f"Runtime deployed to folder: {output_folder}")
@@ -142,11 +145,15 @@ def _flatten_directory(dep, src_dir, output_dir, symlinks, extension_filter=None
     output = ConanOutput(scope="runtime_deploy")
     for src_dirpath, _, src_filenames in os.walk(src_dir, followlinks=symlinks):
         for src_filename in src_filenames:
-            if extension_filter and not any(src_filename.endswith(ext) for ext in extension_filter):
+            if extension_filter and not any(fnmatch.fnmatch(src_filename, f'*{ext}') for ext in extension_filter):
                 continue
 
             src_filepath = os.path.join(src_dirpath, src_filename)
             dest_filepath = os.path.join(output_dir, src_filename)
+
+            if not symlinks and os.path.islink(src_filepath):
+                continue
+
             if os.path.exists(dest_filepath):
                 if filecmp.cmp(src_filepath, dest_filepath):  # Be efficient, do not copy
                     output.verbose(f"{dest_filepath} exists with same contents, skipping copy")
@@ -156,7 +163,9 @@ def _flatten_directory(dep, src_dir, output_dir, symlinks, extension_filter=None
 
             try:
                 file_count += 1
-                shutil.copy2(src_filepath, dest_filepath, follow_symlinks=symlinks)
+                # INFO: When follow_symlinks is false, and src is a symbolic link, it tries to
+                # copy all metadata from the src symbolic link to the newly created dst link
+                shutil.copy2(src_filepath, dest_filepath, follow_symlinks=not symlinks)
                 output.verbose(f"Copied {src_filepath} into {output_dir}")
             except Exception as e:
                 if "WinError 1314" in str(e):
diff --git a/conan/internal/model/conf.py b/conan/internal/model/conf.py
index f7b9bcc32..335d7c08c 100644
--- a/conan/internal/model/conf.py
+++ b/conan/internal/model/conf.py
@@ -28,6 +28,7 @@ BUILT_IN_CONFS = {
     "core.download:retry_wait": "Seconds to wait between download attempts from Conan server",
     "core.download:download_cache": "Define path to a file download cache",
     "core.cache:storage_path": "Absolute path where the packages and database are stored",
+    "core:update_policy": "(Legacy). If equal 'legacy' when multiple remotes, update based on order of remotes, only the timestamp of the first occurrence of each revision counts.",
     # Sources backup
     "core.sources:download_cache": "Folder to store the sources backup",
     "core.sources:download_urls": "List of URLs to download backup sources from",
diff --git a/conan/internal/model/workspace.py b/conan/internal/model/workspace.py
index 13f89e3ce..01079f35b 100644
--- a/conan/internal/model/workspace.py
+++ b/conan/internal/model/workspace.py
@@ -89,3 +89,6 @@ class Workspace:
         conanfile = loader.load_named(conanfile_path, name=None, version=None, user=None,
                                       channel=None, remotes=None, graph_lock=None)
         return conanfile
+
+    def root_conanfile(self):  # noqa
+        return None
diff --git a/conan/internal/runner/docker.py b/conan/internal/runner/docker.py
index c21bee192..b6d24f832 100644
--- a/conan/internal/runner/docker.py
+++ b/conan/internal/runner/docker.py
@@ -1,37 +1,68 @@
-from collections import namedtuple
+from argparse import Namespace
 import os
+import sys
 import json
 import platform
 import shutil
+from typing import Optional, NamedTuple, Dict, List
 import yaml
+from conan.api.conan_api import ConanAPI
 from conan.api.model import ListPattern
 from conan.api.output import Color, ConanOutput
 from conan.cli import make_abs_path
 from conan.internal.runner import RunnerException
 from conan.errors import ConanException
+from pathlib import Path
+from conan.internal.model.profile import Profile
 from conan.internal.model.version import Version
+from conan.internal.runner.output import RunnerOutput
+from conan.internal.conan_app import ConanApp
 
+class _ContainerConfig(NamedTuple):
+    class Build(NamedTuple):
+        dockerfile: Optional[str] = None
+        build_context: Optional[str] = None
+        build_args: Optional[Dict[str, str]] = None
+        cache_from: Optional[List[str]] = None
+        platform: Optional[str] = None
+
+    class Run(NamedTuple):
+        name: Optional[str] = None
+        environment: Optional[Dict[str, str]] = None
+        user: Optional[str] = None
+        privileged: Optional[bool] = None
+        cap_add: Optional[List[str]] = None
+        security_opt: Optional[List[str]] = None
+        volumes: Optional[Dict[str, str]] = None
+        network: Optional[str] = None
+
+    image: Optional[str] = None
+    build: Build = Build()
+    run: Run = Run()
+
+    @staticmethod
+    def load(file_path: Optional[str]) -> '_ContainerConfig':
+        # Container config
+        # https://containers.dev/implementors/json_reference/
+        if not file_path:
+            return _ContainerConfig()
 
-def config_parser(file_path):
-    Build = namedtuple('Build', ['dockerfile', 'build_context', 'build_args', 'cache_from'])
-    Run = namedtuple('Run', ['name', 'environment', 'user', 'privileged', 'cap_add', 'security_opt', 'volumes', 'network'])
-    Conf = namedtuple('Conf', ['image', 'build', 'run'])
-    if file_path:
         def _instans_or_error(value, obj):
             if value and (not isinstance(value, obj)):
                 raise ConanException(f"docker runner configfile syntax error: {value} must be a {obj.__name__}")
             return value
         with open(file_path, 'r') as f:
             runnerfile = yaml.safe_load(f)
-        return Conf(
+        return _ContainerConfig(
             image=_instans_or_error(runnerfile.get('image'), str),
-            build=Build(
+            build=_ContainerConfig.Build(
                 dockerfile=_instans_or_error(runnerfile.get('build', {}).get('dockerfile'), str),
                 build_context=_instans_or_error(runnerfile.get('build', {}).get('build_context'), str),
                 build_args=_instans_or_error(runnerfile.get('build', {}).get('build_args'), dict),
                 cache_from=_instans_or_error(runnerfile.get('build', {}).get('cacheFrom'), list),
+                platform=_instans_or_error(runnerfile.get('build', {}).get('platform'), str),
             ),
-            run=Run(
+            run=_ContainerConfig.Run(
                 name=_instans_or_error(runnerfile.get('run', {}).get('name'), str),
                 environment=_instans_or_error(runnerfile.get('run', {}).get('containerEnv'), dict),
                 user=_instans_or_error(runnerfile.get('run', {}).get('containerUser'), str),
@@ -42,90 +73,120 @@ def config_parser(file_path):
                 network=_instans_or_error(runnerfile.get('run', {}).get('network'), str),
             )
         )
-    else:
-        return Conf(
-            image=None,
-            build=Build(dockerfile=None, build_context=None, build_args=None, cache_from=None),
-            run=Run(name=None, environment=None, user=None, privileged=None, cap_add=None,
-                    security_opt=None, volumes=None, network=None)
-        )
-
-
-def _docker_info(msg, error=False):
-    fg=Color.BRIGHT_MAGENTA
-    if error:
-        fg=Color.BRIGHT_RED
-    ConanOutput().status('\n┌'+'─'*(2+len(msg))+'┐', fg=fg)
-    ConanOutput().status(f'| {msg} |', fg=fg)
-    ConanOutput().status('└'+'─'*(2+len(msg))+'┘\n', fg=fg)
-
 
 class DockerRunner:
-    def __init__(self, conan_api, command, host_profile, build_profile, args, raw_args):
-        import docker.api.build
-        try:
-            docker_base_urls = [
-                None, # Default docker configuration, let the python library detect the socket
-                os.environ.get('DOCKER_HOST'), # Connect to socket defined in DOCKER_HOST
-                'unix:///var/run/docker.sock', # Default linux socket
-                f'unix://{os.path.expanduser("~")}/.rd/docker.sock' # Rancher linux socket
-            ]
-            for base_url in docker_base_urls:
-                try:
-                    ConanOutput().verbose(f'Trying to connect to docker "{base_url or "default"}" socket')
-                    self.docker_client = docker.DockerClient(base_url=base_url, version='auto')
-                    ConanOutput().verbose(f'Connected to docker "{base_url or "default"}" socket')
-                    break
-                except:
-                    continue
-            self.docker_api = self.docker_client.api
-            docker.api.build.process_dockerfile = lambda dockerfile, path: ('Dockerfile', dockerfile)
-        except:
-            raise ConanException("Docker Client failed to initialize."
-                                 "\n - Check if docker is installed and running"
-                                 "\n - Run 'pip install conan[runners]'")
+    def __init__(self, conan_api: ConanAPI, command: str, host_profile: Profile, build_profile: Profile, args: Namespace, raw_args: list[str]):
+        self.logger = ConanOutput()
+        self.docker_client = self._initialize_docker_client()
+        self.docker_api = self.docker_client.api
         self.conan_api = conan_api
         self.build_profile = build_profile
+        self.abs_host_path = self._get_abs_host_path(args.path)
         self.args = args
-        self.abs_host_path = make_abs_path(args.path)
         if args.format:
             raise ConanException("format argument is forbidden if running in a docker runner")
 
-        # Container config
-        # https://containers.dev/implementors/json_reference/
-        self.configfile = config_parser(host_profile.runner.get('configfile'))
+        self.configfile = _ContainerConfig.load(host_profile.runner.get('configfile'))
         self.dockerfile = host_profile.runner.get('dockerfile') or self.configfile.build.dockerfile
         self.docker_build_context = host_profile.runner.get('build_context') or self.configfile.build.build_context
+        self.platform = host_profile.runner.get('platform') or self.configfile.build.platform
         self.image = host_profile.runner.get('image') or self.configfile.image
         if not (self.dockerfile or self.image):
             raise ConanException("'dockerfile' or docker image name is needed")
         self.image = self.image or 'conan-runner-default'
-        self.name = self.configfile.run.name or f'conan-runner-{host_profile.runner.get("suffix", "docker")}'
+        self.name = self.configfile.run.name or host_profile.runner.get("name", "conan-runner-docker")
         self.remove = str(host_profile.runner.get('remove', 'false')).lower() == 'true'
         self.cache = str(host_profile.runner.get('cache', 'clean'))
+        if self.cache not in ['clean', 'copy', 'shared']:
+            raise ConanException(f'Invalid cache value: "{self.cache}". Valid values are: clean, copy, shared')
         self.container = None
+        self.raw_args = raw_args
+        self.command = command
+        self.runner_logger = RunnerOutput(self.name)
 
-        # Runner config>
-        self.abs_runner_home_path = os.path.join(self.abs_host_path, '.conanrunner')
-        self.docker_user_name = self.configfile.run.user or 'root'
-        self.abs_docker_path = os.path.join(f'/{self.docker_user_name}/conanrunner', os.path.basename(self.abs_host_path)).replace("\\","/")
-
-        # Update conan command and some paths to run inside the container
-        raw_args[raw_args.index(args.path)] = self.abs_docker_path
-        self.command = ' '.join([f'conan {command}'] + [f'"{raw_arg}"' if ' ' in raw_arg else raw_arg for raw_arg in raw_args] + ['-f json > create.json'])
-
-    def run(self):
+    def run(self) -> None:
         """
-        run conan inside a Docker continer
+        Run conan inside a Docker container
         """
-        if self.dockerfile:
-            _docker_info(f'Building the Docker image: {self.image}')
-            self.build_image()
-        volumes, environment = self.create_runner_environment()
-        error = False
+        self._build_image()
+        self._start_container()
+        try:
+            self._init_container()
+            self._run_command(self.command)
+            self._update_local_cache()
+        except RunnerException as e:
+            raise ConanException(f'"{e.command}" inside docker fail')
+        finally:
+            if self.container:
+                error = sys.exc_info()[0] is not None # Check if error has been raised
+                log = self.logger.error if error else self.logger.status
+                log('Stopping container')
+                self.container.stop()
+                if self.remove:
+                    log('Removing container')
+                    self.container.remove()
+
+    def _initialize_docker_client(self):
+        import docker
+        import docker.api.build
+
+        docker_base_urls = [
+            None,  # Default docker configuration
+            os.environ.get('DOCKER_HOST'),  # From DOCKER_HOST environment variable
+            'unix:///var/run/docker.sock',  # Default Linux socket
+            f'unix://{os.path.expanduser("~")}/.rd/docker.sock'  # Rancher Linux socket
+        ]
+
+        for base_url in docker_base_urls:
+            try:
+                self.logger.verbose(f'Trying to connect to Docker: "{base_url or "default"}"')
+                client = docker.DockerClient(base_url=base_url, version='auto')
+                self.logger.verbose(f'Connected to Docker: "{base_url or "default"}"')
+                docker.api.build.process_dockerfile = lambda dockerfile, path: ('Dockerfile', dockerfile)
+                return client
+            except Exception:
+                continue
+        raise ConanException("Docker Client failed to initialize."
+                             "\n - Check if docker is installed and running"
+                             "\n - Run 'pip install conan[runners]'")
+
+    def _get_abs_host_path(self, path: str) -> Path:
+        abs_path = make_abs_path(path)
+        if abs_path is None:
+            raise ConanException("Could not determine the absolute path.")
+        return Path(abs_path)
+
+    def _build_image(self) -> None:
+        if not self.dockerfile:
+            return
+        self.logger.status(f'Building the Docker image: {self.image}')
+        dockerfile_file_path = self.dockerfile
+        if os.path.isdir(self.dockerfile):
+            dockerfile_file_path = os.path.join(self.dockerfile, 'Dockerfile')
+        with open(dockerfile_file_path) as f:
+            build_path = self.docker_build_context or os.path.dirname(dockerfile_file_path)
+            self.logger.highlight(f"Dockerfile path: '{dockerfile_file_path}'")
+            self.logger.highlight(f"Docker build context: '{build_path}'\n")
+            docker_build_logs = self.docker_api.build(
+                path=build_path,
+                dockerfile=f.read(),
+                tag=self.image,
+                platform=self.platform,
+                buildargs=self.configfile.build.build_args,
+                cache_from=self.configfile.build.cache_from,
+            )
+        for chunk in docker_build_logs:
+            for line in chunk.decode("utf-8").split('\r\n'):
+                if line:
+                    stream = json.loads(line).get('stream')
+                    if stream:
+                        self.logger.status(stream.strip())
+
+    def _start_container(self) -> None:
+        volumes, environment = self._create_runner_environment()
         try:
             if self.docker_client.containers.list(all=True, filters={'name': self.name}):
-                _docker_info('Starting the docker container')
+                self.logger.status('Starting the docker container', fg=Color.BRIGHT_MAGENTA)
                 self.container = self.docker_client.containers.get(self.name)
                 self.container.start()
             else:
@@ -133,7 +194,7 @@ class DockerRunner:
                     environment.update(self.configfile.run.environment)
                 if self.configfile.run.volumes:
                     volumes.update(self.configfile.run.volumes)
-                _docker_info('Creating the docker container')
+                self.logger.status('Creating the docker container', fg=Color.BRIGHT_MAGENTA)
                 self.container = self.docker_client.containers.run(
                     self.image,
                     "/bin/bash -c 'while true; do sleep 30; done;'",
@@ -147,69 +208,28 @@ class DockerRunner:
                     detach=True,
                     auto_remove=False,
                     network=self.configfile.run.network)
-            _docker_info(f'Container {self.name} running')
+            self.logger.status(f'Container {self.name} running', fg=Color.BRIGHT_MAGENTA)
         except Exception as e:
             raise ConanException(f'Imposible to run the container "{self.name}" with image "{self.image}"'
                                  f'\n\n{str(e)}')
-        try:
-            self.init_container()
-            self.run_command(self.command)
-            self.update_local_cache()
-        except ConanException as e:
-            error = True
-            raise e
-        except RunnerException as e:
-            error = True
-            raise ConanException(f'"{e.command}" inside docker fail'
-                                 f'\n\nLast command output: {str(e.stdout_log)}')
-        finally:
-            if self.container:
-                error_prefix = 'ERROR: ' if error else ''
-                _docker_info(f'{error_prefix}Stopping container', error)
-                self.container.stop()
-                if self.remove:
-                    _docker_info(f'{error_prefix}Removing container', error)
-                    self.container.remove()
-
-    def build_image(self):
-        dockerfile_file_path = self.dockerfile
-        if os.path.isdir(self.dockerfile):
-            dockerfile_file_path = os.path.join(self.dockerfile, 'Dockerfile')
-        with open(dockerfile_file_path) as f:
-            build_path = self.docker_build_context or os.path.dirname(dockerfile_file_path)
-            ConanOutput().highlight(f"Dockerfile path: '{dockerfile_file_path}'")
-            ConanOutput().highlight(f"Docker build context: '{build_path}'\n")
-            docker_build_logs = self.docker_api.build(
-                path=build_path,
-                dockerfile=f.read(),
-                tag=self.image,
-                buildargs=self.configfile.build.build_args,
-                cache_from=self.configfile.build.cache_from,
-            )
-        for chunk in docker_build_logs:
-                for line in chunk.decode("utf-8").split('\r\n'):
-                    if line:
-                        stream = json.loads(line).get('stream')
-                        if stream:
-                            ConanOutput().status(stream.strip())
 
-    def run_command(self, command, workdir=None, log=True):
+    def _run_command(self, command: str, workdir: Optional[str] = None, verbose: bool = True) -> tuple[str, str]:
         workdir = workdir or self.abs_docker_path
-        if log:
-            _docker_info(f'Running in container: "{command}"')
+        log = self.runner_logger.status if verbose else self.runner_logger.verbose
+        log(f'$ {command}', fg=Color.BLUE)
         exec_instance = self.docker_api.exec_create(self.container.id, f"/bin/bash -c '{command}'", workdir=workdir, tty=True)
         exec_output = self.docker_api.exec_start(exec_instance['Id'], tty=True, stream=True, demux=True,)
         stderr_log, stdout_log = '', ''
         try:
             for (stdout_out, stderr_out) in exec_output:
                 if stdout_out is not None:
-                    stdout_log += stdout_out.decode('utf-8', errors='ignore').strip()
-                    if log:
-                        ConanOutput().status(stdout_out.decode('utf-8', errors='ignore').strip())
+                    decoded = stdout_out.decode('utf-8', errors='ignore').strip()
+                    stdout_log += decoded
+                    log(decoded)
                 if stderr_out is not None:
-                    stderr_log += stderr_out.decode('utf-8', errors='ignore').strip()
-                    if log:
-                        ConanOutput().status(stderr_out.decode('utf-8', errors='ignore').strip())
+                    decoded = stderr_out.decode('utf-8', errors='ignore').strip()
+                    stderr_log += decoded
+                    log(decoded)
         except Exception as e:
             if platform.system() == 'Windows':
                 import pywintypes
@@ -222,52 +242,92 @@ class DockerRunner:
             raise RunnerException(command=command, stdout_log=stdout_log, stderr_log=stderr_log)
         return stdout_log, stderr_log
 
-    def create_runner_environment(self):
+    def _get_volumes_and_docker_path(self) -> tuple[dict,str]:
+        app = ConanApp(self.conan_api)
+        remotes = self.conan_api.remotes.list(self.args.remote) if not self.args.no_remote else []
+        conanfile = app.loader.load_consumer(self.abs_host_path / "conanfile.py", remotes=remotes)
+        abs_docker_base_path = Path('/') / self.docker_user_name / 'conanrunner'
+        # Check if recipe has defined a root folder
+        # In this case, mount the root folder as the base path and update the abs_docker_path to the
+        # new relative path
+        if hasattr(conanfile, "layout"):
+            try:
+                conanfile.layout()
+                if conanfile.folders.root:
+                    abs_path = self._get_abs_host_path(conanfile.folders.root)
+                    if self.abs_host_path.is_relative_to(abs_path):
+                        abs_docker_base_path /= abs_path.name
+                        volumes = {abs_path: {'bind': abs_docker_base_path.as_posix(), 'mode': 'rw'}}
+                        abs_docker_path = abs_docker_base_path / self.abs_host_path.relative_to(abs_path)
+                        return volumes, abs_docker_path.as_posix()
+            except:
+                pass
+        abs_docker_path = (abs_docker_base_path / self.abs_host_path.name).as_posix()
+        volumes = {self.abs_host_path: {'bind': abs_docker_path, 'mode': 'rw'}}
+        return volumes, abs_docker_path
+
+    def _create_runner_environment(self) -> tuple[dict, dict]:
+        # Runner configuration
+        self.abs_runner_home_path = self.abs_host_path / '.conanrunner'
+        self.docker_user_name = self.configfile.run.user or 'root'
+        volumes, self.abs_docker_path = self._get_volumes_and_docker_path()
         shutil.rmtree(self.abs_runner_home_path, ignore_errors=True)
-        volumes = {self.abs_host_path: {'bind': self.abs_docker_path, 'mode': 'rw'}}
         environment = {'CONAN_RUNNER_ENVIRONMENT': '1'}
 
+        # Update conan command and some paths to run inside the container
+        self.raw_args[self.raw_args.index(self.args.path)] = self.abs_docker_path
+        self.command = ' '.join([f'conan {self.command}'] + [f'"{raw_arg}"' if ' ' in raw_arg else raw_arg for raw_arg in self.raw_args] + ['-f json > create.json'])
+
         if self.cache == 'shared':
             volumes[self.conan_api.home_folder] = {'bind': f'/{self.docker_user_name}/.conan2', 'mode': 'rw'}
 
         if self.cache in ['clean', 'copy']:
             # Copy all conan profiles and config files to docker workspace
-            os.mkdir(self.abs_runner_home_path)
-            shutil.copytree(
-                os.path.join(self.conan_api.home_folder, 'profiles'),
-                os.path.join(self.abs_runner_home_path, 'profiles')
-            )
+            for profile in set(self.args.profile_host + (self.args.profile_build or [])):
+                profile_path = self.conan_api.profiles.get_path(profile)
+                dest_filename = self.abs_runner_home_path / 'profiles' / Path(profile)
+                if not dest_filename.exists():
+                    dest_filename.parent.mkdir(parents=True, exist_ok=True)
+                self.logger.verbose(f"Copying profile '{profile}': {profile_path} -> {dest_filename}")
+                shutil.copy(profile_path, dest_filename)
+            if not self.args.profile_build:
+                dest_filename = self.abs_runner_home_path / 'profiles' / "default"
+                default_build_profile = self.conan_api.profiles.get_default_build()
+                self.logger.verbose(f"Copying default profile: {default_build_profile} -> {dest_filename}")
+                shutil.copy(default_build_profile, dest_filename.as_posix())
+
             for file_name in ['global.conf', 'settings.yml', 'remotes.json']:
-                src_file = os.path.join(self.conan_api.home_folder, file_name)
-                if os.path.exists(src_file):
-                    shutil.copy(src_file, os.path.join(self.abs_runner_home_path, file_name))
+                src_file = Path(self.conan_api.home_folder) / file_name
+                if src_file.exists():
+                    self.logger.verbose(f"Copying {src_file} -> {self.abs_runner_home_path / file_name}")
+                    shutil.copy(src_file, self.abs_runner_home_path / file_name)
 
             if self.cache == 'copy':
-                tgz_path = os.path.join(self.abs_runner_home_path, 'local_cache_save.tgz')
-                _docker_info(f'Save host cache in: {tgz_path}')
+                tgz_path = self.abs_runner_home_path / 'local_cache_save.tgz'
+                self.logger.status(f'Save host cache in: {tgz_path}')
                 self.conan_api.cache.save(self.conan_api.list.select(ListPattern("*:*")), tgz_path)
         return volumes, environment
 
-    def init_container(self):
+    def _init_container(self) -> None:
         min_conan_version = '2.1'
-        stdout, _ = self.run_command('conan --version', log=True)
+        stdout, _ = self._run_command('conan --version', verbose=True)
         docker_conan_version = str(stdout.split('Conan version ')[1].replace('\n', '').replace('\r', '')) # Remove all characters and color
         if Version(docker_conan_version) <= Version(min_conan_version):
-            ConanOutput().status(f'ERROR: conan version inside the container must be greater than {min_conan_version}', fg=Color.BRIGHT_RED)
-            raise ConanException( f'conan version inside the container must be greater than {min_conan_version}')
+            raise ConanException(f'conan version inside the container must be greater than {min_conan_version}')
         if self.cache != 'shared':
-            self.run_command('mkdir -p ${HOME}/.conan2/profiles', log=False)
-            self.run_command('cp -r "'+self.abs_docker_path+'/.conanrunner/profiles/." ${HOME}/.conan2/profiles/.', log=False)
+            self._run_command('mkdir -p ${HOME}/.conan2/profiles', verbose=False)
+            self._run_command('cp -r "'+self.abs_docker_path+'/.conanrunner/profiles/." ${HOME}/.conan2/profiles/.', verbose=False)
+
             for file_name in ['global.conf', 'settings.yml', 'remotes.json']:
-                if os.path.exists( os.path.join(self.abs_runner_home_path, file_name)):
-                    self.run_command('cp "'+self.abs_docker_path+'/.conanrunner/'+file_name+'" ${HOME}/.conan2/'+file_name, log=False)
+                if (self.abs_runner_home_path / file_name).exists():
+                    self._run_command('cp "'+self.abs_docker_path+'/.conanrunner/'+file_name+'" ${HOME}/.conan2/'+file_name, verbose=False)
             if self.cache in ['copy']:
-                self.run_command('conan cache restore "'+self.abs_docker_path+'/.conanrunner/local_cache_save.tgz"')
+                self._run_command('conan cache restore "'+self.abs_docker_path+'/.conanrunner/local_cache_save.tgz"')
 
-    def update_local_cache(self):
+    def _update_local_cache(self) -> None:
         if self.cache != 'shared':
-            self.run_command('conan list --graph=create.json --graph-binaries=build --format=json > pkglist.json', log=False)
-            self.run_command('conan cache save --list=pkglist.json --file "'+self.abs_docker_path+'"/.conanrunner/docker_cache_save.tgz')
-            tgz_path = os.path.join(self.abs_runner_home_path, 'docker_cache_save.tgz')
-            _docker_info(f'Restore host cache from: {tgz_path}')
-            package_list = self.conan_api.cache.restore(tgz_path)
+            self._run_command('conan list --graph=create.json --graph-binaries=build --format=json > pkglist.json', verbose=False)
+            self._run_command('conan cache save --list=pkglist.json --file "'+self.abs_docker_path+'"/.conanrunner/docker_cache_save.tgz')
+            tgz_path = self.abs_runner_home_path / 'docker_cache_save.tgz'
+            self.logger.status(f'Restore host cache from: {tgz_path}')
+            self.conan_api.cache.restore(tgz_path)
diff --git a/conan/internal/runner/output.py b/conan/internal/runner/output.py
new file mode 100644
index 000000000..a1732aa9e
--- /dev/null
+++ b/conan/internal/runner/output.py
@@ -0,0 +1,12 @@
+from conan.api.output import Color, ConanOutput
+
+class RunnerOutput(ConanOutput):
+    def __init__(self, runner_info: str):
+        super().__init__()
+        self.set_warnings_as_errors(True) # Make log errors blocker
+        self._prefix = f"{runner_info} | "
+
+    def _write_message(self, msg, fg=None, bg=None, newline=True):
+        for line in msg.splitlines():
+            super()._write_message(self._prefix, Color.BLACK, Color.BRIGHT_YELLOW, newline=False)
+            super()._write_message(line, fg, bg, newline)
diff --git a/conan/tools/cmake/__init__.py b/conan/tools/cmake/__init__.py
index e57f14a65..d6a1c431f 100644
--- a/conan/tools/cmake/__init__.py
+++ b/conan/tools/cmake/__init__.py
@@ -1,14 +1,31 @@
+from conan.errors import ConanException
 from conan.tools.cmake.toolchain.toolchain import CMakeToolchain
 from conan.tools.cmake.cmake import CMake
 from conan.tools.cmake.layout import cmake_layout
 
 
 def CMakeDeps(conanfile):  # noqa
-    if conanfile.conf.get("tools.cmake.cmakedeps:new", choices=["will_break_next"]):
+    if conanfile.conf.get("tools.cmake.cmakedeps:new",
+                          choices=["will_break_next", "recipe_will_break"]) == "will_break_next":
         from conan.tools.cmake.cmakedeps2.cmakedeps import CMakeDeps2
-        conanfile.output.warning("Using the new CMakeDeps generator, behind the "
+        conanfile.output.warning("Using the new CMakeConfigDeps generator, behind the "
                                  "'tools.cmake.cmakedeps:new' gate conf. This conf will change "
                                  "next release, breaking, so use it only for testing and dev")
         return CMakeDeps2(conanfile)
     from conan.tools.cmake.cmakedeps.cmakedeps import CMakeDeps as _CMakeDeps
     return _CMakeDeps(conanfile)
+
+
+
+def CMakeConfigDeps(conanfile):  # noqa
+    if conanfile.conf.get("tools.cmake.cmakedeps:new",
+                          choices=["will_break_next", "recipe_will_break"]):
+        from conan.tools.cmake.cmakedeps2.cmakedeps import CMakeDeps2
+        conanfile.output.warning("Using the new CMakeConfigDeps generator, behind the "
+                                 "'tools.cmake.cmakedeps:new' gate conf. This conf will change "
+                                 "next release, breaking, so use it only for testing and dev")
+        return CMakeDeps2(conanfile)
+    else:
+        raise ConanException("CMakeConfigDeps is being used in conanfile, but the conf "
+                             "'tools.cmake.cmakedeps:new' is not enabled. This is an incubating"
+                             "feature, please define it to enable CMakeConfigDeps usage")
diff --git a/conan/tools/cmake/cmake.py b/conan/tools/cmake/cmake.py
index ae3acd5ca..4a6a5eca7 100644
--- a/conan/tools/cmake/cmake.py
+++ b/conan/tools/cmake/cmake.py
@@ -185,7 +185,7 @@ class CMake:
 
     def install(self, build_type=None, component=None, cli_args=None, stdout=None, stderr=None):
         """
-        Equivalent to run ``cmake --build . --target=install``
+        Equivalent to running ``cmake --install``
 
         :param component: The specific component to install, if any
         :param build_type: Use it only to override the value defined in the settings.build_type.
diff --git a/conan/tools/cmake/cmakedeps/templates/config.py b/conan/tools/cmake/cmakedeps/templates/config.py
index 1fc1d61d1..f7e9fe1ba 100644
--- a/conan/tools/cmake/cmakedeps/templates/config.py
+++ b/conan/tools/cmake/cmakedeps/templates/config.py
@@ -112,5 +112,12 @@ class ConfigTemplate(CMakeDepsFileTemplate):
                                           REQUIRED_VARS {{ file_name }}_VERSION
                                           VERSION_VAR {{ file_name }}_VERSION)
         mark_as_advanced({{ file_name }}_FOUND {{ file_name }}_VERSION)
+
+        {% for prefix in additional_variables_prefixes %}
+        set({{ prefix }}_FOUND 1)
+        set({{ prefix }}_VERSION "{{ version }}")
+        mark_as_advanced({{ prefix }}_FOUND {{ prefix }}_VERSION)
+        {% endfor %}
+
         {% endif %}
         """)
diff --git a/conan/tools/cmake/cmakedeps2/cmakedeps.py b/conan/tools/cmake/cmakedeps2/cmakedeps.py
index e190c268a..cae3326c0 100644
--- a/conan/tools/cmake/cmakedeps2/cmakedeps.py
+++ b/conan/tools/cmake/cmakedeps2/cmakedeps.py
@@ -61,7 +61,7 @@ class CMakeDeps2:
                 continue
 
             if require.direct:
-                direct_deps.append(dep)
+                direct_deps.append((require, dep))
             config = ConfigTemplate2(self, dep)
             ret[config.filename] = config.content()
             config_version = ConfigVersionTemplate2(self, dep)
@@ -78,14 +78,16 @@ class CMakeDeps2:
     def _print_help(self, direct_deps):
         if direct_deps:
             msg = ["CMakeDeps necessary find_package() and targets for your CMakeLists.txt"]
-            targets = []
-            for dep in direct_deps:
-                msg.append(f"    find_package({self.get_cmake_filename(dep)})")
-                if not dep.cpp_info.exe:
+            link_targets = []
+            for (require, dep) in direct_deps:
+                note = " # Optional. This is a tool-require, can't link its targets" \
+                    if require.build else ""
+                msg.append(f"    find_package({self.get_cmake_filename(dep)}){note}")
+                if not require.build and not dep.cpp_info.exe:
                     target_name = self.get_property("cmake_target_name", dep)
-                    targets.append(target_name or f"{dep.ref.name}::{dep.ref.name}")
-            if targets:
-                msg.append(f"    target_link_libraries(... {' '.join(targets)})")
+                    link_targets.append(target_name or f"{dep.ref.name}::{dep.ref.name}")
+            if link_targets:
+                msg.append(f"    target_link_libraries(... {' '.join(link_targets)})")
             self._conanfile.output.info("\n".join(msg), fg=Color.CYAN)
 
     def set_property(self, dep, prop, value, build_context=False):
diff --git a/conan/tools/cps/cps_deps.py b/conan/tools/cps/cps_deps.py
index 578a87c01..d416d4ad1 100644
--- a/conan/tools/cps/cps_deps.py
+++ b/conan/tools/cps/cps_deps.py
@@ -32,7 +32,7 @@ class CPSDeps:
     def generate(self):
         cps_folder = os.path.join(self._conanfile.folders.base_build, "build", "cps")
         config_name = self._config_name()
-        folder = os.path.join(cps_folder, config_name)
+        folder = os.path.join(cps_folder, config_name, "cps")  # CMake wants a "/cps/" folder
         self._conanfile.output.info(f"[CPSDeps] folder {cps_folder}")
         deps = self._conanfile.dependencies.host.items()
         mapping = {}
diff --git a/conan/tools/env/environment.py b/conan/tools/env/environment.py
index c42d9f060..b5ef89ff5 100644
--- a/conan/tools/env/environment.py
+++ b/conan/tools/env/environment.py
@@ -84,18 +84,19 @@ class _EnvValue:
     def dumps(self):
         result = []
         path = "(path)" if self._path else ""
+        sep = f"(sep={self._sep})" if self._sep != " " and not self._path else ""
         if not self._values:  # Empty means unset
             result.append("{}=!".format(self._name))
         elif _EnvVarPlaceHolder in self._values:
             index = self._values.index(_EnvVarPlaceHolder)
             for v in self._values[:index]:
-                result.append("{}=+{}{}".format(self._name, path, v))
+                result.append("{}=+{}{}{}".format(self._name, path, sep, v))
             for v in self._values[index+1:]:
-                result.append("{}+={}{}".format(self._name, path, v))
+                result.append("{}+={}{}{}".format(self._name, path, sep, v))
         else:
             append = ""
             for v in self._values:
-                result.append("{}{}={}{}".format(self._name, append, path, v))
+                result.append("{}{}={}{}{}".format(self._name, append, path, sep, v))
                 append = "+"
         return "\n".join(result)
 
@@ -644,6 +645,14 @@ class ProfileEnvironment:
                 env = Environment()
                 if method == "unset":
                     env.unset(name)
+                elif value.strip().startswith("(sep="):
+                    value = value.strip()
+                    sep = value[5]
+                    value = value[7:]
+                    if value.strip().startswith("(path)"):
+                        msg = f"Cannot use (sep) and (path) qualifiers simultaneously: {line}"
+                        raise ConanException(msg)
+                    getattr(env, method)(name, value, separator=sep)
                 else:
                     if value.strip().startswith("(path)"):
                         value = value.strip()
diff --git a/conan/tools/gnu/autotoolstoolchain.py b/conan/tools/gnu/autotoolstoolchain.py
index fd5421cc8..e2daf568f 100644
--- a/conan/tools/gnu/autotoolstoolchain.py
+++ b/conan/tools/gnu/autotoolstoolchain.py
@@ -257,7 +257,7 @@ class AutotoolsToolchain:
         env.append("LDFLAGS", self.ldflags)
         env.prepend_path("PKG_CONFIG_PATH", self._conanfile.generators_folder)
         # Issue related: https://github.com/conan-io/conan/issues/15486
-        if self._is_cross_building and getattr(self._conanfile, 'conf_build', False):
+        if self._is_cross_building and self._conanfile.conf_build:
             compilers_build_mapping = (
                 self._conanfile.conf_build.get("tools.build:compiler_executables", default={},
                                                check_type=dict)
diff --git a/conan/tools/gnu/gnutoolchain.py b/conan/tools/gnu/gnutoolchain.py
index a23f4bf0b..1b22240e8 100644
--- a/conan/tools/gnu/gnutoolchain.py
+++ b/conan/tools/gnu/gnutoolchain.py
@@ -186,7 +186,7 @@ class GnuToolchain:
                     compiler = unix_path(self._conanfile, compiler)
                     ret[env_var] = compiler  # User/tools ones have precedence
         # Issue related: https://github.com/conan-io/conan/issues/15486
-        if self._is_cross_building and getattr(self._conanfile, 'conf_build', False):
+        if self._is_cross_building and self._conanfile.conf_build:
             compilers_build_mapping = (
                 self._conanfile.conf_build.get("tools.build:compiler_executables", default={},
                                                check_type=dict)
diff --git a/conan/tools/sbom/cyclonedx.py b/conan/tools/sbom/cyclonedx.py
index 0e0770e0b..0cd31a144 100644
--- a/conan/tools/sbom/cyclonedx.py
+++ b/conan/tools/sbom/cyclonedx.py
@@ -59,7 +59,7 @@ def cyclonedx_1_4(conanfile, name=None, add_build=False, add_tests=False, **kwar
                     }}]
         return [{"license": {
                     "id": l
-                }} for l in c.conanfile.license]
+                }} for l in component.conanfile.license]
 
     sbom_cyclonedx_1_4 = {
         **({"components": [{
diff --git a/conans/client/graph/profile_node_definer.py b/conans/client/graph/profile_node_definer.py
index 748304d03..63bbed9a0 100644
--- a/conans/client/graph/profile_node_definer.py
+++ b/conans/client/graph/profile_node_definer.py
@@ -110,3 +110,4 @@ def consumer_definer(conanfile, profile_host, profile_build):
     conanfile._conan_buildenv = profile_host.buildenv
     conanfile._conan_runenv = profile_host.runenv
     conanfile.conf = profile_host.conf.get_conanfile_conf(None, is_consumer=True)
+    conanfile.conf_build = profile_build.conf.get_conanfile_conf(None, is_consumer=True)
diff --git a/conans/client/graph/proxy.py b/conans/client/graph/proxy.py
index d7a364f97..66a56c283 100644
--- a/conans/client/graph/proxy.py
+++ b/conans/client/graph/proxy.py
@@ -14,6 +14,7 @@ class ConanProxy:
         self._cache = conan_app.cache
         self._remote_manager = conan_app.remote_manager
         self._resolved = {}  # Cache of the requested recipes to optimize calls
+        self._legacy_update = conan_app.global_conf.get("core:update_policy", choices=["legacy"])
 
     def get_recipe(self, ref, remotes, update, check_update):
         """
@@ -97,6 +98,7 @@ class ConanProxy:
         output = ConanOutput(scope=str(reference))
 
         results = []
+        need_update = should_update_reference(reference, update) or check_update
         for remote in remotes:
             if remote.allowed_packages and not any(reference.matches(f, is_consumer=False)
                                                    for f in remote.allowed_packages):
@@ -104,11 +106,19 @@ class ConanProxy:
                 continue
             output.info(f"Checking remote: {remote.name}")
             try:
+                if self._legacy_update and need_update:
+                    if not getattr(ConanProxy, "update_policy_legacy_warning", None):
+                        ConanProxy.update_policy_legacy_warning = True
+                        ConanOutput().warning("The 'core:update_policy' conf is deprecated and will "
+                                              "be removed in future versions", warn_tag="deprecated")
+                    refs = self._remote_manager.get_recipe_revisions_references(reference, remote)
+                    results.extend([{'remote': remote, 'ref': ref} for ref in refs])
+                    continue
                 if not reference.revision:
                     ref = self._remote_manager.get_latest_recipe_reference(reference, remote)
                 else:
                     ref = self._remote_manager.get_recipe_revision_reference(reference, remote)
-                if not should_update_reference(reference, update) and not check_update:
+                if not need_update:
                     return remote, ref
                 results.append({'remote': remote, 'ref': ref})
             except NotFoundException:
@@ -117,6 +127,17 @@ class ConanProxy:
         if len(results) == 0:
             return None, None
 
+        if self._legacy_update and need_update:
+            # Use only the first occurence of each revision in the remotes
+            filtered_results = []
+            revisions = set()
+            for r in results:
+                ref = r["ref"]
+                if ref.revision not in revisions:
+                    revisions.add(ref.revision)
+                    filtered_results.append(r)
+            results = filtered_results
+
         remotes_results = sorted(results, key=lambda k: k['ref'].timestamp, reverse=True)
         # get the latest revision from all remotes
         found_rrev = remotes_results[0]
diff --git a/conans/client/rest_client_local_recipe_index.py b/conans/client/rest_client_local_recipe_index.py
index 26b398383..7ab87848a 100644
--- a/conans/client/rest_client_local_recipe_index.py
+++ b/conans/client/rest_client_local_recipe_index.py
@@ -138,6 +138,9 @@ class RestApiClientLocalRecipesIndex:
     def get_recipe_revision_reference(self, ref):
         new_ref = self._export_recipe(ref)
         if new_ref != ref:
+            ConanOutput().warning(f"A specific revision '{ref.repr_notime()}' was requested, but it "
+                                  "doesn't match the current available revision in source. The "
+                                  "local-recipes-index can't provide a specific revision")
             raise RecipeNotFoundException(ref)
         return new_ref
 
diff --git a/pyinstaller.py b/pyinstaller.py
index 75323736c..d6c651499 100644
--- a/pyinstaller.py
+++ b/pyinstaller.py
@@ -105,15 +105,26 @@ def pyinstall(source_folder, onefile=False):
               # Modules that can be imported in ConanFile conan.tools and errors
               "--collect-submodules=conan.cli.commands "
               "--hidden-import=conan.errors "
-              "--hidden-import=conan.tools.microsoft "
-              "--hidden-import=conan.tools.gnu --hidden-import=conan.tools.cmake "
-              "--hidden-import=conan.tools.meson --hidden-import=conan.tools.apple "
-              "--hidden-import=conan.tools.build --hidden-import=conan.tools.env "
+              "--hidden-import=conan.tools.android "
+              "--hidden-import=conan.tools.apple "
+              "--hidden-import=conan.tools.build "
+              "--hidden-import=conan.tools.cmake "
+              "--hidden-import=conan.tools.env "
               "--hidden-import=conan.tools.files "
-              "--hidden-import=conan.tools.google --hidden-import=conan.tools.intel "
-              "--hidden-import=conan.tools.layout --hidden-import=conan.tools.premake "
-              "--hidden-import=conan.tools.qbs --hidden-import=conan.tools.scm "
-              "--hidden-import=conan.tools.system --hidden-import=conan.tools.system.package_manager")
+              "--hidden-import=conan.tools.gnu "
+              "--hidden-import=conan.tools.google "
+              "--hidden-import=conan.tools.intel "
+              "--hidden-import=conan.tools.layout "
+              "--hidden-import=conan.tools.meson "
+              "--hidden-import=conan.tools.microsoft "
+              "--hidden-import=conan.tools.premake "
+              "--hidden-import=conan.tools.qbs "
+              "--hidden-import=conan.tools.ros "
+              "--hidden-import=conan.tools.sbom "
+              "--hidden-import=conan.tools.scm "
+              "--hidden-import=conan.tools.scons "
+              "--hidden-import=conan.tools.system "
+              "--hidden-import=conan.tools.system.package_manager")
 
     if not os.path.exists(pyinstaller_path):
         os.mkdir(pyinstaller_path)
@@ -128,7 +139,6 @@ def pyinstall(source_folder, onefile=False):
             file.write(content)
         win_ver = ["--version-file", win_ver_file]
 
-
     if onefile:
         distpath = os.path.join(pyinstaller_path, "dist", "conan")
     else:


Test patch:
diff --git a/.ci/docker/conan-tests b/.ci/docker/conan-tests
index 17a7cedb4..1ee57ab22 100644
--- a/.ci/docker/conan-tests
+++ b/.ci/docker/conan-tests
@@ -7,6 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive
 ENV PY36=3.6.15 \
     PY38=3.8.6 \
     PY39=3.9.2 \
+    PY310=3.10.16 \
     PY312=3.12.3 \
     PY313=3.13.0 \
     CMAKE_3_15=/usr/share/cmake-3.15.7/bin/cmake \
@@ -95,6 +96,7 @@ RUN curl https://pyenv.run | bash && \
     pyenv install $PY36 && \
     pyenv install $PY38 && \
     pyenv install $PY39 && \
+    pyenv install $PY310 && \
     pyenv install $PY312 && \
     pyenv install $PY313 && \
     pyenv global $PY39 && \
diff --git a/.github/workflows/linux-tests.yml b/.github/workflows/linux-tests.yml
index 2cbfeaf15..43b3ad3e0 100644
--- a/.github/workflows/linux-tests.yml
+++ b/.github/workflows/linux-tests.yml
@@ -2,6 +2,10 @@ name: Linux tests
 
 on:
   workflow_call:
+    inputs:
+      python-versions:
+        required: true
+        type: string
 
 jobs:
   build_container:
@@ -49,7 +53,7 @@ jobs:
       options: --user conan
     strategy:
       matrix:
-        python-version: [3.13, 3.9, 3.8, 3.6]
+        python-version: ${{ fromJson(inputs.python-versions) }}
         test-type: [unittests, integration, functional]
         include:
         - test-type: unittests
@@ -92,19 +96,30 @@ jobs:
   linux_docker_tests:
     needs: build_container
     runs-on: ubuntu-latest
+    container:
+      image: ghcr.io/${{ github.repository_owner }}/conan-tests:${{ needs.build_container.outputs.image_tag }}
+      options: --user conan
     strategy:
       matrix:
-        python-version: [3.13, 3.9]
+        # Use modern versions due to docker incompatibility with python <3.8
+        python-version: ${{ github.event_name != 'pull_request' && fromJson('["3.13", "3.9"]') || fromJson('["3.10"]') }}
+
     name: Docker Runner Tests (${{ matrix.python-version }})
     steps:
-      - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v5
-        with:
-          python-version: ${{ matrix.python-version }}
-
       - name: Checkout code
         uses: actions/checkout@v4
 
+      - name: Set up Python ${{ matrix.python-version }}
+        run: |
+          pyenv global ${{ matrix.python-version }}
+          python --version
+
+      - name: Cache pip
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements_runner*.txt') }}
+
       - name: Install dependencies
         run: |
           pip install --upgrade pip
diff --git a/.github/workflows/osx-tests.yml b/.github/workflows/osx-tests.yml
index 767132ca8..1942d955c 100644
--- a/.github/workflows/osx-tests.yml
+++ b/.github/workflows/osx-tests.yml
@@ -2,6 +2,10 @@ name: OSX Tests
 
 on:
   workflow_call:
+    inputs:
+      python-versions:
+        required: true
+        type: string
 
 jobs:
   osx_setup:
@@ -11,10 +15,10 @@ jobs:
       - name: Checkout code
         uses: actions/checkout@v4
 
-      - name: Set up Python 3.8
+      - name: Set up Python
         uses: actions/setup-python@v5
         with:
-          python-version: 3.8
+          python-version: '3.10'
 
       - name: Cache pip packages
         id: cache-pip
@@ -32,7 +36,7 @@ jobs:
           pip install meson
 
       - name: Uninstall default CMake
-        run: brew uninstall cmake || true
+        run: brew uninstall --formula cmake || true
 
       - name: Cache Homebrew packages
         id: cache-brew
@@ -114,7 +118,7 @@ jobs:
     strategy:
       fail-fast: true
       matrix:
-        python-version: [3.8, 3.12, 3.13]
+        python-version: ${{ fromJson(inputs.python-versions) }}
         test-type: [unittests, integration, functional]
         include:
         - test-type: unittests
diff --git a/.github/workflows/win-tests.yml b/.github/workflows/win-tests.yml
index c67b62eab..75e21a273 100644
--- a/.github/workflows/win-tests.yml
+++ b/.github/workflows/win-tests.yml
@@ -2,13 +2,17 @@ name: Windows Tests
 
 on:
   workflow_call:
+    inputs:
+      python-versions:
+        required: true
+        type: string
 
 jobs:
   unit_integration_tests:
     runs-on: windows-2022
     strategy:
       matrix:
-        python-version: [3.13, 3.8, 3.6]
+        python-version: ${{ fromJson(inputs.python-versions) }}
     name: Unit & Integration Tests (${{ matrix.python-version }})
     steps:
       - name: Checkout code
@@ -59,8 +63,7 @@ jobs:
     runs-on: windows-2022
     strategy:
       matrix:
-        python-version: [3.13, 3.8, 3.6]
-
+        python-version: ${{ fromJson(inputs.python-versions) }}
     name: Functional Tests (${{ matrix.python-version }})
     steps:
       - name: Checkout code
diff --git a/conan/test/utils/profiles.py b/conan/test/utils/profiles.py
index aa005ce15..9f2c16381 100644
--- a/conan/test/utils/profiles.py
+++ b/conan/test/utils/profiles.py
@@ -5,11 +5,7 @@ from conan.internal.model.profile import Profile
 from conans.util.files import save
 
 
-def create_profile(folder, name, settings=None, package_settings=None, env=None,
-                   package_env=None, options=None, conf=None):
-
-    package_env = package_env or {}
-
+def create_profile(folder, name, settings=None, package_settings=None, options=None):
     profile = Profile()
     profile.settings = settings or {}
 
@@ -19,18 +15,4 @@ def create_profile(folder, name, settings=None, package_settings=None, env=None,
     if options:
         profile.options = Options(options_values=options)
 
-    if conf:
-        _conf = "\n".join(conf) if isinstance(conf, list) else conf
-        profile.conf.loads(_conf)
-
-    """for package_name, envs in package_env.items():
-        for var_name, value in envs:
-            # Initialize Environment without Conanfile, what else can we do
-            profile._environments.set_default(package_name, Environment(conanfile=None))\
-                .define(var_name, value)
-
-    for var_name, value in env or {}:
-        profile._environments.set_default(None, Environment(conanfile=None)) \
-            .define(var_name, value)"""
-
     save(os.path.join(folder, name), profile.dumps())
diff --git a/conan/test/utils/tools.py b/conan/test/utils/tools.py
index 98de894d4..f195cdfe9 100644
--- a/conan/test/utils/tools.py
+++ b/conan/test/utils/tools.py
@@ -8,17 +8,15 @@ import shutil
 import socket
 import sys
 import textwrap
-import threading
-import time
 import traceback
 import uuid
 import zipfile
-from collections import OrderedDict
 from contextlib import contextmanager
+from inspect import getframeinfo, stack
 from urllib.parse import urlsplit, urlunsplit
 
-import bottle
 import mock
+import pytest
 import requests
 from mock import Mock
 from requests.exceptions import HTTPError
@@ -35,11 +33,8 @@ from conan.api.model import Remote
 from conan.cli.cli import Cli, _CONAN_INTERNAL_CUSTOM_COMMANDS_PATH
 from conan.test.utils.env import environment_update
 from conan.internal.errors import NotFoundException
-from conan.internal.model.manifest import FileTreeManifest
 from conan.api.model import PkgReference
-from conan.internal.model.profile import Profile
 from conan.api.model import RecipeReference
-from conan.internal.model.settings import Settings
 from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.artifactory import ArtifactoryServer
 from conan.test.utils.mocks import RedirectedInputStream
@@ -83,28 +78,6 @@ default_profiles = {
         """)
 }
 
-def inc_recipe_manifest_timestamp(cache, reference, inc_time):
-    ref = RecipeReference.loads(reference)
-    path = cache.get_latest_recipe_reference(ref).export()
-    manifest = FileTreeManifest.load(path)
-    manifest.time += inc_time
-    manifest.save(path)
-
-
-def inc_package_manifest_timestamp(cache, package_reference, inc_time):
-    path = cache.get_latest_package_reference(package_reference).package()
-    manifest = FileTreeManifest.load(path)
-    manifest.time += inc_time
-    manifest.save(path)
-
-
-def create_profile(profile=None, settings=None):
-    if profile is None:
-        profile = Profile()
-    if profile.processed_settings is None:
-        profile.processed_settings = settings or Settings()
-    return profile
-
 
 class TestingResponse(object):
     """Wraps a response from TestApp external tool
@@ -442,15 +415,6 @@ class TestClient:
         self.cache_folder = cache_folder or os.path.join(temp_folder(path_with_spaces), ".conan2")
 
         self.requester_class = requester_class
-
-        if servers and len(servers) > 1 and not isinstance(servers, OrderedDict):
-            raise Exception(textwrap.dedent("""
-                Testing framework error: Servers should be an OrderedDict. e.g:
-                    servers = OrderedDict()
-                    servers["r1"] = server
-                    servers["r2"] = TestServer()
-            """))
-
         self.servers = servers or {}
         if servers is not False:  # Do not mess with registry remotes
             self.update_servers()
@@ -629,15 +593,15 @@ class TestClient:
                 msg = " Command succeeded (failure expected): "
             else:
                 msg = " Command failed (unexpectedly): "
-            exc_message = "\n{header}\n{cmd}\n{output_header}\n{output}\n".format(
-                header='{:=^80}'.format(msg),
-                output_header='{:=^80}'.format(" Output: "),
-                cmd=command,
-                output=str(self.stderr) + str(self.stdout) + "\n" + str(self.out)
-            )
+
+            output = str(self.stderr) + str(self.stdout) + "\n"
+            exc_message = f"\n{msg:=^80}\n{command}\n{' Output: ':=^80}\n{output}\n"
             if trace:
-                exc_message += '{:=^80}'.format(" Traceback: ") + f"\n{trace}"
-            raise Exception(exc_message)
+                exc_message += f'{" Traceback: ":=^80}\n{trace}'
+
+            caller = getframeinfo(stack()[3][0])
+            exc_message = f"{caller.filename}:{caller.lineno}" + exc_message
+            pytest.fail(exc_message, pytrace=False)
 
     def save(self, files, path=None, clean_first=False):
         """ helper metod, will store files in the current folder
@@ -853,28 +817,6 @@ def get_free_port():
     return ret
 
 
-class StoppableThreadBottle(threading.Thread):
-    """
-    Real server to test download endpoints
-    """
-
-    def __init__(self, host=None, port=None):
-        self.host = host or "127.0.0.1"
-        self.server = bottle.Bottle()
-        self.port = port or get_free_port()
-        super(StoppableThreadBottle, self).__init__(target=self.server.run,
-                                                    kwargs={"host": self.host, "port": self.port})
-        self.daemon = True
-        self._stop = threading.Event()
-
-    def stop(self):
-        self._stop.set()
-
-    def run_server(self):
-        self.start()
-        time.sleep(1)
-
-
 def zipdir(path, zipfilename):
     with zipfile.ZipFile(zipfilename, 'w', zipfile.ZIP_DEFLATED) as z:
         for root, _, files in os.walk(path):
diff --git a/test/functional/command/runner_test.py b/test/functional/command/runner_test.py
index 9b1e16d87..5eae54cb5 100644
--- a/test/functional/command/runner_test.py
+++ b/test/functional/command/runner_test.py
@@ -542,9 +542,104 @@ def test_create_docker_runner_default_build_profile():
 
     client.save({"host_clean": profile_host})
     client.run("new cmake_lib -d name=pkg -d version=0.2")
-    client.run("create . -pr:h host_clean")
+    client.run("create . -pr:h host_clean -vverbose")
 
+    assert "Copying default profile" in client.out
     assert "Restore: pkg/0.2" in client.out
     assert "Restore: pkg/0.2:8631cf963dbbb4d7a378a64a6fd1dc57558bc2fe" in client.out
     assert "Restore: pkg/0.2:8631cf963dbbb4d7a378a64a6fd1dc57558bc2fe metadata" in client.out
     assert "Removing container" in client.out
+
+
+@pytest.mark.docker_runner
+@pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running")
+def test_create_docker_runner_in_subfolder():
+    client = TestClient()
+    conanfile = textwrap.dedent("""
+        import os
+        from conan import ConanFile
+        from conan.tools.files import load, copy
+        from conan.tools.cmake import CMake
+
+        class Pkg(ConanFile):
+            name = "pkg"
+            version = "1.0"
+            settings = "os", "compiler", "build_type", "arch"
+            generators = "CMakeToolchain"
+
+            def layout(self):
+                self.folders.root = ".."
+                self.folders.source = "."
+                self.folders.build = "build"
+
+            def export_sources(self):
+                folder = os.path.join(self.recipe_folder, "..")
+                copy(self, "*.txt", folder, self.export_sources_folder)
+                copy(self, "src/*.cpp", folder, self.export_sources_folder)
+                copy(self, "include/*.h", folder, self.export_sources_folder)
+
+            def source(self):
+                cmake_file = load(self, "CMakeLists.txt")
+
+            def build(self):
+                path = os.path.join(self.source_folder, "CMakeLists.txt")
+                cmake_file = load(self, path)
+                cmake = CMake(self)
+                cmake.configure()
+                cmake.build()
+
+            def package(self):
+                cmake = CMake(self)
+                cmake.install()
+            """)
+
+    header = textwrap.dedent("""
+        #pragma once
+        void hello();
+        """)
+    source = textwrap.dedent("""
+        #include <iostream>
+        void hello() {
+            std::cout << "Hello!" << std::endl;
+        }
+        """)
+
+    cmakelist = textwrap.dedent("""
+        cmake_minimum_required(VERSION 3.15)
+        project(pkg CXX)
+        add_library(pkg src/hello.cpp)
+        target_include_directories(pkg PUBLIC include)
+        set_target_properties(pkg PROPERTIES PUBLIC_HEADER "include/hello.h")
+        install(TARGETS pkg)
+
+        """)
+
+    profile_host = textwrap.dedent(f"""\
+        [settings]
+        arch={{{{ detect_api.detect_arch() }}}}
+        build_type=Release
+        compiler=gcc
+        compiler.cppstd=gnu17
+        compiler.libcxx=libstdc++11
+        compiler.version=11
+        os=Linux
+        [runner]
+        type=docker
+        dockerfile={dockerfile_path()}
+        build_context={conan_base_path()}
+        image=conan-runner-default-test
+        cache=clean
+        remove=True
+        """)
+
+    client.save({"conan/conanfile.py": conanfile,
+                "conan/host": profile_host,
+                "include/hello.h": header,
+                "src/hello.cpp": source,
+                "CMakeLists.txt": cmakelist})
+
+    with client.chdir("conan"):
+        client.run("create . -pr:h host -vverbose")
+
+    assert "Restore: pkg/1.0" in client.out
+    assert "Removing container" in client.out
diff --git a/test/functional/command/test_install_deploy.py b/test/functional/command/test_install_deploy.py
index 098c37dec..faaeb98cf 100644
--- a/test/functional/command/test_install_deploy.py
+++ b/test/functional/command/test_install_deploy.py
@@ -511,6 +511,47 @@ class TestRuntimeDeployer:
         expected = sorted(["pkga.so", "pkgb.so", "pkga.dll"])
         assert sorted(os.listdir(os.path.join(c.current_folder, "myruntime"))) == expected
 
+@pytest.mark.parametrize("symlink, expected",
+                         [(True, ["libfoo.so.0.1.0", "libfoo.so.0", "libfoo.so"]),
+                          (False, ["libfoo.so.0.1.0",])])
+def test_runtime_deploy_symlinks(symlink, expected):
+    """ The deployer runtime_deploy should preserve symlinks when deploying shared libraries
+    """
+    c = TestClient()
+    conanfile = textwrap.dedent("""
+           from conan import ConanFile
+           from conan.tools.files import copy, chdir
+           import os
+           class Pkg(ConanFile):
+               package_type = "shared-library"
+               def package(self):
+                   copy(self, "*.so*", src=self.build_folder, dst=self.package_folder)
+                   with chdir(self, os.path.join(self.package_folder, "lib")):
+                       os.symlink(src="libfoo.so.0.1.0", dst="libfoo.so.0")
+                       os.symlink(src="libfoo.so.0", dst="libfoo.so")
+           """)
+    c.save({"foo/conanfile.py": conanfile,
+            "foo/lib/libfoo.so.0.1.0": "",})
+    c.run("export-pkg foo/ --name=foo --version=0.1.0")
+    c.run(f"install --requires=foo/0.1.0 --deployer=runtime_deploy --deployer-folder=output -c:a tools.deployer:symlinks={symlink}")
+
+    sorted_expected = sorted(expected)
+    assert sorted(os.listdir(os.path.join(c.current_folder, "output"))) == sorted_expected
+    link_so_0 = os.path.join(c.current_folder, "output", "libfoo.so.0")
+    link_so = os.path.join(c.current_folder, "output", "libfoo.so")
+    lib = os.path.join(c.current_folder, "output", "libfoo.so.0.1.0")
+    # INFO: This test requires in Windows to have symlinks enabled, otherwise it will fail
+    if symlink and platform.system() != "Windows":
+        assert os.path.islink(link_so_0)
+        assert os.path.islink(link_so)
+        assert not os.path.isabs(os.readlink(link_so_0))
+        assert not os.path.isabs(os.readlink(os.path.join(link_so)))
+        assert os.path.realpath(link_so) == os.path.realpath(link_so_0)
+        assert os.path.realpath(link_so_0) == os.path.realpath(lib)
+        assert not os.path.islink(lib)
+    else:
+        assert not os.path.islink(lib)
+
 
 def test_deployer_errors():
     c = TestClient()
diff --git a/test/functional/sbom/test_cyclonedx.py b/test/functional/sbom/test_cyclonedx.py
index 92834f2a5..fecb939d5 100644
--- a/test/functional/sbom/test_cyclonedx.py
+++ b/test/functional/sbom/test_cyclonedx.py
@@ -1,4 +1,5 @@
 import textwrap
+import json
 
 import pytest
 
@@ -83,6 +84,22 @@ def test_sbom_generation_skipped_dependencies(hook_setup_post_package):
     # A skipped dependency also shows up in the sbom
     assert "pkg:conan/dep@1.0?rref=6a99f55e933fb6feeb96df134c33af44" in content
 
+@pytest.mark.parametrize("l, n", [('"simple"', 1), ('"multi1", "multi2"', 2), ('("tuple1", "tuple2")', 2)])
+def test_multi_license(hook_setup_post_package, l, n):
+    tc = hook_setup_post_package
+    conanfile = textwrap.dedent("""
+        from conan import ConanFile
+        class HelloConan(ConanFile):
+            name = 'foo'
+            version = '1.0'
+            license = %s
+    """)
+    tc.save({"conanfile.py": conanfile % l})
+    tc.run("create .")
+    create_layout = tc.created_layout()
+    cyclone_path = os.path.join(create_layout.metadata(), "sbom.cdx.json")
+    content = json.loads(tc.load(cyclone_path))
+    assert len(content["components"][0]["licenses"]) == n
 
 def test_sbom_generation_no_tool_requires(hook_setup_post_package_no_tool_requires):
     tc = hook_setup_post_package_no_tool_requires
diff --git a/test/functional/subsystems_build_test.py b/test/functional/subsystems_build_test.py
index c5f8336f7..0b396663e 100644
--- a/test/functional/subsystems_build_test.py
+++ b/test/functional/subsystems_build_test.py
@@ -83,6 +83,7 @@ class TestSubsystems:
         client.run_command('uname', assert_error=True)
         assert "'uname' is not recognized as an internal or external command" in client.out
 
+
 @pytest.mark.skipif(platform.system() != "Windows", reason="Tests Windows Subsystems")
 class TestSubsystemsBuild:
 
@@ -512,3 +513,49 @@ class TestSubsystemsCMakeBuild:
         self._build(client, generator="Visual Studio 17 2022", toolset="ClangCL")
         check_exe_run(client.out, "main", "clang", None, "Debug", "x86_64", None, subsystem=None)
         check_vs_runtime("Debug/app.exe", client, "15", "Debug", subsystem=None)
+
+
+@pytest.mark.tool("msys2")
+def test_msys2_env_vars_paths():
+    c = TestClient()
+    # A tool-requires injecting PATHs for native, should not use "_path" calls, and use
+    # 'separator=;' explicitly
+    tool = textwrap.dedent("""
+        from conan import ConanFile
+        class HelloConan(ConanFile):
+            name = "tool"
+            version = "0.1"
+            def package_info(self):
+                self.buildenv_info.append("INCLUDE", "C:/mytool/path", separator=";")
+        """)
+    conanfile = textwrap.dedent("""
+        from conan import ConanFile
+        class HelloConan(ConanFile):
+            win_bash = True
+            tool_requires = "tool/0.1"
+
+            def build(self):
+                self.run('echo "INCLUDE=$INCLUDE"')
+        """)
+    profile = textwrap.dedent("""
+        [conf]
+        tools.microsoft.bash:subsystem=msys2
+        tools.microsoft.bash:path=bash
+
+        [buildenv]
+        INCLUDE=+(sep=;)C:/prepended/path
+        INCLUDE+=(sep=;)C:/appended/path
+        """)
+    c.save({"tool/conanfile.py": tool,
+            "consumer/conanfile.py": conanfile,
+            "profile": profile})
+    c.run("create tool")
+    with environment_update({"INCLUDE": "C:/my/abs path/folder;C:/other path/subfolder"}):
+        c.run("build consumer -pr=profile")
+
+    # Check the profile is outputed correctly
+    assert "INCLUDE=+(sep=;)C:/prepended/path" in c.out
+    assert "INCLUDE+=(sep=;)C:/appended/path" in c.out
+    # check the composition is correct
+    assert "INCLUDE=C:/prepended/path;C:/my/abs path/folder;C:/other path/subfolder;" \
+           "C:/mytool/path;C:/appended/path" in c.out
diff --git a/test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_new.py b/test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_new.py
index 64a993e5e..27a7184cb 100644
--- a/test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_new.py
+++ b/test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_new.py
@@ -868,6 +868,9 @@ class TestToolRequires:
                                                               .with_tool_requires("tool/0.1")})
         c.run("create tool")
         c.run(f"install pkg -g CMakeDeps -c tools.cmake.cmakedeps:new={new_value}")
+        assert "find_package(tool) # Optional. This is a tool-require, " \
+               "can't link its targets" in c.out
+        assert "target_link_libraries" not in c.out
         tool_config = c.load("pkg/tool-config.cmake")
         assert 'set(tool_INCLUDE_DIRS' not in tool_config
         assert 'set(tool_INCLUDE_DIR' not in tool_config
diff --git a/test/functional/toolchains/cmake/test_cmake_and_no_soname_flag.py b/test/functional/toolchains/cmake/test_cmake_and_no_soname_flag.py
index 11d61b95f..d2dc005df 100644
--- a/test/functional/toolchains/cmake/test_cmake_and_no_soname_flag.py
+++ b/test/functional/toolchains/cmake/test_cmake_and_no_soname_flag.py
@@ -64,9 +64,9 @@ def test_no_soname_flag(nosoname_property):
     # If `nosoname_property` is False, and we have a library without the SONAME flag,
     # then it should fail
     if nosoname_property is False:
-        with pytest.raises(Exception, match=r"libnosoname.so: cannot open shared object "
-                                            r"file: No such file or directory"):
-            client.run_command(command)
+        client.run_command(command, assert_error=True)
+        assert "libnosoname.so: cannot open shared object file: " \
+               "No such file or directory" in client.out
     else:
         client.run_command(command)
         assert "nosoname/0.1: Hello World Release!" in client.out
diff --git a/test/functional/tools/scm/test_git.py b/test/functional/tools/scm/test_git.py
index d4211ec68..e33194333 100644
--- a/test/functional/tools/scm/test_git.py
+++ b/test/functional/tools/scm/test_git.py
@@ -596,9 +596,8 @@ class TestGitCloneWithArgs:
         c = TestClient()
         git_args = ['--branch', 'foobar']
         c.save({"conanfile.py": self.conanfile.format(url=url, commit=commit, args=str(git_args))})
-        with pytest.raises(Exception):
-            c.run("create .")
-            assert "Remote branch foobar not found" in c.out
+        c.run("create .", assert_error=True)
+        assert "Remote branch foobar not found" in c.out
 
 
 @pytest.mark.tool("git")
diff --git a/test/functional/workspace/__init__.py b/test/functional/workspace/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/functional/workspace/test_workspace.py b/test/functional/workspace/test_workspace.py
new file mode 100644
index 000000000..78978ebaf
--- /dev/null
+++ b/test/functional/workspace/test_workspace.py
@@ -0,0 +1,49 @@
+import os
+import platform
+
+import pytest
+
+from conan.api.subapi.workspace import WorkspaceAPI
+from conan.test.utils.tools import TestClient
+
+
+WorkspaceAPI.TEST_ENABLED = "will_break_next"
+
+
+@pytest.mark.tool("cmake")
+def test_build():
+    # This is not using the meta-project at all
+    c = TestClient()
+    c.run("new cmake_lib -d name=mymath")
+    c.run("create . -tf=")
+
+    c.save({}, clean_first=True)
+    c.run("new workspace -d requires=mymath/0.1")
+    c.run("workspace build")
+    assert "Calling build() for the product app1/0.1" in c.out
+    assert "conanfile.py (app1/0.1): Running CMake.build()" in c.out
+    # it works without failing
+
+
+# The workspace CMake needs at least 3.25 for find_package to work
+@pytest.mark.tool("cmake", "3.27")
+def test_metabuild():
+    # This is using the meta-project
+    c = TestClient()
+    c.run("new cmake_lib -d name=mymath")
+    c.run("create . -tf=")
+
+    c.save({}, clean_first=True)
+    c.run("new workspace -d requires=mymath/0.1")
+    c.run("workspace install")
+    assert os.path.exists(os.path.join(c.current_folder, "CMakeUserPresets.json"))
+    build_folder = "build/Release" if platform.system() != "Windows" else "build"
+    assert os.path.exists(os.path.join(c.current_folder, build_folder, "generators"))
+    config_preset = "conan-default" if platform.system() == "Windows" else "conan-release"
+    c.run_command(f"cmake --preset {config_preset}")
+    assert "Conan: Target declared 'mymath::mymath'" in c.out
+    assert "Adding project liba" in c.out
+    assert "Adding project libb" in c.out
+    assert "Adding project app1" in c.out
+    c.run_command("cmake --build --preset conan-release")
+    # it doesn't fail
diff --git a/test/integration/cache/backup_sources_test.py b/test/integration/cache/backup_sources_test.py
index e992e2e85..2fdb4be52 100644
--- a/test/integration/cache/backup_sources_test.py
+++ b/test/integration/cache/backup_sources_test.py
@@ -1,16 +1,19 @@
 import json
 import os
 import textwrap
+import uuid
 from unittest import mock
 
+import bottle
 import pytest
 from bottle import static_file, HTTPError, request
+from webtest import TestApp
 
 from conan.internal.errors import NotFoundException
 from conan.errors import ConanException
 from conan.test.utils.file_server import TestFileServer
 from conan.test.utils.test_files import temp_folder
-from conan.test.utils.tools import TestClient, StoppableThreadBottle
+from conan.test.utils.tools import TestClient
 from conans.util.files import save, load, rmdir, mkdir, remove
 
 
@@ -290,20 +293,20 @@ class TestDownloadCacheBackupSources:
 
     def test_sources_backup_server_not_found(self):
         conanfile = textwrap.dedent(f"""
-                   from conan import ConanFile
-                   from conan.tools.files import download
-                   class Pkg2(ConanFile):
-                       name = "pkg"
-                       version = "1.0"
-                       def source(self):
-                           download(self, "{self.file_server.fake_url}/internet/myfile.txt", "myfile.txt",
-                                    sha256="unused")
-                   """)
+           from conan import ConanFile
+           from conan.tools.files import download
+           class Pkg2(ConanFile):
+               name = "pkg"
+               version = "1.0"
+               def source(self):
+                   download(self, "{self.file_server.fake_url}/internet/myfile.txt", "myfile.txt",
+                            sha256="unused")
+           """)
 
         self.client.save_home(
             {"global.conf": f"core.sources:download_cache={self.download_cache_folder}\n"
                             f"core.download:retry=0\n"
-                            f"core.sources:download_urls=['http://locahost/nothing-here', 'origin']\n"})
+                            f"core.sources:download_urls=['error_server', 'origin']\n"})
 
         self.client.save({"conanfile.py": conanfile})
         self.client.run("create .", assert_error=True)
@@ -312,37 +315,47 @@ class TestDownloadCacheBackupSources:
     def test_upload_sources_backup_creds_needed(self):
         client = TestClient(default_server_user=True, light=True)
         download_cache_folder = temp_folder()
-        http_server = StoppableThreadBottle()
         http_server_base_folder_backups = temp_folder()
         http_server_base_folder_internet = temp_folder()
 
         save(os.path.join(http_server_base_folder_internet, "myfile.txt"), "Hello, world!")
 
-        def valid_auth(token):
-            auth = request.headers.get("Authorization")
-            if auth == f"Bearer {token}":
-                return
-            return HTTPError(401, "Authentication required")
-
-        @http_server.server.get("/internet/<file>")
-        def get_internet_file(file):
-            return static_file(file, http_server_base_folder_internet)
-
-        @http_server.server.get("/downloader/<file>")
-        def get_file(file):
-            ret = valid_auth("mytoken")
-            return ret or static_file(file, http_server_base_folder_backups)
-
-        @http_server.server.put("/uploader/<file>")
-        def put_file(file):
-            ret = valid_auth("myuploadtoken")
-            if ret:
-                return ret
-            dest = os.path.join(http_server_base_folder_backups, file)
-            with open(dest, 'wb') as f:
-                f.write(request.body.read())
-
-        http_server.run_server()
+        class TestFileServer2:
+
+            def __init__(self):
+                self.fake_url = "http://fake%s.com" % str(uuid.uuid4()).replace("-", "")
+                self.root_app = bottle.Bottle()
+                self.app = TestApp(self.root_app)
+                self._attach_to(self.root_app)
+
+            @staticmethod
+            def _attach_to(app):
+                def valid_auth(token):
+                    auth = request.headers.get("Authorization")
+                    if auth == f"Bearer {token}":
+                        return
+                    return HTTPError(401, "Authentication required")
+
+                @app.route("/internet/<file>", method=["GET"])
+                def get_internet_file(file):
+                    return static_file(file, http_server_base_folder_internet)
+
+                @app.route("/downloader/<file>", method=["GET"])
+                def get_file(file):
+                    ret = valid_auth("mytoken")
+                    return ret or static_file(file, http_server_base_folder_backups)
+
+                @app.route("/uploader/<file>", method=["PUT"])
+                def put_file(file):
+                    ret = valid_auth("myuploadtoken")
+                    if ret:
+                        return ret
+                    dest = os.path.join(http_server_base_folder_backups, file)
+                    with open(dest, 'wb') as f:
+                        f.write(request.body.read())
+
+        http_server = TestFileServer2()
+        client.servers["file_server"] = http_server
 
         sha256 = "315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3"
         conanfile = textwrap.dedent(f"""
@@ -352,32 +365,32 @@ class TestDownloadCacheBackupSources:
                 name = "pkg"
                 version = "1.0"
                 def source(self):
-                    download(self, "http://localhost:{http_server.port}/internet/myfile.txt", "myfile.txt",
+                    download(self, "{http_server.fake_url}/internet/myfile.txt", "myfile.txt",
                              sha256="{sha256}")
                     self.output.info(f"CONTENT: {{load(self, 'myfile.txt')}}")
             """)
 
         client.save_home(
             {"global.conf": f"core.sources:download_cache={download_cache_folder}\n"
-                            f"core.sources:download_urls=['http://localhost:{http_server.port}/downloader/', 'origin']\n"
-                            f"core.sources:upload_url=http://localhost:{http_server.port}/uploader/"})
+                            f"core.sources:download_urls=['{http_server.fake_url}/downloader/', 'origin']\n"
+                            f"core.sources:upload_url={http_server.fake_url}/uploader/"})
 
         client.save({"conanfile.py": conanfile})
         client.run("create .", assert_error=True)
-        assert f"ConanException: The source backup server 'http://localhost:{http_server.port}" \
+        assert f"ConanException: The source backup server '{http_server.fake_url}" \
                f"/downloader/' needs authentication" in client.out
         content = {"credentials": [
-            {"url": f"http://localhost:{http_server.port}", "token": "mytoken"}
+            {"url": f"{http_server.fake_url}", "token": "mytoken"}
         ]}
         save(os.path.join(client.cache_folder, "source_credentials.json"), json.dumps(content))
 
         client.run("create .")
         assert "CONTENT: Hello, world!" in client.out
         client.run("upload * -c -r=default", assert_error=True)
-        assert f"The source backup server 'http://localhost:{http_server.port}" \
+        assert f"The source backup server '{http_server.fake_url}" \
                f"/uploader/' needs authentication" in client.out
         content = {"credentials": [
-            {"url": f"http://localhost:{http_server.port}", "token": "myuploadtoken"}
+            {"url": f"{http_server.fake_url}", "token": "myuploadtoken"}
         ]}
         # Now use the correct UPLOAD token
         save(os.path.join(client.cache_folder, "source_credentials.json"), json.dumps(content))
@@ -391,7 +404,7 @@ class TestDownloadCacheBackupSources:
         assert "already in server, skipping upload" in client.out
 
         content = {"credentials": [
-            {"url": f"http://localhost:{http_server.port}", "token": "mytoken"}
+            {"url": f"{http_server.fake_url}", "token": "mytoken"}
         ]}
 
         save(os.path.join(client.cache_folder, "source_credentials.json"), json.dumps(content))
@@ -402,10 +415,10 @@ class TestDownloadCacheBackupSources:
         os.remove(os.path.join(http_server_base_folder_internet, "myfile.txt"))
 
         client.run("source .")
-        assert f"Sources for http://localhost:{http_server.port}/internet/myfile.txt found in remote backup" in client.out
+        assert f"Sources for {http_server.fake_url}/internet/myfile.txt found in remote backup" in client.out
         assert "CONTENT: Hello, world!" in client.out
         client.run("source .")
-        assert f"Source http://localhost:{http_server.port}/internet/myfile.txt retrieved from local download cache" in client.out
+        assert f"Source {http_server.fake_url}/internet/myfile.txt retrieved from local download cache" in client.out
         assert "CONTENT: Hello, world!" in client.out
 
     def test_download_sources_multiurl(self):
@@ -521,8 +534,6 @@ class TestDownloadCacheBackupSources:
     def test_ok_when_origin_authorization_error(self):
         client = TestClient(default_server_user=True, light=True)
         download_cache_folder = temp_folder()
-        http_server = StoppableThreadBottle()
-
         http_server_base_folder_backup1 = temp_folder()
         http_server_base_folder_backup2 = temp_folder()
 
@@ -530,27 +541,40 @@ class TestDownloadCacheBackupSources:
         save(os.path.join(http_server_base_folder_backup2, sha256), "Hello, world!")
         save(os.path.join(http_server_base_folder_backup2, sha256 + ".json"), '{"references": {}}')
 
-        @http_server.server.get("/internet/<file>")
-        def get_internet_file(file):
-            return HTTPError(401, "You Are Not Allowed Here")
-
-        @http_server.server.get("/downloader1/<file>")
-        def get_file(file):
-            return static_file(file, http_server_base_folder_backup1)
-
-        @http_server.server.put("/downloader1/<file>")
-        def put_file(file):
-            if file in os.listdir(http_server_base_folder_backup1):
-                return HTTPError(401, "You Are Not Allowed Here")
-            dest = os.path.join(http_server_base_folder_backup1, file)
-            with open(dest, 'wb') as f:
-                f.write(request.body.read())
-
-        @http_server.server.get("/downloader2/<file>")
-        def get_file_2(file):
-            return static_file(file, http_server_base_folder_backup2)
-
-        http_server.run_server()
+        class TestFileServer2:
+
+            def __init__(self, store=None):
+                self.store = store or temp_folder(path_with_spaces=False)
+                mkdir(self.store)
+                self.fake_url = "http://fake%s.com" % str(uuid.uuid4()).replace("-", "")
+                self.root_app = bottle.Bottle()
+                self.app = TestApp(self.root_app)
+                self._attach_to(self.root_app, self.store)
+
+            @staticmethod
+            def _attach_to(app, store):
+                @app.route("/internet/<file>", method=["GET"])
+                def get_internet_file(file):
+                    return HTTPError(401, "You Are Not Allowed Here")
+
+                @app.route("/downloader1/<file>", method=["GET"])
+                def get_file(file):
+                    return static_file(file, http_server_base_folder_backup1)
+
+                @app.route("/downloader1/<file>", method=["PUT"])
+                def put_file(file):
+                    if file in os.listdir(http_server_base_folder_backup1):
+                        return HTTPError(401, "You Are Not Allowed Here")
+                    dest = os.path.join(http_server_base_folder_backup1, file)
+                    with open(dest, 'wb') as f:
+                        f.write(request.body.read())
+
+                @app.route("/downloader2/<file>", method=["GET"])
+                def get_file_2(file):
+                    return static_file(file, http_server_base_folder_backup2)
+
+        http_server = TestFileServer2()
+        client.servers["file_server"] = http_server
 
         conanfile = textwrap.dedent(f"""
            from conan import ConanFile
@@ -559,18 +583,18 @@ class TestDownloadCacheBackupSources:
                name = "pkg"
                version = "1.0"
                def source(self):
-                   download(self, "http://localhost:{http_server.port}/internet/myfile.txt", "myfile.txt",
+                   download(self, "{http_server.fake_url}/internet/myfile.txt", "myfile.txt",
                             sha256="{sha256}")
            """)
         client.save_home({"global.conf": f"core.sources:download_cache={download_cache_folder}\n"
-                          f"core.sources:download_urls=['http://localhost:{http_server.port}/downloader1/', "
-                          f"'origin', 'http://localhost:{http_server.port}/downloader2/']\n"
-                          f"core.sources:upload_url=http://localhost:{http_server.port}/downloader1/\n"
+                          f"core.sources:download_urls=['{http_server.fake_url}/downloader1/', "
+                          f"'origin', '{http_server.fake_url}/downloader2/']\n"
+                          f"core.sources:upload_url={http_server.fake_url}/downloader1/\n"
                           "core.upload:retry=0\ncore.download:retry=0"})
 
         client.save({"conanfile.py": conanfile})
         client.run("create .")
-        assert f"Sources for http://localhost:{http_server.port}/internet/myfile.txt found in remote backup http://localhost:{http_server.port}/downloader2/" in client.out
+        assert f"Sources for {http_server.fake_url}/internet/myfile.txt found in remote backup {http_server.fake_url}/downloader2/" in client.out
         # TODO: Check better message with Authentication error message
         assert "failed in 'origin'" in client.out
 
@@ -753,13 +777,13 @@ class TestDownloadCacheBackupSources:
         save(os.path.join(http_server_base_folder_internet, "myfile.txt"), "Hello, world!")
 
         conanfile = textwrap.dedent(f"""
-                               from conan import ConanFile
-                               from conan.tools.files import download
-                               class Pkg2(ConanFile):
-                                   def source(self):
-                                       download(self, "{self.file_server.fake_url}/internet/myfile.txt", "myfile.txt",
-                                                sha256="{sha256}")
-                               """)
+           from conan import ConanFile
+           from conan.tools.files import download
+           class Pkg2(ConanFile):
+               def source(self):
+                   download(self, "{self.file_server.fake_url}/internet/myfile.txt", "myfile.txt",
+                            sha256="{sha256}")
+           """)
 
         self.client.save_home(
             {"global.conf": f"core.sources:download_cache={self.download_cache_folder}\n"
@@ -795,13 +819,13 @@ class TestDownloadCacheBackupSources:
         save(os.path.join(http_server_base_folder_internet, "myfile.txt"), "Hello, world!")
 
         conanfile = textwrap.dedent(f"""
-                   from conan import ConanFile
-                   from conan.tools.files import download
-                   class Pkg2(ConanFile):
-                       def source(self):
-                           download(self, "{self.file_server.fake_url}/internet/myfile.txt", "myfile.txt",
-                                    sha256="{sha256}")
-                   """)
+           from conan import ConanFile
+           from conan.tools.files import download
+           class Pkg2(ConanFile):
+               def source(self):
+                   download(self, "{self.file_server.fake_url}/internet/myfile.txt", "myfile.txt",
+                            sha256="{sha256}")
+           """)
 
         self.client.save_home(
             {"global.conf": f"core.sources:download_cache={self.download_cache_folder}\n"
diff --git a/test/integration/command/install/install_update_test.py b/test/integration/command/install/install_update_test.py
index 5a5ab4b77..450d771be 100644
--- a/test/integration/command/install/install_update_test.py
+++ b/test/integration/command/install/install_update_test.py
@@ -3,7 +3,7 @@ import textwrap
 from time import sleep
 
 from conan.api.model import RecipeReference
-from conan.test.utils.tools import TestClient, GenConanfile
+from conan.test.utils.tools import TestClient, GenConanfile, TestServer
 from conans.util.files import load
 
 
@@ -165,3 +165,71 @@ def test_install_update_repeated_tool_requires():
     c.run("create libc")
     c.run("install libc --update -pr=profile")
     assert 1 == str(c.out).count("tool/0.1: Checking remote")
+
+
+class TestUpdateOldPolicy:
+    def test_multi_remote_update_resolution(self):
+        c = TestClient(servers={"r1": TestServer(), "r2": TestServer(), "r3": TestServer()},
+                       inputs=["admin", "password"] * 3, light=True)
+        c.save({"conanfile.py": GenConanfile("pkg", "0.1")})
+        c.run("export .")
+        rev1 = c.exported_recipe_revision()
+        c.run("upload * -r=r1 -c")
+        # second revision
+        c.save({"conanfile.py": GenConanfile("pkg", "0.1").with_class_attribute("auther = 'me'")})
+        c.run("export .")
+        rev2 = c.exported_recipe_revision()
+        assert rev1 != rev2
+        c.run("upload * -r=r2 -c")  # By default uploads latest revisions only
+        assert rev1 not in c.out
+        assert rev2 in c.out
+        # going back to the previous revision
+        c.save({"conanfile.py": GenConanfile("pkg", "0.1")})
+        c.run("export .")  # Makes it the latest
+        rev3 = c.exported_recipe_revision()
+        assert rev1 == rev3
+        c.run("upload * -r=r3 -c")  # By default uploads latest revisions only
+        assert rev3 in c.out
+        assert rev2 not in c.out
+
+        # now test the --update, it will pick up the latest revision, which is r3
+        c.run("remove * -c")
+        c.run("graph info --requires=pkg/0.1 --update")
+        assert f"pkg/0.1#{rev3} - Downloaded (r3)" in c.out
+
+        # But if we enable order-based first found timestamp, it will pick up r2
+        c.run("remove * -c")
+        c.run("graph info --requires=pkg/0.1 --update -cc core:update_policy=legacy")
+        assert "The 'core:update_policy' conf is deprecated and will be removed" in c.out
+        assert f"pkg/0.1#{rev2} - Downloaded (r2)" in c.out
+
+    def test_multi_remote_update_resolution_2_remotes(self):
+        c = TestClient(servers={"r1": TestServer(), "r2": TestServer()},
+                       inputs=["admin", "password"] * 2, light=True)
+        c.save({"conanfile.py": GenConanfile("pkg", "0.1")})
+        c.run("export .")
+        rev1 = c.exported_recipe_revision()
+        c.run("upload * -r=r1 -c")
+        # second revision
+        c.save({"conanfile.py": GenConanfile("pkg", "0.1").with_class_attribute("auther = 'me'")})
+        c.run("export .")
+        rev2 = c.exported_recipe_revision()
+        assert rev1 != rev2
+        c.run("upload * -r=r1 -c")
+        c.run("list *#* -r=r1")
+
+        # Upload the first, old revision to the other remote
+        c.run(f"upload pkg/0.1#{rev1} -r=r2 -c")
+        assert rev1 in c.out
+        assert rev2 not in c.out
+        c.run("list *#* -r=r2")
+
+        # now test the --update, it will pick up the latest revision, which is r3
+        c.run("remove * -c")
+        c.run("graph info --requires=pkg/0.1 --update")
+        assert f"pkg/0.1#{rev1} - Downloaded (r2)" in c.out
+
+        # But if we enable order-based first found timestamp, it will pick up r2
+        c.run("remove * -c")
+        c.run("graph info --requires=pkg/0.1 --update -cc core:update_policy=legacy")
+        assert f"pkg/0.1#{rev2} - Downloaded (r1)" in c.out
diff --git a/test/integration/command/test_remote_users.py b/test/integration/command/test_remote_users.py
index aed12fa5f..46b21945c 100644
--- a/test/integration/command/test_remote_users.py
+++ b/test/integration/command/test_remote_users.py
@@ -4,7 +4,6 @@ import time
 from collections import OrderedDict
 from datetime import timedelta
 
-import pytest
 from mock import patch
 
 from conan.internal.api.remotes.localdb import LocalDB
@@ -18,12 +17,10 @@ class TestUser:
         """ Test that proper error is reported when no remotes are defined and conan user is executed
         """
         client = TestClient()
-        with pytest.raises(Exception):
-            client.run("remote list-users")
+        client.run("remote list-users", assert_error=True)
         assert "ERROR: No remotes defined" in client.out
 
-        with pytest.raises(Exception):
-            client.run("remote login wrong_remote foo -p bar")
+        client.run("remote login wrong_remote foo -p bar", assert_error=True)
         assert "ERROR: Remote 'wrong_remote' can't be found or is disabled" in client.out
 
     def test_command_user_list(self):
@@ -35,8 +32,7 @@ class TestUser:
         client = TestClient(servers=servers)
 
         # Test with wrong remote right error is reported
-        with pytest.raises(Exception):
-            client.run("remote login Test_Wrong_Remote foo")
+        client.run("remote login Test_Wrong_Remote foo", assert_error=True)
         assert "ERROR: Remote 'Test_Wrong_Remote' can't be found or is disabled" in client.out
 
         # Test user list for all remotes is reported
diff --git a/test/integration/conanfile/conan_data_test.py b/test/integration/conanfile/conan_data_test.py
index 69f04b557..2cd13182c 100644
--- a/test/integration/conanfile/conan_data_test.py
+++ b/test/integration/conanfile/conan_data_test.py
@@ -437,8 +437,7 @@ def test_trim_conandata_as_hook_without_conandata(raise_if_missing):
 
     c.save({"conanfile.py": GenConanfile("pkg")})
     if raise_if_missing:
-        with pytest.raises(Exception, match="conandata.yml file doesn't exist") as exception:
-            c.run("export . --version=1.0")
+        c.run("export . --version=1.0", assert_error=True)
     else:
         c.run("export . --version=1.0")
         assert c.exported_recipe_revision() == "a9ec2e5fbb166568d4670a9cd1ef4b26"
diff --git a/test/integration/configuration/profile_test.py b/test/integration/configuration/profile_test.py
index b8a6f3396..ebf563b17 100644
--- a/test/integration/configuration/profile_test.py
+++ b/test/integration/configuration/profile_test.py
@@ -33,9 +33,8 @@ class AConan(ConanFile):
 """
 
 
-def create_profile(folder, name, settings=None, package_settings=None, env=None,
-                   package_env=None, options=None):
-    _create_profile(folder, name, settings, package_settings, env, package_env, options)
+def create_profile(folder, name, settings=None, package_settings=None, options=None):
+    _create_profile(folder, name, settings, package_settings, options)
     content = load(os.path.join(folder, name))
     content = "include(default)\n    \n" + content
     save(os.path.join(folder, name), content)
diff --git a/test/integration/cps/test_cps.py b/test/integration/cps/test_cps.py
index e82527398..95280638e 100644
--- a/test/integration/cps/test_cps.py
+++ b/test/integration/cps/test_cps.py
@@ -17,7 +17,7 @@ def test_cps():
 
     settings = "-s os=Windows -s compiler=msvc -s compiler.version=191 -s arch=x86_64"
     c.run(f"install --requires=pkg/0.1 {settings} -g CPSDeps")
-    pkg = json.loads(c.load("build/cps/msvc-191-x86_64-release/pkg.cps"))
+    pkg = json.loads(c.load("build/cps/msvc-191-x86_64-release/cps/pkg.cps"))
     assert pkg["name"] == "pkg"
     assert pkg["version"] == "0.1"
     assert pkg["license"] == "MIT"
@@ -39,7 +39,7 @@ def test_cps_static_lib():
 
     settings = "-s os=Windows -s compiler=msvc -s compiler.version=191 -s arch=x86_64"
     c.run(f"install --requires=pkg/0.1 {settings} -g CPSDeps")
-    pkg = json.loads(c.load("build/cps/msvc-191-x86_64-release/pkg.cps"))
+    pkg = json.loads(c.load("build/cps/msvc-191-x86_64-release/cps/pkg.cps"))
     assert pkg["name"] == "pkg"
     assert pkg["version"] == "0.1"
     assert pkg["configurations"] == ["release"]
@@ -56,7 +56,7 @@ def test_cps_header():
 
     settings = "-s os=Windows -s compiler=msvc -s compiler.version=191 -s arch=x86_64"
     c.run(f"install --requires=pkg/0.1 {settings} -g CPSDeps")
-    pkg = json.loads(c.load("build/cps/msvc-191-x86_64-release/pkg.cps"))
+    pkg = json.loads(c.load("build/cps/msvc-191-x86_64-release/cps/pkg.cps"))
     assert pkg["name"] == "pkg"
     assert pkg["version"] == "0.1"
     assert "configurations" not in "pkg"
@@ -173,7 +173,7 @@ def test_extended_cpp_info():
 
     settings = "-s os=Windows -s compiler=msvc -s compiler.version=191 -s arch=x86_64"
     c.run(f"install --requires=pkg/0.1 {settings} -g CPSDeps")
-    pkg = json.loads(c.load("build/cps/msvc-191-x86_64-release/pkg.cps"))
+    pkg = json.loads(c.load("build/cps/msvc-191-x86_64-release/cps/pkg.cps"))
     assert pkg["name"] == "pkg"
     assert pkg["version"] == "0.1"
     assert pkg["default_components"] == ["pkg"]
diff --git a/test/integration/lockfile/test_user_overrides.py b/test/integration/lockfile/test_user_overrides.py
index f41a3a979..69b1cbed1 100644
--- a/test/integration/lockfile/test_user_overrides.py
+++ b/test/integration/lockfile/test_user_overrides.py
@@ -435,3 +435,25 @@ class TestLockUpgrade:
         lock = c.load("conan.lock")
         assert "libd/1.1" in lock
         assert "libd/1.2" not in lock
+
+
+    def test_lock_upgrade_new_requirement(self):
+        c = TestClient(light=True)
+        c.save({"liba/conanfile.py": GenConanfile("liba").with_requires("libb/1.0"),
+                "libb/conanfile.py": GenConanfile("libb").with_requires("libc/1.0"),
+                "libc/conanfile.py": GenConanfile("libc"),
+                "libd/conanfile.py": GenConanfile("libd")})
+        c.run(f"export liba --version=1.0")
+        c.run(f"export libb --version=1.0")
+        c.run(f"export libc --version=1.0")
+        c.run(f"export libd --version=1.0")
+        c.save({f"conanfile.py": GenConanfile().with_requires(f"liba/[>=1.0 <2]")})
+        c.run("lock create .")
+
+        c.save({"libb/conanfile.py": GenConanfile("libb").with_requires("libd/1.0")})
+        c.run(f"export libb --version=2.0")
+        c.run("lock upgrade --requires='libb/[>=2]' --update-requires='libb/*'")
+        lock = c.load("conan.lock")
+        assert "libb/2.0" in lock
+        assert "libd/1.0" in lock
+        assert "libc/1.0" in lock  # TODO: libc should be removed from lockfile? It is not required anymore...
diff --git a/test/integration/remote/auth_test.py b/test/integration/remote/auth_test.py
index af9b14d86..6e5019a07 100644
--- a/test/integration/remote/auth_test.py
+++ b/test/integration/remote/auth_test.py
@@ -62,12 +62,13 @@ class AuthorizeTest(unittest.TestCase):
 
     def test_auth_with_env(self):
 
-        def _upload_with_credentials(credentials):
+        def _upload_with_credentials(credentials, assert_error=False):
             cli = TestClient(servers=self.servers)
             save(os.path.join(cli.current_folder, CONANFILE), conan_content)
             cli.run("export . --user=lasote --channel=testing")
             with environment_update(credentials):
-                cli.run("upload %s -r default --only-recipe" % str(self.ref))
+                cli.run("upload %s -r default --only-recipe" % str(self.ref),
+                        assert_error=assert_error)
             return cli
 
         # Try with remote name in credentials
@@ -89,10 +90,9 @@ class AuthorizeTest(unittest.TestCase):
         self.assertIn("Got password '******' from environment", client.out)
 
         # Bad pass raise
-        with self.assertRaises(Exception):
-            client = _upload_with_credentials({"CONAN_PASSWORD": "bad",
-                                               "CONAN_LOGIN_USERNAME": "pepe"})
-            self.assertIn("Too many failed login attempts, bye!", client.out)
+        client = _upload_with_credentials({"CONAN_PASSWORD": "bad",
+                                           "CONAN_LOGIN_USERNAME": "pepe"}, assert_error=True)
+        self.assertIn("Authentication error in remote 'default'", client.out)
 
     def test_max_retries(self):
         """Bad login 3 times"""
diff --git a/test/integration/remote/test_local_recipes_index.py b/test/integration/remote/test_local_recipes_index.py
index 12123742c..bbff7cebe 100644
--- a/test/integration/remote/test_local_recipes_index.py
+++ b/test/integration/remote/test_local_recipes_index.py
@@ -332,6 +332,23 @@ class TestErrorsUx:
         c.run("install --requires=zlib/[*] --build missing", assert_error=True)
         assert "NameError: name 'ConanFile' is not defined" in c.out
 
+    def test_require_revision(self):
+        # https://github.com/conan-io/conan/issues/17814
+        folder = temp_folder()
+        recipes_folder = os.path.join(folder, "recipes")
+        zlib_config = textwrap.dedent("""
+           versions:
+             "1.2.11":
+               folder: all
+           """)
+        save_files(recipes_folder,
+                   {"zlib/config.yml": zlib_config,
+                    "zlib/all/conanfile.py": str(GenConanfile("zlib"))})
+        c = TestClient(light=True)
+        c.run(f"remote add local '{folder}'")
+        c.run("install --requires=zlib/1.2.11#rev1", assert_error=True)
+        assert "A specific revision 'zlib/1.2.11#rev1' was requested" in c.out
+
 
 class TestPythonRequires:
     @pytest.fixture(scope="class")
@@ -361,6 +378,7 @@ class TestPythonRequires:
         assert "pyreq/1.0#a0d63ca853edefa33582a24a1bb3c75f - Downloaded (local)" in c.out
         assert "pkg/1.0: Created package" in c.out
 
+
 class TestUserChannel:
     @pytest.fixture(scope="class")
     def c3i_user_channel_folder(self):
@@ -373,8 +391,8 @@ class TestUserChannel:
                   "2.0":
                     folder: other
                 """)
-        pkg = str(GenConanfile("pkg").with_class_attribute("user='myuser'")\
-                                    .with_class_attribute("channel='mychannel'"))
+        pkg = str(GenConanfile("pkg").with_class_attribute("user='myuser'")
+                                     .with_class_attribute("channel='mychannel'"))
         save_files(recipes_folder,
                    {"pkg/config.yml": config,
                     "pkg/all/conanfile.py": pkg,
diff --git a/test/integration/toolchains/cmake/cmakedeps/test_cmakedeps.py b/test/integration/toolchains/cmake/cmakedeps/test_cmakedeps.py
index 43e203488..457300b91 100644
--- a/test/integration/toolchains/cmake/cmakedeps/test_cmakedeps.py
+++ b/test/integration/toolchains/cmake/cmakedeps/test_cmakedeps.py
@@ -715,6 +715,7 @@ def test_cmakedeps_set_legacy_variable_name():
     conanfile = base_conanfile + """
     def package_info(self):
         self.cpp_info.set_property("cmake_file_name", "CMakeFileName")
+        self.cpp_info.set_property("cmake_find_mode", "both")
     """
     client.save({"dep/conanfile.py": conanfile})
     client.run("create dep")
@@ -725,6 +726,9 @@ def test_cmakedeps_set_legacy_variable_name():
     cmake_variables = ["VERSION_STRING", "INCLUDE_DIRS", "INCLUDE_DIR", "LIBRARIES", "DEFINITIONS"]
     for variable in cmake_variables:
         assert f"CMakeFileName_{variable}" in dep_config
+    dep_find = client.load("FindCMakeFileName.cmake")
+    for variable in cmake_variables:
+        assert f"CMakeFileName_{variable}" in dep_find
 
     consumer_conanfile = textwrap.dedent("""
         from conan import ConanFile
@@ -752,6 +756,16 @@ def test_cmakedeps_set_legacy_variable_name():
         assert f"PREFIX_{variable}" in dep_config
         assert f"prefix_{variable}" in dep_config
 
+    dep_find = client.load(os.path.join("consumer", "FindCMakeFileName.cmake"))
+    for variable in cmake_variables:
+        assert f"CMakeFileName_{variable}" in dep_find
+        assert f"PREFIX_{variable}" in dep_find
+        assert f"prefix_{variable}" in dep_find
+    assert "set(prefix_FOUND 1)" in dep_find
+    assert "set(PREFIX_FOUND 1)" in dep_find
+    assert 'set(prefix_VERSION "1.0")' in dep_find
+    assert 'set(PREFIX_VERSION "1.0")' in dep_find
+
     conanfile = base_conanfile + """
     def package_info(self):
         self.cpp_info.set_property("cmake_file_name", "NewCMakeFileName")
@@ -901,10 +915,10 @@ def test_alias_cmakedeps_set_property():
              """)})
     tc.run("create dep")
     tc.run("install .")
-    targetsData = tc.load("depTargets.cmake")
-    assert "add_library(dep::dep" in targetsData
-    assert "add_library(alias" in targetsData
-    assert "add_library(dep::other_name" in targetsData
+    targets_data = tc.load("depTargets.cmake")
+    assert "add_library(dep::dep" in targets_data
+    assert "add_library(alias" in targets_data
+    assert "add_library(dep::other_name" in targets_data
 
-    assert "add_library(component_alias" in targetsData
-    assert "add_library(dep::my_aliased_component" in targetsData
+    assert "add_library(component_alias" in targets_data
+    assert "add_library(dep::my_aliased_component" in targets_data
diff --git a/test/integration/toolchains/cmake/cmakedeps2/__init__.py b/test/integration/toolchains/cmake/cmakedeps2/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/integration/toolchains/cmake/cmakedeps2/test_cmakedeps.py b/test/integration/toolchains/cmake/cmakedeps2/test_cmakedeps.py
index 4b6001749..83420d6d6 100644
--- a/test/integration/toolchains/cmake/cmakedeps2/test_cmakedeps.py
+++ b/test/integration/toolchains/cmake/cmakedeps2/test_cmakedeps.py
@@ -1,6 +1,7 @@
 import re
 import textwrap
 
+from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.tools import TestClient
 
 new_value = "will_break_next"
@@ -90,3 +91,64 @@ def test_cmakedeps_transitive_paths():
     assert not re.search(r"list\(PREPEND CMAKE_PROGRAM_PATH /bina\"", cmake_paths)
     assert re.search(r"list\(PREPEND CMAKE_LIBRARY_PATH \".*/libb.*/p/libb\" \".*/liba.*/p/liba\"\)", cmake_paths)
     assert re.search(r"list\(PREPEND CMAKE_INCLUDE_PATH \".*/libb.*/p/includeb\" \".*/liba.*/p/includea\"\)", cmake_paths)
+
+
+def test_cmakeconfigdeps_recipe():
+    c = TestClient()
+    conanfile = textwrap.dedent("""
+        from conan.tools.cmake import CMakeConfigDeps
+        from conan import ConanFile
+        class TestConan(ConanFile):
+            settings = "build_type"
+            requires = "dep/0.1"
+            def generate(self):
+                deps = CMakeConfigDeps(self)
+                deps.generate()
+    """)
+    c.save({"dep/conanfile.py": GenConanfile("dep", "0.1"),
+            "app/conanfile.py": conanfile})
+    c.run("create dep")
+    c.run("install app", assert_error=True)
+    assert "CMakeConfigDeps is being used in conanfile, but the conf " \
+           "'tools.cmake.cmakedeps:new' is not enabled" in c.out
+    c.run("install app -c tools.cmake.cmakedeps:new=will_break_next")
+    # will not fail, still warn
+    assert "WARN: Using the new CMakeConfigDeps generator" in c.out
+    # The only-recipe also not fails
+    c.run("install app -c tools.cmake.cmakedeps:new=recipe_will_break")
+    # will not fail
+    assert "WARN: Using the new CMakeConfigDeps generator" in c.out
+
+    # attribute generator
+    conanfile = textwrap.dedent("""
+        from conan.tools.cmake import CMakeConfigDeps
+        from conan import ConanFile
+        class TestConan(ConanFile):
+            settings = "build_type"
+            requires = "dep/0.1"
+            generators = "CMakeConfigDeps"
+        """)
+    c.save({"app/conanfile.py": conanfile}, clean_first=True)
+    c.run("install app", assert_error=True)
+    assert "CMakeConfigDeps is being used in conanfile, but the conf " \
+           "'tools.cmake.cmakedeps:new' is not enabled" in c.out
+    c.run("install app -c tools.cmake.cmakedeps:new=will_break_next")
+    assert "WARN: Using the new CMakeConfigDeps generator" in c.out
+    c.run("install app -c tools.cmake.cmakedeps:new=recipe_will_break")
+    assert "WARN: Using the new CMakeConfigDeps generator" in c.out
+
+    # conanfile.txt
+    conanfile = textwrap.dedent("""
+        [requires]
+        dep/0.1
+        [generators]
+        CMakeConfigDeps
+        """)
+    c.save({"app/conanfile.txt": conanfile}, clean_first=True)
+    c.run("install app", assert_error=True)
+    assert "CMakeConfigDeps is being used in conanfile, but the conf " \
+           "'tools.cmake.cmakedeps:new' is not enabled" in c.out
+    c.run("install app -c tools.cmake.cmakedeps:new=will_break_next")
+    assert "WARN: Using the new CMakeConfigDeps generator" in c.out
+    c.run("install app -c tools.cmake.cmakedeps:new=recipe_will_break")
+    assert "WARN: Using the new CMakeConfigDeps generator" in c.out
diff --git a/test/integration/toolchains/gnu/test_autotoolstoolchain.py b/test/integration/toolchains/gnu/test_autotoolstoolchain.py
index c15908f98..64c9d8c9d 100644
--- a/test/integration/toolchains/gnu/test_autotoolstoolchain.py
+++ b/test/integration/toolchains/gnu/test_autotoolstoolchain.py
@@ -347,30 +347,23 @@ def test_conf_build_does_not_exist():
     host = textwrap.dedent("""
     [settings]
     arch=x86_64
-    build_type=Release
-    compiler=gcc
-    compiler.cppstd=gnu17
-    compiler.libcxx=libstdc++11
-    compiler.version=13
     os=Linux
     [conf]
-    tools.build:compiler_executables={'c': 'x86_64-linux-gnu-gcc', 'cpp': 'x86_64-linux-gnu-g++'}
+    tools.build:compiler_executables={'c': '/usr/bin/gcc', 'cpp': '/usr/bin/g++'}
     """)
     build = textwrap.dedent("""
     [settings]
     arch=armv8
-    build_type=Release
-    compiler=gcc
-    compiler.cppstd=gnu17
-    compiler.libcxx=libstdc++11
-    compiler.version=13
     os=Linux
+    [conf]
+    tools.build:compiler_executables={'c': 'x86_64-linux-gnu-gcc', 'cpp': 'x86_64-linux-gnu-g++'}
     """)
     c = TestClient()
-    c.save({
-        "conanfile.py": GenConanfile("pkg", "0.1"),
-        "host": host,
-        "build": build
-    })
+    c.save({"conanfile.py": GenConanfile("pkg", "0.1"),
+            "host": host,
+            "build": build})
     c.run("export .")
     c.run("install --requires=pkg/0.1 --build=pkg/0.1 -g AutotoolsToolchain -pr:h host -pr:b build")
+    tc = c.load("conanautotoolstoolchain.sh")
+    assert 'export CC_FOR_BUILD="x86_64-linux-gnu-gcc"' in tc
+    assert 'export CXX_FOR_BUILD="x86_64-linux-gnu-g++"' in tc
diff --git a/test/integration/toolchains/gnu/test_gnutoolchain.py b/test/integration/toolchains/gnu/test_gnutoolchain.py
index a5fe7f3f6..e47e30e05 100644
--- a/test/integration/toolchains/gnu/test_gnutoolchain.py
+++ b/test/integration/toolchains/gnu/test_gnutoolchain.py
@@ -436,30 +436,23 @@ def test_conf_build_does_not_exist():
     host = textwrap.dedent("""
     [settings]
     arch=x86_64
-    build_type=Release
-    compiler=gcc
-    compiler.cppstd=gnu17
-    compiler.libcxx=libstdc++11
-    compiler.version=13
     os=Linux
     [conf]
-    tools.build:compiler_executables={'c': 'x86_64-linux-gnu-gcc', 'cpp': 'x86_64-linux-gnu-g++'}
+    tools.build:compiler_executables={'c': '/usr/bin/gcc', 'cpp': '/usr/bin/g++'}
     """)
     build = textwrap.dedent("""
     [settings]
     arch=armv8
-    build_type=Release
-    compiler=gcc
-    compiler.cppstd=gnu17
-    compiler.libcxx=libstdc++11
-    compiler.version=13
     os=Linux
+    [conf]
+    tools.build:compiler_executables={'c': 'x86_64-linux-gnu-gcc', 'cpp': 'x86_64-linux-gnu-g++'}
     """)
     c = TestClient()
-    c.save({
-        "conanfile.py": GenConanfile("pkg", "0.1"),
-        "host": host,
-        "build": build
-    })
+    c.save({"conanfile.py": GenConanfile("pkg", "0.1"),
+            "host": host,
+            "build": build})
     c.run("export .")
     c.run("install --requires=pkg/0.1 --build=pkg/0.1 -g GnuToolchain -pr:h host -pr:b build")
+    tc = c.load("conangnutoolchain.sh")
+    assert 'export CC_FOR_BUILD="x86_64-linux-gnu-gcc"' in tc
+    assert 'export CXX_FOR_BUILD="x86_64-linux-gnu-g++"' in tc
diff --git a/test/integration/workspace/test_workspace.py b/test/integration/workspace/test_workspace.py
index 59d309957..92eb9d1f7 100644
--- a/test/integration/workspace/test_workspace.py
+++ b/test/integration/workspace/test_workspace.py
@@ -433,11 +433,94 @@ class TestWorkspaceBuild:
         assert "There are no products defined in the workspace, can't build" in c.out
 
 
-def test_new():
-    # Very basic workspace for testing
-    c = TestClient()
-    c.run("new workspace")
-    c.run("workspace info")
-    assert "liba/0.1" in c.out
-    assert "libb/0.1" in c.out
-    assert "app1/0.1" in c.out
+class TestNew:
+    def test_new(self):
+        # Very basic workspace for testing
+        c = TestClient(light=True)
+        c.run("new workspace")
+        assert 'name = "liba"' in c.load("liba/conanfile.py")
+        c.run("workspace info")
+        assert "liba/0.1" in c.out
+        assert "libb/0.1" in c.out
+        assert "app1/0.1" in c.out
+
+    def test_new_dep(self):
+        c = TestClient(light=True)
+        c.run("new workspace -d requires=dep/0.1")
+        assert 'self.requires("dep/0.1")' in c.load("liba/conanfile.py")
+        assert 'name = "liba"' in c.load("liba/conanfile.py")
+        c.run("workspace info")
+        assert "liba/0.1" in c.out
+        assert "libb/0.1" in c.out
+        assert "app1/0.1" in c.out
+
+
+class TestMeta:
+    def test_install(self):
+        c = TestClient()
+        c.save({"dep/conanfile.py": GenConanfile()})
+        c.run("create dep --name=dep1 --version=0.1")
+        c.run("create dep --name=dep2 --version=0.1")
+        c.save({"conanws.yml": "",
+                "liba/conanfile.py": GenConanfile("liba", "0.1").with_requires("dep1/0.1",
+                                                                               "dep2/0.1"),
+                "libb/conanfile.py": GenConanfile("libb", "0.1").with_requires("liba/0.1",
+                                                                               "dep1/0.1")},
+               clean_first=True)
+        c.run("workspace add liba")
+        c.run("workspace add libb")
+        c.run("workspace install -g CMakeDeps -g CMakeToolchain -of=build --envs-generation=false")
+        assert "Workspace conanfilews.py not found in the workspace folder, using default" in c.out
+        files = os.listdir(os.path.join(c.current_folder, "build"))
+        assert "conan_toolchain.cmake" in files
+        assert "dep1-config.cmake" in files
+        assert "dep2-config.cmake" in files
+        assert "liba-config.cmake" not in files
+        assert "libb-config.cmake" not in files
+        assert "conanbuild.bat" not in files
+        assert "conanbuild.sh" not in files
+
+    def test_conanfilews_custom(self):
+        c = TestClient()
+        conanfilews = textwrap.dedent("""
+            from conan import ConanFile
+            from conan import Workspace
+
+            class MyWs(ConanFile):
+                settings = "arch", "build_type"
+                generators = "MSBuildDeps"
+
+            class Ws(Workspace):
+                def root_conanfile(self):
+                    return MyWs
+            """)
+
+        c.save({"dep/conanfile.py": GenConanfile("dep", "0.1"),
+                "conanws.py": conanfilews})
+        c.run("workspace add dep")
+        c.run("workspace install -of=build")
+        print(c.out)
+        files = os.listdir(os.path.join(c.current_folder, "build"))
+        assert "conandeps.props" in files
+
+    def test_conanfilews_errors(self):
+        c = TestClient()
+        conanfilews = textwrap.dedent("""
+            from conan import ConanFile
+            from conan import Workspace
+            class MyWs(ConanFile):
+                requires = "dep/0.1"
+
+            class Ws(Workspace):
+                def root_conanfile(self):
+                    return MyWs
+            """)
+
+        c.save({"conanws.yml": "conanfilews: myconanfilews.py",
+                "dep/conanfile.py": GenConanfile("dep", "0.1"),
+                "conanws.py": conanfilews})
+        c.run("workspace install", assert_error=True)
+        assert "ERROR: This workspace cannot be installed, it doesn't have any editable" in c.out
+        c.run("workspace add dep")
+        c.run("workspace install", assert_error=True)
+        assert "ERROR: Conanfile in conanws.py shouldn't have 'requires'" in c.out
diff --git a/test/unittests/tools/env/test_env.py b/test/unittests/tools/env/test_env.py
index 156484905..e673c3bad 100644
--- a/test/unittests/tools/env/test_env.py
+++ b/test/unittests/tools/env/test_env.py
@@ -5,6 +5,7 @@ import textwrap
 
 import pytest
 
+from conan.errors import ConanException
 from conan.tools.env import Environment
 from conan.tools.env.environment import ProfileEnvironment
 from conans.client.subsystems import WINDOWS
@@ -426,3 +427,26 @@ def test_custom_placeholder():
            f"$penv{{MyVar}}:MyValue"
     items = {k: v for k, v in env.items(variable_reference="$penv{{{name}}}")}
     assert items == {"MyVar": f"$penv{{MyVar}}:MyValue"}
+
+
+class TestProfileSeparators:
+
+    def test_define(self):
+        myprofile = "MyPath1 = (sep=@)/my/path1"
+        env = ProfileEnvironment.loads(myprofile).get_profile_env(ref="")
+        assert env.dumps() == "MyPath1=(sep=@)/my/path1"
+        env.append("MyPath1", "/other/value")
+        assert env.vars(ConanFileMock()).get("MyPath1") == "/my/path1@/other/value"
+
+    def test_append(self):
+        myprofile = "MyPath1 +=(sep=@)/my/path1"
+        env = ProfileEnvironment.loads(myprofile).get_profile_env(ref="")
+        assert env.dumps() == "MyPath1+=(sep=@)/my/path1"
+        env.append("MyPath1", "/other/value")
+        assert env.vars(ConanFileMock()).get("MyPath1") == "/my/path1@/other/value"
+
+    def test_error(self):
+        myprofile = "MyPath1 = (sep=@) (path)/my/path1"
+        with pytest.raises(ConanException) as e:
+            ProfileEnvironment.loads(myprofile)
+        assert "Cannot use (sep) and (path) qualifiers simultaneously" in str(e.value)