From d51cc4b86ce48f75877213d395320fba915663fe Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 11 Mar 2024 10:54:31 +0100 Subject: [PATCH 1/5] document CONAN_CENTER_BUILD_SERVICE Signed-off-by: Uilian Ries --- docs/faqs.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/faqs.md b/docs/faqs.md index b463fc96e8c9b..f29dbee503d9d 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -45,7 +45,8 @@ This section gathers the most common questions from the community related to pac * [Can we add package which are parts of bigger projects like Boost?](#can-we-add-package-which-are-parts-of-bigger-projects-like-boost) * [Can I add my project which I will submit to Boost?](#can-i-add-my-project-which-i-will-submit-to-boost) * [Can I add options that do not affect `package_id` or the package contents](#can-i-add-options-that-do-not-affect-package_id-or-the-package-contents) - * [Can I use full_package_mode for a requirement in my recipe?](#can-i-use-full_package_mode-for-a-requirement-in-my-recipe) + * [Can I use full_package_mode for a requirement in my recipe?](#can-i-use-full_package_mode-for-a-requirement-in-my-recipe) + * [How to detect if is running in ConanCenterIndex CI service?](#how-to-detect-if-is-running-in-conancenterindex-ci-service) ## What is the policy on recipe name collisions? @@ -483,3 +484,15 @@ To have more context about it, please, visit issues #11684 and #11022 In summary, we do not recommend `full_package_mode` or any other custom package id mode for requirements on CCI, it will break other PRs soon or later. Instead, prefer using `shared=True` by default, when needed. Also, when having a similar situation, do not hesitate in opening an issue explaining your case, and ask for support from the community. + +## How to detect if is running in ConanCenterIndex CI service? + +The environment variable `CONAN_CENTER_BUILD_SERVICE` is set to `1` when running in the ConanCenterIndex CI service. +This can be used to detect if the recipe is being built in the CI service. + +```python + +def configure(self): + if os.getenv('CONAN_CENTER_BUILD_SERVICE') is not None: + self.output.info("Running in ConanCenterIndex CI service") +``` From ca84f6898dc37d31cc0baf16f0e6d0aefee824a9 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 11 Mar 2024 10:54:55 +0100 Subject: [PATCH 2/5] document CONAN_CENTER_BUILD_SERVICE Signed-off-by: Uilian Ries --- docs/faqs.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/faqs.md b/docs/faqs.md index f29dbee503d9d..d0997a6a5694b 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -491,7 +491,6 @@ The environment variable `CONAN_CENTER_BUILD_SERVICE` is set to `1` when running This can be used to detect if the recipe is being built in the CI service. ```python - def configure(self): if os.getenv('CONAN_CENTER_BUILD_SERVICE') is not None: self.output.info("Running in ConanCenterIndex CI service") From cdf6e331b8296311a0ed32fb852f85baebad30f9 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 11 Mar 2024 10:57:14 +0100 Subject: [PATCH 3/5] add Julius comment Signed-off-by: Uilian Ries --- docs/faqs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/faqs.md b/docs/faqs.md index d0997a6a5694b..f262b32543e88 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -489,6 +489,7 @@ Also, when having a similar situation, do not hesitate in opening an issue expla The environment variable `CONAN_CENTER_BUILD_SERVICE` is set to `1` when running in the ConanCenterIndex CI service. This can be used to detect if the recipe is being built in the CI service. +Please bear in mind that it's not intended for general use and will be only allowed on a case-by-case basis. So please ask us before adding it to a recipe. ```python def configure(self): From 0b43e03c1a09ba9648e603ece0ddcb71b8770a5b Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 11 Mar 2024 12:21:47 +0100 Subject: [PATCH 4/5] Update docs/faqs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rubén Rincón Blanco --- docs/faqs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faqs.md b/docs/faqs.md index f262b32543e88..5646279ae3c5f 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -485,7 +485,7 @@ In summary, we do not recommend `full_package_mode` or any other custom package Instead, prefer using `shared=True` by default, when needed. Also, when having a similar situation, do not hesitate in opening an issue explaining your case, and ask for support from the community. -## How to detect if is running in ConanCenterIndex CI service? +## How to detect if running in ConanCenterIndex CI service? The environment variable `CONAN_CENTER_BUILD_SERVICE` is set to `1` when running in the ConanCenterIndex CI service. This can be used to detect if the recipe is being built in the CI service. From f71b5ecc96887d389bfe20d415fd105b4f73c748 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 11 Mar 2024 12:24:40 +0100 Subject: [PATCH 5/5] fix typo --- docs/faqs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faqs.md b/docs/faqs.md index 5646279ae3c5f..158d184e3e21c 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -46,7 +46,7 @@ This section gathers the most common questions from the community related to pac * [Can I add my project which I will submit to Boost?](#can-i-add-my-project-which-i-will-submit-to-boost) * [Can I add options that do not affect `package_id` or the package contents](#can-i-add-options-that-do-not-affect-package_id-or-the-package-contents) * [Can I use full_package_mode for a requirement in my recipe?](#can-i-use-full_package_mode-for-a-requirement-in-my-recipe) - * [How to detect if is running in ConanCenterIndex CI service?](#how-to-detect-if-is-running-in-conancenterindex-ci-service) + * [How to detect if running in ConanCenterIndex CI service?](#how-to-detect-if-running-in-conancenterindex-ci-service) ## What is the policy on recipe name collisions?