Extract metadata from conaninfo.txt
What does this MR do and why?
This MR extracts the data from conaninfo.txt
and replaces the info
for the conan package with the json representation.
References
- #480336 (closed) - Support custom settings in Conan metadata
- !161048 (closed) - Extract settings metadata from conaninfo.txt
-
#523693 (closed) - [Feature flag] Rollout of
parse_conan_metadata_on_upload
- #208321 (closed) - Add full recipe search to Conan package repository
- #33892 (closed) - Extract Conan (C/C++ Package Manager) metadata and add it to the UI
How to set up and validate locally
Supposing you have a conan remote called "gitlab-local" pointing to your local gitlab project. If not, you can set it up following the documentations: https://docs.gitlab.com/ee/user/packages/conan_repository/#add-a-remote-for-your-project
-
Create a new conan package
mkdir searchTestpkg && cd searchTestpkg conan new searchTest/1.2.3@gitlab-org+conan/stable --template=cmake_lib conan create . gitlab-org+conan/stable
-
Upload the package
conan upload searchTest/1.2.3@gitlab-org+conan/stable -r gitlab-local --all
-
Open rails console to verify the metadata
gdk rails console
# We take the last package, assuming this is the latest uploaded. package=Packages::Package.last package_file=package_file=package.package_files.find{|p| p.file_name == "conaninfo.txt"} package_file.conan_file_metadatum.package_reference.info
This can be compared with the built package file that can be found at:
~/.conan/data/searchTest/1.2.3/gitlab-org+conan/stable/package/<hash>/conaninfo.txt
-
Check invalid
conaninfo.txt
Run the following commands to generate a profile that will give a big conaninfo:
cp ~/.conan/profiles/default ~/.conan/profiles/big_conaninfo echo ' AAAAA=' >> ~/.conan/profiles/big_conaninfo printf 'A%.0s' {1..20001} >> ~/.conan/profiles/big_conaninfo
This assumes that the
[env]
section is the last section in the default profile. Check that the~/.conan/profiles/big_conaninfo
file ends with:... [env] AAAAA=AAAA....
Create a new package with the new profile and publish it.
mkdir bigTestpkg && cd bigTestpkg conan new bigTest/1.2.3@gitlab-org+conan/stable --template=cmake_lib conan create . gitlab-org+conan/stable -pr big_conaninfo
conan upload bigTest/1.2.3@gitlab-org+conan/stable -r gitlab-local --all
When checking the info field with the commands from step 3 you should get
{}
as a value
Related to #338926