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

[boost] Optionally use ICU #1274

Merged
merged 7 commits into from
Apr 23, 2020
Merged

[boost] Optionally use ICU #1274

merged 7 commits into from
Apr 23, 2020

Conversation

jgsogo
Copy link
Contributor

@jgsogo jgsogo commented Apr 4, 2020

Specify library name and version: boost/all

Add option icu to use ICU library (regex and locale)

Closes #1270

This PR requires #1273 before, so ICU 66.1 is available.

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot
Copy link
Collaborator

All green in build 1 (f460ff55fdd78443ec2aabf9be95eb850c5d39e4)! 😊

@SSE4 SSE4 requested a review from uilianries April 5, 2020 06:12
@@ -55,7 +55,8 @@ class BoostConan(ConanFile):
"segmented_stacks": [True, False],
"debug_level": [i for i in range(1, 14)],
"pch": [True, False],
"extra_b2_flags": "ANY" # custom b2 flags
"extra_b2_flags": "ANY", # custom b2 flags
"icu": [True, False],
Copy link
Contributor

Choose a reason for hiding this comment

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

are ICU and iconv mutually exclusive options?
if yes, maybe it's better to design option like locale_backend: ["ICU", "iconv", None]
this might be helpful: https://github.com/bincrafters/conan-boost_base/blob/testing/2.0.0/conanfile.py
/cc @grafikrobot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that iconv is more like a fallback, you can choose to use icu, but if it is not available, the package will use iconv. It also follows the same option pattern as zlib, zstd,... if you activate it then more requires will be added.

Copy link
Contributor

Choose a reason for hiding this comment

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

they are different. zlib, zstd, bzip2 backends can be used together, while iconv and ICU seems to be mutually exclusive.

@@ -133,6 +139,8 @@ def requirements(self):
self.requires("xz_utils/5.2.4")
if self.options.zstd:
self.requires("zstd/1.4.3")
if self.options.icu:
Copy link
Contributor

Choose a reason for hiding this comment

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

probably we have to check for without_locale option to avoid unneeded dependency in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ICU applies to regex and locale, not sure if you can apply ICU to one without the other. I really don't know how the transitivity and dependencies among Boost libraries work

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, seems to be check should be like:
if not without_locale or not without_regex:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a check. 'locale' doesn't compile without a i18n backend, but 'regex' does 🤷

@jgsogo
Copy link
Contributor Author

jgsogo commented Apr 6, 2020

Anyway, I really dislike one change in this PR:

    def configure(self):
        if self.options.icu:
            tools.check_min_cppstd(self, "11")

This doesn't belong to the Boost recipe but to the ICU one. Nevertheless we know we cannot add it to ICU because C3i won't generate any package... we need to prioritize this kind of thing.

Copy link
Contributor

@SSE4 SSE4 left a comment

Choose a reason for hiding this comment

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

move the cppstd check into ICU

Copy link
Contributor Author

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

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

I've removed the c++11 check that belongs to the ICU library.

@jgsogo jgsogo requested review from SSE4 and uilianries April 18, 2020 16:34
@conan-center-bot
Copy link
Collaborator

All green in build 2 (2b15d9a0990f0905b6f26fe5c4cc6088545183d6)! 😊

@conan-center-bot
Copy link
Collaborator

An unexpected error happened and has been reported. Help is on its way! 🏇

@conan-center-bot
Copy link
Collaborator

All green in build 4 (67086e295dd046d9352f625ea894024862bdd4e5)! 😊

@@ -81,6 +82,7 @@ class BoostConan(ConanFile):
"debug_level": 2,
'pch': True,
'extra_b2_flags': 'None',
"i18n_backend": 'iconv',
Copy link
Contributor

Choose a reason for hiding this comment

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

hm, so recipe has no dependency on libiconv, but it still builds with iconv backend?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, in Mac/Linux probably it is quite common to have it installed, boost finds it and uses it. If not found, and this could be a problem, boost won't build locale but it will succeed (there is a message in the output, nothing else).

Copy link
Contributor

Choose a reason for hiding this comment

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

I have doubts... might be not very reliable or reproducible, then sometimes locale won't be built, but sometimes will be. maybe you can add an actual reference to libiconv recipe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I'm adding this check:

image

still we would need a libiconv requires, but probably it is better for another PR, this one keeps it as it was before (regarding iconv)

@jgsogo
Copy link
Contributor Author

jgsogo commented Apr 22, 2020

@SSE4 but... will you approve this PR? 😄

@danimtb danimtb merged commit b013b05 into conan-io:master Apr 23, 2020
@jgsogo jgsogo deleted the feat/boost-icu branch April 23, 2020 09:51
flags.append("boost.locale.iconv=on boost.locale.icu=off")
else:
flags.append("boost.locale.iconv=off boost.locale.icu=off")
flags.append("--disable-icu --disable-iconvv")
Copy link
Contributor

Choose a reason for hiding this comment

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

I was just looking at this recipe, and noticed this. Is --disable-iconvv a typo? Should it be --disable-iconv?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, seems so, feel free to submit PR with fix

@pepsiman
Copy link
Contributor

All green in build 4 (67086e295dd046d9352f625ea894024862bdd4e5)!

None of these packages have ICU enabled, so they tell me nothing.

On Windows, boost's build system expects ICU to have both release and debug libraries.
On 64bit Windows, boost's build system expects ICU to have bin64 and lib64 directories.

I don't believe that this package of boost will use the package of ICU on Windows.

@danimtb
Copy link
Member

danimtb commented Aug 25, 2020

@pepsiman you will have to set the option i18n_backend to icu in order to use the dependency. However, you will have to build from sources.

@pepsiman
Copy link
Contributor

@danimtb Yes, but it doesn't build from sources on Windows.

@danimtb
Copy link
Member

danimtb commented Aug 26, 2020

please open an issue with the build log so we are able to check, thank you

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

Successfully merging this pull request may close these issues.

[package] boost/all: Compile locale, regex using ICU
7 participants