Skip to content

Commit

Permalink
Merge branch 'conan-io:master' into fix/qt-conanfile.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ericLemanissier authored Jan 18, 2023
2 parents e73c3ef + d6e2e52 commit 5995474
Show file tree
Hide file tree
Showing 993 changed files with 18,780 additions and 10,664 deletions.
12 changes: 12 additions & 0 deletions .c3i/authorized_users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1009,3 +1009,15 @@ authorized_users:
- ashley-b
- psmitsu
- Viatorus
- mkoviazin
- shtanko-sv
- larshg
- Wuqiqi123
- OzanCansel
- marlamb
- alexsmedin
- n-morales
- calebgray
- technic
- guillaume-michel
- okaerin
12 changes: 6 additions & 6 deletions .c3i/config_v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
id: 'conan-io/conan-center-index'

conan:
version: 1.54.0
version: 1.56.0

artifactory:
url: "https://c3i.jfrog.io/c3i"
Expand Down Expand Up @@ -40,10 +40,11 @@ tasks:
automatic_merge:
reviews_required_total: 2 # Reviews that a PR needs so it can be merged
reviews_required_team: 1 # Reviews from the Conan team that a PR needs so it can be merged
cci_wait_for_multibranch: # CCI jobs should wait for other multibranch job for that same PR
job_name: "prod-v2/cci" # e.g. "cci-v2/cci" -> this means waiting for cci-v2/cci/PR-<number>
timeout_seconds: 600 # Maximum time to wait for the multibranch job
merge_messages: true # Merge messages from the multibranch job waited for
# Temporarily disable feedback from Conan v2
# cci_wait_for_multibranch: # CCI jobs should wait for other multibranch job for that same PR
# job_name: "prod-v2/cci" # e.g. "cci-v2/cci" -> this means waiting for cci-v2/cci/PR-<number>
# timeout_seconds: 600 # Maximum time to wait for the multibranch job
# merge_messages: true # Merge messages from the multibranch job waited for

# Profile configurations to build packages
configurations:
Expand Down Expand Up @@ -188,7 +189,6 @@ pod_size:
large:
- "pcl"
- "duckdb"
- "cppfront"
xlarge:
- "llvm"
- "opengv"
2 changes: 1 addition & 1 deletion .c3i/config_v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
id: 'conan-io/conan-center-index-staging-v2'

conan:
version: 2.0.0-pre
version: 2.0.0-beta7

artifactory:
url: "https://c3i.jfrog.io/c3i"
Expand Down
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ Specify library name and version: **lib/1.0**
---

- [ ] I've read the [contributing guidelines](https://github.com/conan-io/conan-center-index/blob/master/CONTRIBUTING.md).
- [ ] I've followed the [PEP8](https://www.python.org/dev/peps/pep-0008/) style guides for Python code in the recipes.
- [ ] I've used the [latest](https://github.com/conan-io/conan/releases/latest) Conan client version.
- [ ] I've used a [recent](https://github.com/conan-io/conan/releases/latest) Conan client version close to the [currently deployed](https://github.com/conan-io/conan-center-index/blob/master/.c3i/config_v1.yml#L6).
- [ ] I've tried at least one configuration locally with the [conan-center hook](https://github.com/conan-io/hooks.git) activated.
57 changes: 27 additions & 30 deletions .github/workflows/linter-conan-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
env:
PYTHONPATH: ${{github.workspace}}
PYVER: "3.8"
SCORE_THRESHOLD: "9.5"
REQUIREMENTS: "pylint==2.14"

jobs:
Expand All @@ -21,16 +20,20 @@ jobs:
with:
files: |
linter/**
.github/workflows/linter-conan-v2.yml
- name: Get Conan v1 version
id: parse_conan_v1_version
if: steps.changed_files.outputs.any_changed == 'true'
uses: mikefarah/yq@master
with:
cmd: yq '.conan.version' '.c3i/config_v1.yml'

- uses: actions/setup-python@v4
if: steps.changed_files.outputs.any_changed == 'true'
with:
python-version: ${{ env.PYVER }}

- name: Install requirements
if: steps.changed_files.outputs.any_changed == 'true'
run: |
Expand All @@ -40,41 +43,35 @@ jobs:
id: linter_recipes
if: steps.changed_files.outputs.any_changed == 'true'
run: |
pylint --rcfile=linter/pylintrc_recipe recipes/*/*/conanfile.py --output-format=json --output=recipes.json --score=y --fail-under=${{ env.SCORE_THRESHOLD }}
echo '## Linter summary (recipes)' >> $GITHUB_STEP_SUMMARY
i=1
for file in recipes/*/*/conanfile.py; do
if [[ $i -gt 250 ]] ; then
break
fi
echo "$i - $file"
pylint --rcfile=linter/pylintrc_recipe $file --output-format=json --output=recipes.json --score=y --exit-zero
jq 'map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}' recipes.json > recipes2.json
jq -r '" * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY
(( i += 1 ))
done
- name: Execute linter over all test_package/recipes in the repository
id: linter_test_package
if: steps.changed_files.outputs.any_changed == 'true'
run: |
pylint --rcfile=linter/pylintrc_testpackage recipes/*/*/test_*/conanfile.py --ignore-paths="recipes/[^/]*/[^/]*/test_v1[^/]*/conanfile.py" --output-format=json --output=test_package.json --score=y --fail-under=${{ env.SCORE_THRESHOLD }}
- name: Archive production artifacts
if: steps.changed_files.outputs.any_changed == 'true' && always()
uses: actions/upload-artifact@v3
with:
name: linter-output
path: |
recipes.json
test_package.json
- name: Create report (recipes)
if: steps.changed_files.outputs.any_changed == 'true' && steps.linter_recipes.outcome != 'skipped' && always()
run: |
echo '## Linter summary (recipes)' >> $GITHUB_STEP_SUMMARY
jq 'map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}' recipes.json > recipes2.json
jq -r '" * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY
- name: Create report (test_package)
if: steps.changed_files.outputs.any_changed == 'true' && steps.linter_test_package.outcome != 'skipped' && always()
run: |
echo '## Linter summary (test_package)' >> $GITHUB_STEP_SUMMARY
jq 'map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}' test_package.json > test_package2.json
jq -r '" * \(.message): \(.length)"' test_package2.json >> $GITHUB_STEP_SUMMARY
- name: Create report
if: steps.changed_files.outputs.any_changed == 'true' && always()
run: |
echo '> Note.- Check uploaded artifacts for a full report.' >> $GITHUB_STEP_SUMMARY
i=1
for file in recipes/*/*/conanfile.py; do
if [[ $i -gt 250 ]] ; then
break
fi
echo "$i - $file"
pylint --rcfile=linter/pylintrc_testpackage $file --ignore-paths="recipes/[^/]*/[^/]*/test_v1[^/]*/conanfile.py --output-format=json --output=recipes.json --exit-zero
jq 'map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}' recipes.json > recipes2.json
jq -r '" * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY
(( i += 1 ))
done
conanfile_recipe:
name: Lint changed conanfile.py (v2 migration)
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/linter-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ jobs:
- name: Run schema check (conandata.yml)
if: steps.changed_files.outputs.any_changed == 'true' && always()
run: |
err=0
for file in ${{ env.CONANDATA_FILES_PATH }}; do
python3 linter/conandata_yaml_linter.py ${file} || err=1
python3 linter/conandata_yaml_linter.py ${file}
done
if [[ $err == 1 ]]; then
exit 1
fi
lint_pr_files:
# Lint files modified in the pull_request
Expand Down Expand Up @@ -118,8 +114,5 @@ jobs:
echo "::remove-matcher owner=yamllint_matcher::"
for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do
python3 linter/conandata_yaml_linter.py ${file} || err=1
python3 linter/conandata_yaml_linter.py ${file}
done
if [[ $err == 1 ]]; then
exit 1
fi
2 changes: 1 addition & 1 deletion docs/adding_packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The specific steps to add new packages are:

