Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Release package 3.1.0 #13

Merged
merged 2 commits into from
Feb 7, 2018
Merged

Conversation

theodelrieu
Copy link
Contributor

Hi,

I've updated the recipe for Json v3.1.0.
This release now includes a different way to install the project (multiple headers).

Users also have to #include <nlohmann/json.hpp>.

I've cleaned/updated a few parts of the recipe as well.

@theodelrieu
Copy link
Contributor Author

Maybe you could create a new branch that I can retarget? I could not find a way to do that in the PR interface.

Copy link
Contributor

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Maybe the "single-header" mode is not useful if you are using conan. I think it might not be worth modeling it.

conanfile.py Outdated
tmp = tools.load("json.hpp")
license_contents = tmp[2:tmp.find("*/", 1)]
tools.save("LICENSE", license_contents)
if self.options.single_header:
Copy link
Contributor

Choose a reason for hiding this comment

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

Using options in source() doesn't work that way. If you try to use the other option, it will fail.

source() must be common for all settings and options. If anything I would move that to build()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, my bad.

@vthiery
Copy link
Owner

vthiery commented Feb 5, 2018

Hi!
I already merged @memsharded PR to release the version 3.1.0. Can you please update your PR?
Thanks!

@theodelrieu
Copy link
Contributor Author

The previous version installed the json.hpp file inside the include folder.

With 3.1.0, it should be include/nlohmann.

As for the single header version, I'm not sure what to do. Having the multiple headers only seems good to me, and if people really want the amalgamated version, adding the option is not a problem.

@theodelrieu
Copy link
Contributor Author

I've pushed-force my changes, seems that Travis cannot run apt update

add_compile_options(-std=c++11)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
Copy link
Owner

Choose a reason for hiding this comment

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

This requires CMake 3.1.2 according to Conan's documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch!

@vthiery
Copy link
Owner

vthiery commented Feb 5, 2018

@theodelrieu Travis fails because of the deletion of build.py, see the build

@theodelrieu
Copy link
Contributor Author

Oh right, sorry I've seen it fail so many times because of those apt errors...

@theodelrieu theodelrieu force-pushed the release-package-3.1.0 branch 4 times, most recently from ebd5528 to 9101455 Compare February 5, 2018 13:52
@memsharded
Copy link
Contributor

I think that the include folder shouldn't probably be changed, so users can upgrade without changing their code. Regarding the amalgamated vs multiple headers, if the multiple headers really have a use case that they can be separately included, then maybe that should be the one and only package? Does it have a simple json.hpp file that will include all the others headers (with #include, not amalgamated, of course)?

If that is the case, I'd say the amalgamated version might not provide any advantage for conan users.

cc / @nlohmann

@theodelrieu
Copy link
Contributor Author

We haven't made that json.hpp umbrella file in the end.

I fear that allowing people to still include json.hpp will not make them update their code to use nlohmann/json.hpp. Especially if they have no use for nlohmann/json_fwd.hpp.

@memsharded
Copy link
Contributor

I understand both approaches, this is why I cc'd the library main author, to gather feedback about their personal preferences about this.

@theodelrieu
Copy link
Contributor Author

theodelrieu commented Feb 5, 2018

I'm the one who split the library, in the end we chose to unify the installation methods and to install everything into an include/nlohmann folder.

I think we should make reflect that intention in the package, and make the consumers change their code to #include <nlohmann/json.hpp>.

Moreover, if we don't support the amalgamation, users will have to change their includes.
For more details, you can take a look at nlohmann/json#944 :)

@nlohmann
Copy link

nlohmann commented Feb 6, 2018

@memsharded I trust in @theodelrieu in this regard. We have updated our documentation to use #include <nlohmann/json.hpp> everywhere.

@memsharded
Copy link
Contributor

Ok, thanks! I'd say that such change would have deserved a 4.0 version, as it is breaking for consumers, but I am fine with it, not a big deal. Go @theodelrieu with the proposed changes to the conan package, thanks!

@theodelrieu
Copy link
Contributor Author

Well technically, the library did not break anything. Rather, we were poor on installation instructions, but it did not matter that much with a single header library.

However the cmake install target already installed the single header within an include/nlohmann directory.

To sum up, users can still use the amalgamated version and install it wherever they want.

Though, I understand the current PR breaks the conan package.
Maybe we should create a new package supporting older releases as well (2.1.1 looks like a good minimum version), that always installs in an include/nlohmann directory? We could add it in conan-transit?

That way users of vthiery/jsonformoderncpp will not have surprises when upgrading to 3.1.1 by using the new package.

It's annoying that people got confused whereas where to the library, I hope 3.1.1 will solve that.

@memsharded
Copy link
Contributor

I'd say to keep it simple. If upstream github json 3.1.0 changed that, lets adjust to that. If I understood it correctly, the cmake install of the original repo already defined that in 3.1.0 (and broke to users), so conan package might be fine following the same behavior.

@theodelrieu
Copy link
Contributor Author

No, it already defined that in 2016 (I forgot which release it was), and it did not break because the cmake install target did not exist prior to that date.

To rephrase, the cmake install has always installed in include/nlohmann.

What really 3.1.0 added is the multiple headers version.

@memsharded
Copy link
Contributor

memsharded commented Feb 6, 2018

Ok, got it.

Just as an added motivation: we just found a use case of a library doing #include <nlohmann/json.hpp> (obviously failing to compile with the current 3.1.0 package), so this is certainly needed :)

@vthiery
Copy link
Owner

vthiery commented Feb 7, 2018

Good! I'll merge the PR as is then

.travis/run.sh Outdated
conan create . travis/testing -s compiler=clang -s compiler.version=5.0 -s compiler.libcxx=libstdc++ -e CXX=clang++
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the conan-package-tools will remove the automatic upload to bintray?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I didn't know there was such a feature :/

Should I revert the removal of build.py?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep :)

I think so, it is very convenient that the upload is automatic, in that way @vthiery just have to merge contributions and packages will be automatically uploaded, no need to do it manually.

It can also be done with a conan upload in the scripts but you need first to set the remote, then the user credentials for that remote... maybe better revert build.py, yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, my bad. Will do

Copy link
Owner

Choose a reason for hiding this comment

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

Ouch missed that! Yes indeed, the automatic upload is quite convenient, would be nice to keep it around :)

* Clean up test_package/ files.
* multi-header installation is now the default
* Install inside include/nlohmann
* Add sha256 verification
@theodelrieu
Copy link
Contributor Author

Should be good now :)

@vthiery vthiery merged commit 7a7c125 into vthiery:master Feb 7, 2018
@theodelrieu theodelrieu deleted the release-package-3.1.0 branch February 7, 2018 13:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants