-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[service] Ability to purposefully NOT build all versions for a recipe #2813
Comments
I like the advanced solution. |
Boost is another example where this is already hurting us. I think we need at the minimum a fast workaround, even if this means disabling the hook until we have an actual solution |
Thanks for writing down this problem. I totally agree that we need a mechanism to stop building old versions ( My proposal would be to compute less profile combinations for old versions, following your proposal we can assign different profile combinations to different versions: versions:
1.1.1d:
folder: "1.x.x"
profiles: "maintenance"
1.1.1e:
folder: "1.x.x"
1.1.1f:
folder: "1.x.x"
1.1.1g:
folder: "1.x.x" Challenges here:
PS.- I would suggest a similar approach to declare the options to explode (we already need it to generate some packages for consumers that require an option with a value other than the default), again it is important to limit these changes to selected users. |
This feature can be used to limit the number of combinations that c3i currently builds for tools packages such as cmake, cc65, ... The pr at #3153 will only handicap the recipe because we hide information that might be useful for conan users. Fast switching between Release/Debug for debugging a tool becomes impossible. Never underestimate power users. I solo brain-stormed a bit and came up with a following example If more complex conditions are required, then I would put the code in python scripts. sources:
"1.25": # build all combinations (c3i.v1.default_policy="all", c3i.v1.policies.all)
folder: "all"
"1.24": # Build all combinations (c3i.v1.policies.all))
folder: "all"
profiles: "all"
"1.23": # Will only build tool (c3i.v1.policies.tool)
folder: "all"
profiles: "windows"
"1.22": # Build only for Windows (c3i.v1.policies.windows)
folder: "all"
profiles: "tool"
"1.21": # Will build extra options
folder: "all"
profiles: "extra_options"
"1.20": # Will build only on windows with extra options(binary and: common in policies)
folder: "all"
profiles: "extra_options & windows"
"1.19": # Will build on linux and windows (binary or: common)
folder: "all"
profiles: "linux + windows"
"1.10": # Ancient versions are in maintenance mode
folder: "all"
profiles: "maintenance"
c3i:
v1:
default_policy: "all" # implicitly defined to "all"
policies:
all: {} # implicitly defined
maintenance: # implicitly defined
filter:
- "[settings.os, settings.compiler, settings.compiler.version] == ['Linux', 'gcc', 10]"
- "[settings.os, settings.compiler, settings.compiler.version] == ['Linux', 'clang', 10]"
- "[settings.os, settings.compiler, settings.compiler.version] == ['Windows', 'Visual Studio', 17]"
- "[settings.os, settings.compiler, settings.compiler.version] == ['Macos', 'apple-clang', 12]"
tool: # implicitly defined
drop: "settings.compiler,settings.build_type" # Remove settings.compiler, settings.build_type axes from matrix (c3i should order all jobs in order of priority and choose the one with highest priority)
windows: # example policy to only build on Windows
filter: "settings.os == 'Windows'" # Only build packages for which the filter is True
linux: # example policy to only build on Linux
filter: "settings.os == 'Linux'" # Only build packages for which the filter is True
extra_options:
add_options:
- opt1a: "True" # Add {"opt1a": True, "opt1b": True} packages
opt1b: "True"
- opt2: "False"
- opt3: "all" # Build (True and Fails], or build all in ("openssl", "wolfssl", "libressl", "gnutls")
- opt4: "openssl" # Add {"opt4": "openssl"} packages
- opt5: ["openssl", "wolfssl"] By changing the policies in the
This is addressed in my example.
I don't know how this touches my proposal.
For my proposal, if a bot detects that the number of builds increases with a certain amount,
My proposal addresses this as well by adding extra options This proposal is overkill, but some ideas might be useful. I'd love to hear your feedback. |
This came up in one of the latest meetings with the team. Together with the number of configurations to build it is one of the issues that will bite us in the long term. But, in this meeting, more people agree that the way to go is to remove versions from this repository (recipes and packages will always be available in the Conan remote, of course). The reason is that building less configurations is not a way to solve the problem and can introduce other errors:
Looks like the better approach is to remove the versions. It must be a bold decision, not just something that will postpone the problem rather than solve it. Some rules to follow:
Wdyt? is there any other way to make it sustainable in the long term? |
This proposal was denied by the team, which is fine. Some arguments against it are reasonable. What I found unpleasant is that
was completely broken as a rule by #16503 (and it also completely contradicts years-long efforts to build from source), but that is somewhat off-topic. |
Current situtation
Before we merged conan-io/hooks#223 we had an easy way to NOT build all versions for a recipe:
Add all versions to the
conandata.yml
but not theconfig.yml
file.I understand why this hook was added, as it was a common error to do this by accident, however, now we can't make such a purposeful decision anymore.
This is a problem which increases basically by every single day passing by. We don't want to build on C3I all versions for all packages forever, but it is nice to give people the chance to use the recipes without having to modify them first and still to empower them to build the respective versions locally.
Think about huge packages like Qt and Boost and projects which release many, many versions like CMake and OpenSSL. Building those will become increasingly heavy on C3I over time. Some already take many hours today.
For e.g. OpenSSL we have done this already in conan-community: Build only the latest 3 patch versions from each version series https://github.com/conan-community/conan-openssl/blob/master/.travis.yml
And when we ported OpenSSL to CCI we basically did the same for the initial versions. For the 1.0.2 and the 1.1.0 series only the last few patch versions are added to the
config.yml
while everything is added toconandata.yml
https://github.com/conan-io/conan-center-index/blob/master/recipes/openssl/config.yml
https://github.com/conan-io/conan-center-index/blob/master/recipes/openssl/1.x.x/conandata.yml
This is also the reason new OpenSSL pull requests fail for now: #2256
But adding all those versions in all configurations would mean much more load on the CI for no too good reason. It is also a terrible experience for contributors who might need to wait for hours until they get an error message for some configuration they can't test on their own machine.
Removing older versions from
conandata.yml
means that people who are still relying on those versions can't use the recipe unmodified anymore, which would be annoying too.Minimum solution
I believe that we need sooner or later a new solution to prevent all versions from building for all configurations without removing the information about them from the
conandata.yml
file.Since this is CI specific, I propose some new attribute in the
config.yml
which makes disabling builds explicit, so it also can't happen on accident.Could look something like this:
If there is no
build
attribute it defaults totrue
.This would require changes
Advanced solution
The above proposal would solve a too huge and often unnecessary load on the C3I, while still allowing to build all versions for a recipe locally when using the recipes from the git repository directly, which many do anyways.
However, this also means that consumers won't get further recipe modifications (including fixes) from the Conan Center remote for those older versions. Take #2256 once again as an example (we don't build OpenSSL < 1.0.2s and for the reasons above we probably don't want too; it would add ~ 19*110 builds in an instance).
To get recipe modifications from the Conan Center remote too, we could add an attribute which causes C3I to upload the sources-only without any built packages.
This could look like this:
This would require changes
If we want to support both: No uploads at all and recipe source-only uploads, we could also support both
false
andsource_upload_only
values for such an attribute.The text was updated successfully, but these errors were encountered: