Skip to content
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

Add HFSM2 Recipe #22647

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add HFSM2 Recipe #22647

wants to merge 6 commits into from

Conversation

Jak-o-Shadows
Copy link

Specify library name and version: HFSM2/2.5.0/2.4.0

HFSM2 is a finite state machine library that supports embedded platforms. Whilst Fetch-Content works in CMake, it is nicer to have all package management under one system.


@CLAassistant
Copy link

CLAassistant commented Feb 3, 2024

CLA assistant check
All committers have signed the CLA.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

…duced while adding newline at end of file)
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@uilianries uilianries self-assigned this Feb 8, 2024
Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jak-o-Shadows Thank your for your contribution! Please, check my review.

"2.5.0":
url: "https://github.com/andrew-gresyk/HFSM2/archive/refs/tags/2.5.0.zip"
sha256: "e295f8bccacc9d40eb04f08414e5abe623913453bad1d2b5b70210bf8080b309"
"2.4.0":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do need both versions? Otherwise, I would ask adding only the latest to save the CI. In case someone asks 2.4.0, so no problem, we add it later.

from conan.tools.layout import basic_layout
from conan.tools.files import get

required_conan_version = ">=2.0.16"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
required_conan_version = ">=2.0.16"
required_conan_version = ">=1.54.0"

Conan 1.x support is still mandatory in CCI.

url = "https://github.com/conan-io/conan-center-index"

package_type = "header-library"
exports_sources = "include/*"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exports_sources = "include/*"

That's only required when export from source, which means, both recipe and source are the same repository. As example: https://docs.conan.io/2/tutorial/developing_packages/local_package_development_flow.html

Comment on lines 37 to 38
# This will also copy the "include" folder
copy(self, os.path.join(self.exports_sources, "*.hpp"), self.source_folder, self.package_folder)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# This will also copy the "include" folder
copy(self, os.path.join(self.exports_sources, "*.hpp"), self.source_folder, self.package_folder)
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
copy(self, "*.hpp", self.source_folder, self.package_folder)
  • The license must be copied to the licenses folder. The CI will send an error in case missing
  • The first after of copy is reserved to pattern only. Try to keep it simple.

Comment on lines 41 to 44
# For header-only packages, libdirs and bindirs are not used
# so it's necessary to set those as empty.
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# For header-only packages, libdirs and bindirs are not used
# so it's necessary to set those as empty.
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []

Please, add an empty line to avoid future errors with git diff. Plus, template comments are not really needed.


add_executable(example example.cpp)
target_link_libraries(example PRIVATE hfsm2::hfsm2)
set_property(TARGET example PROPERTY CXX_STANDARD 11)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set_property(TARGET example PROPERTY CXX_STANDARD 11)
set_property(TARGET example PROPERTY CXX_STANDARD 11)

Missing empty EOL. To the CI, it's an error.

def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindir, "example")
self.run(bin_path, env="conanrun")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.run(bin_path, env="conanrun")
self.run(bin_path, env="conanrun")

Missing empty EOL. To the CI, it's an error.

assert(context.on == true);

return 0;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

Missing empty EOL. To the CI, it's an error.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

