From c12497f44ab8e27909a4a69df8681cf7e68d6312 Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 25 Nov 2025 14:46:43 +0100 Subject: [PATCH 01/11] conan run --- reference/commands.rst | 1 + reference/commands/run.rst | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 reference/commands/run.rst diff --git a/reference/commands.rst b/reference/commands.rst index 70e74ca7c929..9f3e7ed49455 100644 --- a/reference/commands.rst +++ b/reference/commands.rst @@ -64,6 +64,7 @@ and these :ref:`custom command examples ` commands/source commands/test commands/upload + commands/run - :doc:`conan build `: Install package and call its build method - :doc:`conan create `: Create a package from a recipe diff --git a/reference/commands/run.rst b/reference/commands/run.rst new file mode 100644 index 000000000000..768fc465cfb7 --- /dev/null +++ b/reference/commands/run.rst @@ -0,0 +1,20 @@ + +conan run +========= + +.. autocommand:: + :command: conan run -h + + +The conan run command lets you directly execute a binary from a Conan package, automatically resolving and installing +all its dependencies. There’s no need to search for paths or manually activate environments: just pass the executable, +and Conan runs it. + +For example, if we have a package called mypackage with dependencies on zlib and cmake, we can run it like this: + +.. code-block:: bash + + $ conan run mypackage --requires=zlib/1.3 --tool-requires=cmake/3.31.6 + +This will automatically install zlib and cmake if needed, set up the proper environment, and execute the mypackage +binary in a single step. \ No newline at end of file From e76395ca3d32c23bfa276f52c1829bdef20034a7 Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 25 Nov 2025 16:40:03 +0100 Subject: [PATCH 02/11] example todo --- reference/commands/run.rst | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index 768fc465cfb7..87f9bcf0191c 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -10,11 +10,4 @@ The conan run command lets you directly execute a binary from a Conan package, a all its dependencies. There’s no need to search for paths or manually activate environments: just pass the executable, and Conan runs it. -For example, if we have a package called mypackage with dependencies on zlib and cmake, we can run it like this: - -.. code-block:: bash - - $ conan run mypackage --requires=zlib/1.3 --tool-requires=cmake/3.31.6 - -This will automatically install zlib and cmake if needed, set up the proper environment, and execute the mypackage -binary in a single step. \ No newline at end of file +TODO \ No newline at end of file From b7835365b2ddbf67e84085afeda6ccdfb511f101 Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 25 Nov 2025 16:56:17 +0100 Subject: [PATCH 03/11] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com> --- reference/commands/run.rst | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index 87f9bcf0191c..1b4fae0612b6 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -7,7 +7,26 @@ conan run The conan run command lets you directly execute a binary from a Conan package, automatically resolving and installing -all its dependencies. There’s no need to search for paths or manually activate environments: just pass the executable, +all its dependencies. There’s no need to manually activate environments: just pass the executable, and Conan runs it. -TODO \ No newline at end of file +The command can receive either a conanfile or have the requirements specified directly in the cli. + +For example, if we to call an specific version of openssl we would: + +.. code-block:: bash + + $ conan run "openssl --version" --tool-requires=openssl/3.5.4 + + Installing and building dependencies, this might take a while... + OpenSSL 3.5.4 30 Sep 2025 (Library: OpenSSL 3.5.4 30 Sep 2025) + +This command is useful when you want to execute somme specific binary from any package. + +.. note:: + This command activates both the ``host`` and ``build`` contexts, so that both contexts binaries are made available at once. + In case that a packege exists in both contexts, the ``host`` context binaries take precedence. + +.. seealso:: + + See here for more advanced examples of ``conan run`` usages From d96ae1f6c43733c271b3ad669aa1486c48641e61 Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 25 Nov 2025 17:24:17 +0100 Subject: [PATCH 04/11] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com> --- reference/commands/run.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index 1b4fae0612b6..08f16c4fc4ce 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -1,3 +1,4 @@ +.. _reference_commands_run: conan run ========= @@ -26,7 +27,3 @@ This command is useful when you want to execute somme specific binary from any p .. note:: This command activates both the ``host`` and ``build`` contexts, so that both contexts binaries are made available at once. In case that a packege exists in both contexts, the ``host`` context binaries take precedence. - -.. seealso:: - - See here for more advanced examples of ``conan run`` usages From eee5c9486e73e28951a6cee7092aff2fa8bbe03f Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 25 Nov 2025 17:27:42 +0100 Subject: [PATCH 05/11] fix commands reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com> --- reference/commands.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/commands.rst b/reference/commands.rst index 9f3e7ed49455..24e8aac7c6e1 100644 --- a/reference/commands.rst +++ b/reference/commands.rst @@ -30,6 +30,7 @@ and these :ref:`custom command examples ` commands/search commands/version commands/workspace + commands/run - :doc:`conan cache `: Return the path of recipes and packages in the cache - :doc:`conan config `: Manage Conan configuration (remotes, settings, plugins, etc) @@ -45,6 +46,7 @@ and these :ref:`custom command examples ` - :doc:`conan search `: Search packages matching a name - :doc:`conan version `: Give information about the Conan client version - :doc:`conan workspace (incubating) `: Manage Conan workspaces +- :doc:`conan run `: Execute binaries with automatic environment activation **Creator commands:** @@ -64,7 +66,6 @@ and these :ref:`custom command examples ` commands/source commands/test commands/upload - commands/run - :doc:`conan build `: Install package and call its build method - :doc:`conan create `: Create a package from a recipe From fbbd67b2a8be98811199022f64e846c74b2b9c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abril=20Rinc=C3=B3n=20Blanco?= <5364255+AbrilRBS@users.noreply.github.com> Date: Tue, 25 Nov 2025 17:36:03 +0100 Subject: [PATCH 06/11] Update reference/commands/run.rst Co-authored-by: Carlos Zoido --- reference/commands/run.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index 08f16c4fc4ce..0f8c5ee6359c 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -7,9 +7,9 @@ conan run :command: conan run -h -The conan run command lets you directly execute a binary from a Conan package, automatically resolving and installing -all its dependencies. There’s no need to manually activate environments: just pass the executable, -and Conan runs it. +The ``conan run`` command lets you directly execute a binary from a Conan package, automatically resolving and installing +all its dependencies. There’s no need to manually activate any environments generated by Conan: just pass the executable +to run, and Conan will activate the necessary environments and execute it. The command can receive either a conanfile or have the requirements specified directly in the cli. From 94da96ce5f8472decb8d2312a56ccae955aefce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abril=20Rinc=C3=B3n=20Blanco?= <5364255+AbrilRBS@users.noreply.github.com> Date: Tue, 25 Nov 2025 17:36:57 +0100 Subject: [PATCH 07/11] Update reference/commands/run.rst Co-authored-by: Carlos Zoido --- reference/commands/run.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index 0f8c5ee6359c..d00f78d341d7 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -11,7 +11,7 @@ The ``conan run`` command lets you directly execute a binary from a Conan packag all its dependencies. There’s no need to manually activate any environments generated by Conan: just pass the executable to run, and Conan will activate the necessary environments and execute it. -The command can receive either a conanfile or have the requirements specified directly in the cli. +The command can receive either a ``conanfile.py``/``conanfile.txt`` or have the requirements specified directly from the CLI via ``--requires`` and ``--tool-requires`` arguments. For example, if we to call an specific version of openssl we would: From 14f548f70d52dfe465e3f3e93c8c8bdb158f0cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abril=20Rinc=C3=B3n=20Blanco?= <5364255+AbrilRBS@users.noreply.github.com> Date: Tue, 25 Nov 2025 17:37:09 +0100 Subject: [PATCH 08/11] Update reference/commands/run.rst Co-authored-by: Carlos Zoido --- reference/commands/run.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index d00f78d341d7..0991b401bf9a 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -13,7 +13,7 @@ to run, and Conan will activate the necessary environments and execute it. The command can receive either a ``conanfile.py``/``conanfile.txt`` or have the requirements specified directly from the CLI via ``--requires`` and ``--tool-requires`` arguments. -For example, if we to call an specific version of openssl we would: +For example, if we call a specific version of ``openssl`` we would: .. code-block:: bash From ea6e2e45e257485b35cf077eb54601bc7f40d508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abril=20Rinc=C3=B3n=20Blanco?= <5364255+AbrilRBS@users.noreply.github.com> Date: Tue, 25 Nov 2025 17:40:26 +0100 Subject: [PATCH 09/11] Update reference/commands/run.rst Co-authored-by: Carlos Zoido --- reference/commands/run.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index 0991b401bf9a..18ba61e916f7 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -22,7 +22,7 @@ For example, if we call a specific version of ``openssl`` we would: Installing and building dependencies, this might take a while... OpenSSL 3.5.4 30 Sep 2025 (Library: OpenSSL 3.5.4 30 Sep 2025) -This command is useful when you want to execute somme specific binary from any package. +This command is useful when you want to execute some specific binary from any package. .. note:: This command activates both the ``host`` and ``build`` contexts, so that both contexts binaries are made available at once. From c91eecb40dbddecd59e21e9b9cdda2ededdaca99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abril=20Rinc=C3=B3n=20Blanco?= <5364255+AbrilRBS@users.noreply.github.com> Date: Tue, 25 Nov 2025 17:40:49 +0100 Subject: [PATCH 10/11] Update reference/commands/run.rst Co-authored-by: Carlos Zoido --- reference/commands/run.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index 18ba61e916f7..ef9b94c0231a 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -26,4 +26,4 @@ This command is useful when you want to execute some specific binary from any pa .. note:: This command activates both the ``host`` and ``build`` contexts, so that both contexts binaries are made available at once. - In case that a packege exists in both contexts, the ``host`` context binaries take precedence. + In case that a package exists in both contexts, the ``host`` context binaries take precedence. From fb5c859c39d4fe3c059dacb7d915c2b6cc8bc246 Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Tue, 25 Nov 2025 17:43:28 +0100 Subject: [PATCH 11/11] experimental warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com> --- reference/commands/run.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/commands/run.rst b/reference/commands/run.rst index ef9b94c0231a..44c948078097 100644 --- a/reference/commands/run.rst +++ b/reference/commands/run.rst @@ -3,6 +3,8 @@ conan run ========= +.. include:: ../../common/experimental_warning.inc + .. autocommand:: :command: conan run -h