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

Conan package support (#4522) #4590

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

uilianries
Copy link
Contributor

Hi!

This PR is about the issue #4522

I just bring the Conan recipe, to build and package.
Also, I added a job on Travis to build Flatbuffer package, just to make sure that is working.

On next PR, I want to create multi packages (os x arch x build type x options) and submit all built packages to Bintray.

/cc @memsharded @lasote @zamazan4ik

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

- Added Conan recipe to build Flatbuffers
- Added Travis job to create Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@aardappel
Copy link
Collaborator

So.. Conan needs to inject itself into CMake files using Python to work? Doesn't sound very elegant to me, but oh well.

Also, as for submitting to Bintray, having binary packages available seems useful to me, though only on release versions, not every commit?

@aardappel aardappel merged commit f0769b6 into google:master Jan 12, 2018
@uilianries
Copy link
Contributor Author

I agree with you Injection is ugly. In general we use a wrapper to call conan_setup_tools and include the original Cmake:

cmake_minimum_required(VERSION 2.8)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

include(CMakeLists.txt)

In fact, we need to load Conan setup by such method. This method fills env vars, directory paths ...
Anyway, when Conan builds the package, it copies all listed files on exports_sources to a build directory, this include your cmake. But as a copy, your original cmake won't be changed.
Also, we can't change your original cmake directly, because this will force to run Conan by default.

I could create a directory with the cmake wrapper to avoid the injection. This can be done on next PR.

About Bintray, my suggestion is build at least using gcc (linux), clang (linux and mac) and msvc (windows). Flatbuffers take some minutes to be built and I agree that build on each commit will increase so much your CI time.
It's possible to build only when a new release is created by branch name or CI vars. I'll provide this feature on next PR.

Also will be necessary that you or some maintainer create a Bintray account to push the packages.
There is a good documentation about this here
Shortly, you need:

  • Create a new account
  • Create a Conan repository
  • Set CI environment (Travis and Appveyor)
    • CONAN_LOGIN_USERNAME: <your_bintray_username>
    • CONAN_PASSWORD: <you_bintray_api_key>
      You can obtain the API key by your Bintray profile

Any question, please feel free to ask!

Regards!

@uilianries uilianries deleted the feature/conan-support branch January 12, 2018 17:12
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added jobs to build Flatbuffers on OSX running on Travis

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added jobs to build Flatbuffers on OSX running on Travis

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 13, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 14, 2018
- Added jobs to build Flatbuffers on OSX running on Travis

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 17, 2018
- Removed msvc 10 x86_64 workaround
- Updated conan remote address
- Added Bincrafters' package tools

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jan 17, 2018
- Removed msvc 10 x86_64 workaround
- Updated conan remote address
- Added Bincrafters' package tools

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@aardappel
Copy link
Collaborator

@uilianries Conan appears to breaking unrelated PRs, see e.g. https://travis-ci.org/google/flatbuffers/jobs/337010509
Can you fix?

@uilianries
Copy link
Contributor Author

Of course! I'll check ASAP! Thanks for report!

@uilianries
Copy link
Contributor Author

The error started during apt-get update, the remotes were not achieved:
W: Failed to fetch http://ppa.launchpad.net/openjdk-r/ppa/ubuntu/dists/trusty/InRelease Could not connect to ppa.launchpad.net:80 (91.189.95.83), connection timed out

After that, was not possible to run gcc: [gcc]: command not found.

Indeed, the error occurred before to build anything:
The command "if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq g++-$GCC_VERSION; fi" failed and exited with 100 during .

I just re-ran the master branch and I didn't see any server error: https://travis-ci.org/uilianries/flatbuffers/builds/337763849

Could you re-run the build? It looks like some temporary server error.

Regards!

@aardappel
Copy link
Collaborator

CI that relies on heavy software installation is just a bad idea.. but that wasn't your fault.
I guess we'll need to live with it occasionally being flakey.

@uilianries
Copy link
Contributor Author

Travis supports some cache option, but AFAIK it's a paid feature. So, no free lunch.

Regards.

@aardappel
Copy link
Collaborator

@uilianries the Python code in here appears to be generating CI failures: https://travis-ci.org/google/flatbuffers/jobs/367231754

Any ideas how that can be improved?

@uilianries
Copy link
Contributor Author

Hi @aardappel !

Actually there is a problem with pypi service: https://status.python.org/

It's global, so we have no power to fix :(

uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 12, 2018
- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 12, 2018
- Added jobs to build Flatbuffers on OSX running on Travis

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 12, 2018
- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package
- Only build Conan package when release (tag)

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 12, 2018
- Removed msvc 10 x86_64 workaround
- Updated conan remote address
- Added Bincrafters' package tools

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 12, 2018
- Add fPIC as optional. It works on Linux and OSX
- Update recipe metadata: author, homepage, license
- Checking for flatc and flathash on Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 12, 2018
- Add rule to run conan job only for tags
- Run Conan on Linux, OSX and Windows
- Update package tool to new interface

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 13, 2018
- Add rule to run conan job only for tags
- Run Conan on Linux, OSX and Windows
- Update package tool to new interface

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 13, 2018
- Add rule to run conan job only for tags
- Run Conan on Linux, OSX and Windows
- Update package tool to new interface

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 13, 2018
- Add rule to run conan job only for tags
- Run Conan on Linux, OSX and Windows
- Update package tool to new interface

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 13, 2018
- Use google as default username

Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/flatbuffers that referenced this pull request Aug 13, 2018
- Use latest OSX 9.3 version to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
aardappel pushed a commit that referenced this pull request Aug 16, 2018
* Build Conan package on Travis CI (#4590)

- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on OSX (#4590)

- Added jobs to build Flatbuffers on OSX running on Travis

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on Windows (#4590)

- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package
- Only build Conan package when release (tag)

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Reduce Conan CI support to simple scripts (#4590)

- Removed msvc 10 x86_64 workaround
- Updated conan remote address
- Added Bincrafters' package tools

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add fPIC option on Conan recipe (#4590)

- Add fPIC as optional. It works on Linux and OSX
- Update recipe metadata: author, homepage, license
- Checking for flatc and flathash on Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on CI (#4590)

- Add rule to run conan job only for tags
- Run Conan on Linux, OSX and Windows
- Update package tool to new interface

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update Conan username (#4590)

- Use google as default username

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update OSX version on CI (#4590)

- Use latest OSX 9.3 version to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
zchee pushed a commit to zchee/flatbuffers that referenced this pull request Feb 14, 2019
* Build Conan package on Travis CI (google#4590)

- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on OSX (google#4590)

- Added jobs to build Flatbuffers on OSX running on Travis

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on Windows (google#4590)

- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package
- Only build Conan package when release (tag)

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Reduce Conan CI support to simple scripts (google#4590)

- Removed msvc 10 x86_64 workaround
- Updated conan remote address
- Added Bincrafters' package tools

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add fPIC option on Conan recipe (google#4590)

- Add fPIC as optional. It works on Linux and OSX
- Update recipe metadata: author, homepage, license
- Checking for flatc and flathash on Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Build Conan package on CI (google#4590)

- Add rule to run conan job only for tags
- Run Conan on Linux, OSX and Windows
- Update package tool to new interface

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update Conan username (google#4590)

- Use google as default username

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update OSX version on CI (google#4590)

- Use latest OSX 9.3 version to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@aardappel
Copy link
Collaborator

@uilianries We currently have CI errors: https://travis-ci.org/google/flatbuffers/jobs/561038298 that may be Conan related? Any idea what the problem is?

@rw
Copy link
Collaborator

rw commented Jul 23, 2019

@uilianries @aardappel This looks related (but not the cause): conan-io/conan#5094

@uilianries
Copy link
Contributor Author

looking it now

uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jul 23, 2019
- Create separated build for Conan on master branch
- Add Clang 7,8
- Add Gcc 9

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries
Copy link
Contributor Author

@aardappel @rw #5449

uilianries added a commit to uilianries/flatbuffers that referenced this pull request Jul 23, 2019
Signed-off-by: Uilian Ries <uilianries@gmail.com>
aardappel pushed a commit that referenced this pull request Jul 25, 2019
* #4590 Fix Conan build

- Create separated build for Conan on master branch
- Add Clang 7,8
- Add Gcc 9

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* #4590 Do not build Conan for PRs

Signed-off-by: Uilian Ries <uilianries@gmail.com>
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.

4 participants