Comments (4)
Hi @wuziq thanks for the question. You're mostly on point with your discoveries, and it does boil down to the trimming of the conandata.yml
file!
We don't have this hook installed, so why are we seeing this behavior while building boost?
As I see, you're using the local recipes index remote type, and one of its goals is to match the behaviour of Conan Center Index, where we do trim the conandata for each version, so that recipes fetched from this remote type algo get trimmed.
You're not seeing this behaviour when compiling it because the trim happens internally within the local remote.
For you to get the same behaviour of locally created packages, you do need to have a post_export()
hook that calls [conan.tools.files.conandata.trim_conandata()](https://docs.conan.io/2/reference/tools/files/basic.html#conan.tools.files.conandata.trim_conandata)
.
This file needs to go into your <conan2_home>/extenions/hooks/
folder (docs for naming conventions etc here), something like:
~/.conan2/extensions/hooks/hook_trim_conandata.py
from conan.tools.files.conandata import trim_conandata
def post_export(conanfile):
trim_conandata(conanfile)
The way to share/install this across your developers would be using the conan config install
command and associated features, docs here
Let me know if this helps :)
from conan.
Fascinating, thank you! This leads me to another question. When building our own private conan center index, should we not be calling conan create
as I showed above? Should we be building the recipes differently? We don't mind using the hook, but we're curious whether we can avoid adding the hook.
We are following this: https://docs.conan.io/2/devops/conancenter/hosting_binaries.html It says to create a list of the packages we want, and to then call conan create --build=missing
.
However, I just noticed in another document (https://docs.conan.io/2/devops/devops_local_recipes_index.html#building-binaries-from-a-private-conan-center-index-fork), it says to use conan install --requires=...
.
Which is correct?
Maybe we are not calling conan create
correctly?
from conan.
Extra note about my prior message:
Note that trim_conandata()
raises if any of your packages does not have a conandata.yml
file. If this is undesired, pass False
as the second parameter which will disable the behaviour and silently do nothing
When building our own private conan center index, should we not be calling conan create as I showed above?
You are calling conan create
mostly correctly :) I'll explain the differences between the install and create below, but for now:
- Positional arguments should come before names ones, so try to have
conan create ./conan-center-index/recipes/zlib/all --build=missing --name zlib --version 1.3.1 -pr:a=default -r local-index
instead of adding the path to the end of the command. This can save you from some hard to debug issues later on if we happen to change some syntax in the argument parser - No need to add
--name=zlib
, it is included in every CCI recipe by default - Use
=
to separate argument names from values (so--version=1.3.1
instead of--version 1.3.1
), it will save you some possible issues too :)
The docs mention conan install
because the idea there is that you're not creating the packages, but using them as part of the dependencies for a project you're running, but which you're not creating the package at that moment. Your conan create
call is best suited for your case, as you want to create the zlib
package and be able to later upload it to a remote/use it from your cache, which is different than having the recipe be available from a local recipes index :)
from conan.
Thank you!
from conan.
Related Issues (20)
- [question] Keying packages on libstdc++ version? Autodetecting it? HOT 4
- [bug] Library 'XXX' not found in package. If 'XXX' is a system library, declare it with 'cpp_info.system_libs' property HOT 3
- [question] Clarifications re: local-repo index vs. binary artifacts… HOT 3
- self.conf.get used in set_version method HOT 2
- [question] I am experminting with the patch feature and I want ask what is the standard way to do an extention that analyze the dependencies graph for the sake of validations on the binaries outside the standard analyze binaries method HOT 1
- [bug] when crossbuilding, CMakeToolchain does not set system name and processor variables if user toolchain is provided
- [question] Conan 1 and Conan 2 package coexistence in Artifactory? HOT 5
- Cannot cross-compile for Android NDK 19C HOT 2
- [not-bug] "conan list" prints letter Z instead of a last digit when printing dependency versions e.g. "zlib/1.3.Z" HOT 2
- [question] "recommended flow" for updating a dependency in a lockfile without pulling other dependencies? HOT 5
- [bug] Wrong paths to profiles in docker runner HOT 1
- [bug] conan inspect is not showing requirements HOT 4
- [question] How to validate Options of a Dependency Package in conan v1 HOT 10
- [question] Conan SSL Errors With Artifactory HOT 4
- [question] How to properly "evolve" lockfiles? HOT 12
- [question] Migrating custom generator + user_info to Conan 2.0 HOT 3
- [question] cpp_info in editable mode HOT 1
- Building Qt 6.5.3 fails using conan 2.1.0 and 2.5.0 HOT 5
- [bug] Setting environment-variables via `[buildenv]` or `[runenv]` from profiles stores leading/trailing spaces in value HOT 3
- [question] Conan 'home' with CI/CD Runners HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conan.