Skip to content

Commit 3337b3e

Browse files
czoidomemshardedEmpantie
authored
Merge master to develop (#2088)
* faq git servers * Update package_approaches.rst (#2078) Debug and Release switched Co-authored-by: memsharded <[email protected]> Co-authored-by: Empantie <[email protected]>
1 parent da5894e commit 3337b3e

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

creating_packages/package_approaches.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ this meets your needs, we recommend removing the ``compiler.runtime`` subsetting
127127
del self.settings.compiler.runtime
128128
129129
def build(self):
130-
cmake_release = CMake(self, build_type="Debug")
130+
cmake_release = CMake(self, build_type="Release")
131131
cmake_release.configure()
132132
cmake_release.build()
133133
134-
cmake_debug = CMake(self, build_type="Release")
134+
cmake_debug = CMake(self, build_type="Debug")
135135
cmake_debug.configure()
136136
cmake_debug.build()
137137

faq/using.rst

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@ When to use settings or options?
1515
While creating a package, you may want to add different configurations and variants of the package. There are two main inputs that define
1616
packages: settings and options. Read more about them in :ref:`this section<settings_vs_options>`.
1717

18+
19+
Can Conan use git repositories as package servers?
20+
--------------------------------------------------
21+
22+
Or put it with other words, can a conan recipe define requirements something like ``requires="git://github.com/someuser/somerepo.git#sometag"``?
23+
24+
No, it is not possible. There are several technical reasons for this, mainly around the dependency resolution algorithm, but also about performance:
25+
26+
- Conan manages dependency versions conflicts. These can be efficiently handled from the abstract reference quickly, while a git repo reference would require cloning contents even before deciding.
27+
- The version overriding mechanism from downstream consumers to resolve conflicts cannot be implemented either with git repos, as both the name and the version of the package is not defined.
28+
- Conan support version-ranges, like depending on ``boost/[>1.60 <1.70]``. This is basically impossible to implement in git repos.
29+
- Conan has an “update” concept, that allows to query servers for latest modifications, latest versions, or even latest revisions, which would not work at all with git repos either.
30+
- Binary management is one of the biggest advantages of Conan. Obviously, it is not possible to manage binaries for this case either.
31+
32+
In summary, whatever could be done would be an extremely limited solution, very likely inefficient and much slower, with a lot of corner cases and rough edges around those said limitations. It would require a big development effort, and the compounded complexity it would induce in the codebase is a liability that will slow down future development, maintenance and support efforts.
33+
34+
Besides the impossibility on the technical side, there are also other reasons like well known best practices around package management and modern devops in other languages that show evidence that even if this approach looks like convenient, it should be discouraged in practice:
35+
36+
- Packages should be fully relocatable to a different location. Users should be able to retrieve their dependencies and upload a copy to their own private server, and fully disconnect from the external world. This is critical for robust and secure production environments, and avoid problems that other ecosystems like NPM have had in the past. As a consequence, all recipes dependencies should not be coupled to any location, and be abstract as conan "requires" are.
37+
- Other languages, like Java (which would be the closest one regarding enterprise-ness), never provided this feature. Languages like golang, that based its dependency management on this feature, has also evolved away from it and towards abstract "module" concepts that can be hosted in different servers
38+
39+
So there are no plans to support this approach, and the client-server architecture will continue to be the proposed solution. There are several alternatives for the servers from different vendors, for public open source packages `ConanCenter <https://conan.io/center>`_ is the recommended one, and for private packages, the free `ArtifactoryCE <https://conan.io/downloads>`_ is a simple and powerful solution.
40+
41+
1842
How to obtain the dependents of a given package?
1943
------------------------------------------------
2044

@@ -90,9 +114,9 @@ In the case of the ``<channel>`` term, normally OSS package creators use ``testi
90114
only in few configurations) and ``stable`` when the recipe is ready enough to be used (e.g. it is built and tested in a wide range of
91115
configurations).
92116

93-
From the perspective of a library developer, channels could be used to create different scopes of your library. For example, use ``rc``
94-
channel for release candidates, maybe ``experimental`` for those kind of features, or even ``qa``/``testing`` before the library is checked
95-
by QA department or testers.
117+
It is strongly recommended that packages are considered immutable. Once a package has been created with a user/channel, it shouldn't be
118+
changed. Instead, a new package with a new user/channel should be created.
119+
96120

97121
What does "outdated from recipe" mean exactly?
98122
----------------------------------------------
@@ -118,6 +142,9 @@ recipe. That means: if the recipe has completely removed an option (it could be
118142
that were generated previously with that option, those packages will be impossible to install as their package ID are calculated from the
119143
recipe file (and that option does not exist anymore).
120144

145+
When using "revisions" (it is opt-in in Conan 1.X, but it will be always enabled in Conan 2.0), this should never happen, as doing any change
146+
to a recipe or source should create a new revision that will contain its own binaries.
147+
121148
How to configure the remotes priority order
122149
-------------------------------------------
123150

0 commit comments

Comments
 (0)