* Fork the [conan-center-index](https://github.com/conan-io/conan-center-index) git repository, and then clone it locally.
* Copy a template from [package_templates](../package_templates) folder in the recipes/ folder and rename it to the project name (it should be lower-case). Read templates [documentation](../package_templates/README.md) to find more information.
* Make sure you are using the latest [Conan client](https://conan.io/downloads) version, as recipes might evolve introducing features of the newer Conan releases.
* Make sure you are using a recent [Conan client](https://conan.io/downloads) version, as recipes might evolve introducing features of the newer Conan releases.
* Commit and Push to GitHub then submit a pull request.
* Our automated build service will build 100+ different configurations, and provide messages that indicate if there were any issues found during the pull request on GitHub.

Expand Down
46 changes: 39 additions & 7 deletions docs/adding_packages/build_and_package.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,60 @@ Both methods often use build helpers to build binaries and install them into the

* `build()` method should focus on build only, not installation. During the build, nothing should be written in `package` folder. Installation step should only occur in `package()` method.

* The build itself should only rely on local files. Nothing should be downloaded from the internet during this step. If external files are required, they should come from `requirements` or `build_requirements` in addition to source files downloaded in `source()` or coming from the recipe itself.
* The build itself should only rely on local files. Nothing should be downloaded from the internet during this step. If external files are required, they should come from `requirements` or `build_requirements` in addition to source files downloaded in `source()` or coming from the recipe itself through `export()` or `export_sources()`.

* Except for CMake and a working build toolchain (compiler, linker, archiver, etc.), the recipe should not assume that any other build tool is installed on the user-build machine (like Meson, autotools, or pkg-config). On Windows, the recipe should not assume that a shell is available (like MSYS2). Therefore, if the build method requires additional tools, they should be added to `build_requirements()`.
* Except for CMake, a working build toolchain (compiler, linker, archiver, etc.), and a "native generator" (`make` on *nix platforms, `mingw32-make` for MinGW, `MSBuild`/`NMake` for Visual Studio), the recipe should not assume that any other build tool is installed on the user-build machine (like Meson, autotools, or pkg-config). On Windows, the recipe should not assume that a shell is available (like MSYS2). Therefore, if the build method requires additional tools, they should be added to `build_requirements()`.
Tools explicitly marked as available by users through conf like `tools.gnu:make_program`, `tools.gnu:pkg_config`, `tools.microsoft.bash:path`, `tools.microsoft.bash:subsystem` should be taken into account to conditionally inject a build requirement (these conf should have precedence over build requirement equivalent hardcoded in the recipe).

* It is forbidden to run other conan client commands during build. In other words, if upstream build files call conan under the hood (through `cmake-conan` for example or any other logic), this logic must be removed.

* Settings from profile should be honored (`build_type`, `compiler.libcxx`, `compiler.cppstd`, `compiler.runtime` etc).

* These env vars from profile should be honored and properly propagated to underlying build system during the build: `CC`, `CXX`, `CFLAGS`, `CXXFLAGS`, `LDFLAGS`.
* Compiler paths from host profile should be honored and properly propagated to underlying build system during the build:

| compiler type | conf / env var |
|---------------|----------------|
| C compiler | `c` key of `tools.build:compiler_executables`, otherwise `CC` environment variable |
| C++ compiler | `cpp` key of `tools.build:compiler_executables`, otherwise `CXX` environment variable |
| ASM compiler | `asm` key of `tools.build:compiler_executables`, otherwise `CCAS` environment variable |
| CUDA compiler | `cuda` key of `tools.build:compiler_executables` |
| Fortran compiler | `fortran` key of `tools.build:compiler_executables`, otherwise `FC` environment variable |
| Objective-C compiler | `objc` key of `tools.build:compiler_executables` |
| Objective-C++ compiler | `objcpp` key of `tools.build:compiler_executables` |
| Resource files compiler | `rc` key of `tools.build:compiler_executables`, otherwise `RC` environment variable |
| Archiver | `AR` environment variable |
| Linker | `LD` environment variable |

They should be curated on the fly if underlying build system expects a specific format (no spaces in path, forward slash instead of back slash, etc).

* These compiler and linker conf from host profile should be honored and propagated to underlying build system during the build:
* `tools.build:cflags`
* `tools.build:cxxflags`
* `tools.build:defines`
* `tools.build:sharedlinklags`
* `tools.build:exelinkflags`
* `tools.apple:enable_bitcode` (only if host OS is `iOS`/`watchOS`/`tvOS`)

* Multithread build (if supported by underlying build system):
* if some steps are sensitive to race conditions, monothread should be enforced.
* otherwise multithreaded build should be enabled with a number of cores controlled by `tools.build:jobs` conf from host profile if it is set, otherwise to all cores of build machine.

## Package Method

* CMake config files must be removed (they will be generated for consumers by `cmake_find_package`, `cmake_find_package_multi`, or `CMakeDeps` generators). Use `rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))` or `rm(self, "*.cmake", os.path.join(self.package_folder, "lib"))`.
* CMake config files must be removed. They will be generated for consumers by `CMakeDeps` generator (or legacy `cmake_find_package`/`cmake_find_package_multi` generators).

* pkg-config files must be removed (they will be generated for consumers by `pkg_config` or `PkgConfigDeps` generators). Use `rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))` or `rm(self, "*.pc", os.path.join(self.package_folder, "lib"))`.
* pkg-config files must be removed. They will be generated for consumers by `PkgConfigDeps` generator (or legacy `pkg_config` generator).

* On *nix systems, executables and shared libraries should have empty `RPATH`/`RUNPATH`/`LC_RPATH`.
* On *nix systems, executables and shared libraries should have empty `RPATH`/`RUNPATH`/`LC_RPATH`. Though, a relative path pointing inside package itself is allowed.

* On macOS, install name in `LC_ID_DYLIB` section of shared libs must be `@rpath/<libfilename>`.
* On Apple OS family:
* shared libs: name field of `LC_ID_DYLIB` load command must be `@rpath/<libfilename>`.
* shared libs & executables: name field of each `LC_LOAD_DYLIB` load command should be `@rpath/<libdependencyfilename>` (except those refering to system libs or frameworks).

* Installed files must not contain absolute paths specific to build machine. Relative paths to other packages is also forbidden since relative paths of dependencies during build may not be the same for consumers. Hardcoded relative paths pointing to a location in the package itself are allowed.

* Static and shared flavors of the same library must not be packaged together.

## Build System Examples

The [Conan's documentation](https://docs.conan.io) is always a good place for technical details.
Expand Down
14 changes: 13 additions & 1 deletion docs/adding_packages/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ This section outlines all the practices and guidelines for the `requirements()`
from handling "vendored" dependencies to what versions should be used.

<!-- toc -->
## Contents<!-- endToc -->
## Contents

* [List Dependencies](#list-dependencies)
* [Optional Requirements](#optional-requirements)
* [Build Requirements](#build-requirements)
* [Accessing Dependencies](#accessing-dependencies)
* [Handling Requirement's Options](#handling-requirements-options)
* [Verifying Dependency's Version](#verifying-dependencys-version)
* [Passing Requirement's info to `build()`](#passing-requirements-info-to-build)
* [Overriding the provided properties from the consumer](#overriding-the-provided-properties-from-the-consumer)
* [Adherence to Build Service](#adherence-to-build-service)
* [Version Ranges](#version-ranges)
* [Handling "internal" dependencies](#handling-internal-dependencies)<!-- endToc -->

## List Dependencies

Expand Down
12 changes: 6 additions & 6 deletions docs/adding_packages/test_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ themselves. It's possible to have ConanCenter run `conan test` on more then one
<!-- toc -->
## Contents

* [Files and Structure](#files-and-structure)
* [CMake targets](#cmake-targets)
* [Testing more generators with `test_<something>`](#testing-more-generators-with-test_something)
* [Testing CMake variables from FindModules](#testing-cmake-variables-from-findmodules)
* [How it works](#how-it-works)
* [Minimalist Source Code](#minimalist-source-code)<!-- endToc -->
* [Files and Structure](#files-and-structure)
* [CMake targets](#cmake-targets)
* [Testing more generators with `test_<something>`](#testing-more-generators-with-test_something)
* [Testing CMake variables from FindModules](#testing-cmake-variables-from-findmodules)
* [How it works](#how-it-works)
* [Minimalist Source Code](#minimalist-source-code)<!-- endToc -->

### Files and Structure

Expand Down
24 changes: 24 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

### 16-January-2023 - 16:43 CET

- [fix] ValidateInfrastructure: Fix Conan version check.
- [feature] TapaholesRepo: Build references when there are 0 packages for a recipe revision.

### 12-January-2023 - 19:33 CET

- [fix] Fix Conan v2 download/upload recipe commands.

### 12-January-2023 - 11:21 CET

- [feature] Add support for Conan v2 beta 7.
- [feature] Check complete Conan version on ValidateInfrastructure.
- [fix] Increase `conan test` timeout value.
- [fix] Fix stage name when calculating build configurations.

### 10-January-2023 - 15:20 CET

- [feature] Add entry in config to disable merging labels from the multibranch job.
- [feature] Add timeout to `conan test` command.
- [feature] Add API wrapper support for status page.
- [refactor] Separate build configuration calculation from pull-request interaction (labels/comments).
- [feature] Take main repository from configuration for Tapaholes jobs.

### 15-December-2022 - 11:12 CET

- [feature] Set github feeback title via config file (`feedback_title`).
Expand Down
6 changes: 2 additions & 4 deletions docs/developing_recipes_locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,8 @@ schema validation. There's are to encourage the best possible quality of recipes

```sh
# Lint a recipe:
yamllint --config-file linter/yamllint_rules.yml -f standard recipes/fmt/all/conanfile.py

# Lint the test_package (same command)
yamllint --config-file linter/yamllint_rules.yml -f standard recipes/fmt/all/test_package/conanfile.py
yamllint --config-file linter/yamllint_rules.yml -f standard recipes/config.yml
yamllint --config-file linter/yamllint_rules.yml -f standard recipes/fmt/all/conandata.yml
```

### Yamlschema
Expand Down
Loading

0 comments on commit 5995474

Please sign in to comment.