-
Notifications
You must be signed in to change notification settings - Fork 118
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
conan.io support #30
conan.io support #30
Conversation
Your test package stuff does not seem to work. Also I don't like that you have to copy an example for it. |
Yeah, I think is a bug in the cmake generator of conan. I've sent a PR to fix it conan-io/conan#801
I agree it is not the best way to handle this, but I can also create the example cmake target using the examples/optional.cpp file directly. |
Yes, that would be better. |
Ping @Manu343726. |
It seems there's still something weird with their cmake macro to check the compiler version:conan-io/conan#1011 We have a C++ meetup in Madrid in a couple of weeks, so reaching @drodri to (finally) fix this would be easier... (I need to review this with him since I don't see something specially weird in the code they are generating nor in the code generator) NOTE: I'm explicitly spamming him since it seems this is the only way to make him not to ignore my messages :P |
Ping? |
So, how's it going? |
.travis.yml
Outdated
- cd type_safe/ | ||
|
||
script: | ||
- mkdir build/ && cd build/ | ||
- $CMAKE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Wno-parentheses" -DTYPE_SAFE_BUILD_TEST_EXAMPLE=ON -DTYPE_SAFE_BUILD_DOC="$BUILD_DOCS" -DTYPE_SAFE_STANDARDESE_DOWNLOAD_DIRECTORY=../standardese/ ../ | ||
- $CMAKE --build . | ||
- ./test/type_safe_test | ||
- cd .. && conan test_package --build=outdated && cd build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very outdated now, please use conan create
README.md
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
[![Build Status](https://travis-ci.org/foonathan/type_safe.svg?branch=master)](https://travis-ci.org/foonathan/type_safe) | |||
[![Build status](https://ci.appveyor.com/api/projects/status/aw1j2h2s52g4laen/branch/master?svg=true)](https://ci.appveyor.com/project/foonathan/type-safe/branch/master) | |||
[![badge](https://img.shields.io/badge/conan.io-type_safe%2F0.1-green.svg?logo=data:image/png;base64%2CiVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAA1VBMVEUAAABhlctjlstkl8tlmMtlmMxlmcxmmcxnmsxpnMxpnM1qnc1sn85voM91oM11oc1xotB2oc56pNF6pNJ2ptJ8ptJ8ptN9ptN8p9N5qNJ9p9N9p9R8qtOBqdSAqtOAqtR%2BrNSCrNJ/rdWDrNWCsNWCsNaJs9eLs9iRvNuVvdyVv9yXwd2Zwt6axN6dxt%2Bfx%2BChyeGiyuGjyuCjyuGly%2BGlzOKmzOGozuKoz%2BKqz%2BOq0OOv1OWw1OWw1eWx1eWy1uay1%2Baz1%2Baz1%2Bez2Oe02Oe12ee22ujUGwH3AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgBQkREyOxFIh/AAAAiklEQVQI12NgAAMbOwY4sLZ2NtQ1coVKWNvoc/Eq8XDr2wB5Ig62ekza9vaOqpK2TpoMzOxaFtwqZua2Bm4makIM7OzMAjoaCqYuxooSUqJALjs7o4yVpbowvzSUy87KqSwmxQfnsrPISyFzWeWAXCkpMaBVIC4bmCsOdgiUKwh3JojLgAQ4ZCE0AMm2D29tZwe6AAAAAElFTkSuQmCC)](http://www.conan.io/source/type_safe/0.1/Manu343726/testing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These badges are outdated too, now using Bintray
conanfile.py
Outdated
username = 'Manu343726' | ||
channel = 'testing' | ||
requires = 'debug_assert/1.1@Manu343726/testing' | ||
exports = '*.hpp' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use exports_sources
instead
conanfile.py
Outdated
|
||
class TypeSafe(ConanFile): | ||
name = 'type_safe' | ||
url = 'https://foonathan.github.io/blog/2016/10/11/type-safe.html' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The URL should point to the repo containing the recipe. It is the entry point to collaborate and give feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Manu343726 Could you fix it?
conanfile.py
Outdated
name = 'type_safe' | ||
url = 'https://foonathan.github.io/blog/2016/10/11/type-safe.html' | ||
version = '0.1' | ||
username = 'Manu343726' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
username and channel shouldn't be in the recipe at all
test_package/conanfile.py
Outdated
settings = 'os', 'compiler', 'build_type', 'arch' | ||
requires = ( | ||
'cmake-utils/0.0.0@Manu343726/testing', | ||
'type_safe/0.1@Manu343726/testing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requirement can be removed now, it is autoamtically injected
test_package/conanfile.py
Outdated
|
||
def build(self): | ||
cmake = CMake(self.settings) | ||
self.run('cmake {} {}'.format(self.conanfile_directory, cmake.command_line)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new cmake.configure()
and cmake.build()
methods might be more convenient.
test_package/CMakeLists.txt
Outdated
cmake_minimum_required(VERSION 2.8) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
include(${CONAN_CMAKE-UTILS_ROOT}/conan.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This extra include of conan.cmake might be unnecessary. You might want to update to modern CMake syntax with conan_basic_setup(TARGETS)
I'd like to see this library in conan as well 😄 |
pong (sorry). I would like to get into conan again in a couple of weeks, this lib being the no 1 in my list. BTW I would need your help @memsharded to get into the new jecosystem |
fa24512
to
b74c080
Compare
I've finally got some time to update the packages. Both type safe and debug assert packages have been updated and pushed to my artifactory repository (https://bintray.com/manu343726/conan-packages). I'm waiting for the travis CI build to see if the package test is passing. |
BTW the last commit allows anyone to own the package with no changes in the recipe, just upload the package using your account and repo: conan remote add your_remote_name your_bintray_repo_url # i.e. conan remote add origin https://bintray.com/manu343726/conan-packages
conan user -p your_bintray_user_token -r your_remote_name your_user_name
conan create your_user/your_channel # this generates and tests the package in channel "your_user/your_channel"
conan upload type_safe/0.1@your_user/your_channel --all --remote your_remote_name |
If you go one step further, you can also reuse it for future versions without modifying the recipe. Remove the name & version from the recipe then use:
|
Oh, didn't know about that. Thanks my anonymous friend. |
this last commit should make the travis CI build compatible with the conan 1.0 stable release. |
This commit adds a conan.io package recipe using my testing channel (Manu343726/testing). The package will be manually released into my own conan repository in artifactory (https://bintray.com/manu343726/conan-packages). Note debug_assert is released there too. The package is tagged with version 0.1, until an official release of type_safe is done. The package currently depends on debug_assert 1.3, the latest release packaged. No automatic conan packaging is implemented in the CI, only a package test. Note this must be trivial (encrypting the artifactory user key in travis, using one of the travis environment variables to check if we're building a release, etc).
Conan has two remotes (bintray official, named 'conan-center', and the old conan.io repo for backwards compatibility). Since debug_assert (and type_safe itself) is hosted in my own repository, we need to tell the conan client to add a remote pointing to my repo in order to install the debug_assert dependency
The current setup confuses conan profile discovery since conan uses gcc and clang (instead of g++ and clang++) to ask for the compiler version. The solution is simply keeping both in sync.
conan 1.0 sets this arg as mandatory for the create command. This should fix your CI build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really want to add a lot of releases for type_safe, how would that work with conan? Can people just get the latest mater?
conanfile.py
Outdated
|
||
class TypeSafe(ConanFile): | ||
name = 'type_safe' | ||
url = 'https://foonathan.github.io/blog/2016/10/11/type-safe.html' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Manu343726 Could you fix it?
conanfile.py
Outdated
name = 'type_safe' | ||
url = 'https://foonathan.github.io/blog/2016/10/11/type-safe.html' | ||
version = '0.1' | ||
requires = 'debug_assert/1.3@Manu343726/testing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing I have to update this one everytime I release a new version and/or update debug_assert?
We could maintain two different channels for the package (think of channels as "upstreams"), one with fixed package releases (the "stable" channel) and another one pointing to the latest master version of type_safe ("master"?, "latest"). Neither options are a problem from the recipe perspective (it's python after all, dwtfywt), just a matter of organization. I'm not sure if conan packaging allows packages without explicit versioning. @memsharded?
Of course, sorry. I will check debug_assert recipe too just in case.
Right, but we could infer the dependency programmatically from your sources. If type_safe uses a fixed debug_assert tag as submodule, we could parse that version from type_safe sources and set the package version from that tag. Note you would need to release a debug_assert package with the required version first. def get_package_version():
return os.system("git describe --abbrev=0 --tags", cwd=???)
class DebugAssert(ConanFile):
version = get_package_version()
... In general, I see what you're asking for: To release new versions of type_safe & debug_assert packages automatically, taking into account users can rely on the master branch, so packages should pick the latest master sources directly. What do you think @memsharded ? How would you handle this use case? (I'm not an expert, my comments above were just suggestions that come to my mind. IMO the right approach would be to set up a CI build for debug_assert that handles packaging (Using your own bintray account) and only runs on releases. Then add a task to the type_safe CI on master that checks for changes and pushes a new package increasing the release fix number (i.e. if the latest type_safe git tag on master was 0.1, release 0.1.0, 0.1.2, and so on, or even user the travis build number as fix; I do that at work and works very well). It's up to the package users to update their requirements. |
In many cases you just want to have packages for tagged/published versions, in this case, v0.1. Though you can perfectly have just |
@memsharded so we could tag the package as master, cool. About getting the package version from git or an environment variable, what do you think? |
You can leave the version undefined in the recipe. Then, in your CI, for example, get it from a branch convention (like release/X.Y.Z), and use:
|
Purrrrrfect, thanks a lot |
@Manu343726 Could you just update the project URL and then I'll merge it. |
Sure, I was trying to find a way to automate the dependency version. |
Done. Note both the package version and the dependency version would require manual changes in the recipe. Also, the debug_assert dependency is pointing to my jfrog account, it's up to you to configure your own account and submit debug_assert there. |
Implement support for C style comments and exclamation mark comments, i.e. /**, /*!, /// and //! are now supported. In C style comments the first star in a row is stripped but no C++ style comment markers. Fixes foonathan#30.`
Support for new comment styles - ///, //!, /**, /*! (fixes foonathan#30), as well as end-of-line comments (//<). Comment parsing and matching done by standardese, instead of libclang. Smart merging of adjacent comments. Change command parsing, now allows putting multiple commands in the same paragraph and merge documentation paragraph if needed. Add \entity to allow remote comments, i.e. documentation in comments that aren't matched. Add \file as shorthand for \entity current-file. Add \param, \tparam and \base to document (template) parameters and base classes inside the parent comment.
No description provided.