…to make CIwork, responding to feedback on PR#22647
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Failure in build 4 (ddb152e038e06e981b027f1796709fbe545401a7):

  • hfsm2/2.5.1:
    CI failed to create some packages (All logs)

    Logs for packageID abd3ca9581f5ec3d6672fa2ee8818b1f09dbb082:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=9
    os=Linux
    
    [...]
    hfsm2/2.5.1: Forced build from source
    Installing package: hfsm2/2.5.1
    Requirements
        hfsm2/2.5.1 from local cache - Cache
    Packages
        hfsm2/2.5.1:abd3ca9581f5ec3d6672fa2ee8818b1f09dbb082 - Build
    
    Installing (downloading, building) binaries...
    [HOOK - conan-center.py] pre_source(): [IMMUTABLE SOURCES (KB-H010)] OK
    hfsm2/2.5.1: Configuring sources in /home/conan/workspace/prod-v1/bsr/93744/bbedb/.conan/data/hfsm2/2.5.1/_/_/source/src
    hfsm2/2.5.1: 
    hfsm2/2.5.1: Unzipping 3.1MB, this can take a while
    hfsm2/2.5.1: 
    [HOOK - conan-center.py] post_source(): [LIBCXX MANAGEMENT (KB-H011)] OK
    [HOOK - conan-center.py] post_source(): [CPPSTD MANAGEMENT (KB-H022)] OK
    [HOOK - conan-center.py] post_source(): [SHORT_PATHS USAGE (KB-H066)] OK
    hfsm2/2.5.1: Building your package in /home/conan/workspace/prod-v1/bsr/93744/bbedb/.conan/data/hfsm2/2.5.1/_/_/build/abd3ca9581f5ec3d6672fa2ee8818b1f09dbb082
    hfsm2/2.5.1: Generator txt created conanbuildinfo.txt
    hfsm2/2.5.1: Aggregating env generators
    [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] 'fPIC' option not found
    [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] OK
    hfsm2/2.5.1: Calling build()
    hfsm2/2.5.1: Package 'abd3ca9581f5ec3d6672fa2ee8818b1f09dbb082' built
    hfsm2/2.5.1: Build folder /home/conan/workspace/prod-v1/bsr/93744/bbedb/.conan/data/hfsm2/2.5.1/_/_/build/abd3ca9581f5ec3d6672fa2ee8818b1f09dbb082/build-release
    hfsm2/2.5.1: Generated conaninfo.txt
    hfsm2/2.5.1: Generated conanbuildinfo.txt
    hfsm2/2.5.1: Generating the package
    hfsm2/2.5.1: Package folder /home/conan/workspace/prod-v1/bsr/93744/bbedb/.conan/data/hfsm2/2.5.1/_/_/package/abd3ca9581f5ec3d6672fa2ee8818b1f09dbb082
    hfsm2/2.5.1: Calling package()
    hfsm2/2.5.1: Copied 1 file: LICENSE
    hfsm2/2.5.1: Copied 1 '.hpp' file: machine.hpp
    [HOOK - conan-center.py] post_package(): [PACKAGE LICENSE (KB-H012)] OK
    [HOOK - conan-center.py] post_package(): [DEFAULT PACKAGE LAYOUT (KB-H013)] OK
    [HOOK - conan-center.py] post_package(): [SHARED ARTIFACTS (KB-H015)] OK
    [HOOK - conan-center.py] post_package(): [STATIC ARTIFACTS (KB-H074)] OK
    [HOOK - conan-center.py] post_package(): [EITHER STATIC OR SHARED OF EACH LIB (KB-H076)] OK
    [HOOK - conan-center.py] post_package(): [PC-FILES (KB-H020)] OK
    [HOOK - conan-center.py] post_package(): [CMAKE-MODULES-CONFIG-FILES (KB-H016)] OK
    [HOOK - conan-center.py] post_package(): [PDB FILES NOT ALLOWED (KB-H017)] OK
    [HOOK - conan-center.py] post_package(): [LIBTOOL FILES PRESENCE (KB-H018)] OK
    [HOOK - conan-center.py] post_package(): [MS RUNTIME FILES (KB-H021)] OK
    [HOOK - conan-center.py] post_package(): [SHORT_PATHS USAGE (KB-H066)] OK
    [HOOK - conan-center.py] post_package(): [MISSING SYSTEM LIBS (KB-H043)] OK
    [HOOK - conan-center.py] post_package(): [APPLE RELOCATABLE SHARED LIBS (KB-H077)] OK
    WARN: *** Conan 1 is legacy and on a deprecation path ***
    WARN: *** Please upgrade to Conan 2 ***
    hfsm2/2.5.1: WARN: This conanfile has no build step
    [HOOK - conan-center.py] post_package(): ERROR: [MATCHING CONFIGURATION (KB-H014)] Package for Linux does not contain artifacts with these extensions: ['a', 'so', 'sh', ''] (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H014-MATCHING-CONFIGURATION) 
    [HOOK - conan-center.py] post_package(): ERROR: [MATCHING CONFIGURATION (KB-H014)] Packaged artifacts does not match the settings used: os=Linux, compiler=gcc (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H014-MATCHING-CONFIGURATION) 
    ERROR: [HOOK - conan-center.py] post_package(): Some checks failed running the hook, check the output
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.


Conan v2 pipeline ✔️

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

All green in build 3 (ddb152e038e06e981b027f1796709fbe545401a7):

  • hfsm2/2.5.1:
    All packages built successfully! (All logs)

@Jak-o-Shadows
Copy link
Author

I'm not quite sure what the issue is - the package doesnt' seem substantially different from libNPY (https://github.com/conan-io/conan-center-index/tree/master/recipes/libnpy), which built successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants