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 json generator to conan #3493

Merged
merged 7 commits into from
Jan 9, 2022
Merged

add json generator to conan #3493

merged 7 commits into from
Jan 9, 2022

Conversation

nilsnolde
Copy link
Member

@nilsnolde nilsnolde commented Jan 5, 2022

... so downstream apps can use valhalla's conanfile.txt to know where boost is installed. there's no side effects except for an additional file, the cmake build should still work as before.

specifically I'm using valhalla as submodule and instead of generating another conanfile.txt I can use valhalla's if it exports the dependency tree as JSON.

this is what it looks like for valhalla currently:

conanbuildinfo.json
{
  "deps_env_info": {
    "BOOST_ROOT": "/home/nilsnolde/.conan/data/boost/1.71.0/_/_/package/524ea35a8120baabdde02483add58d81bf541327"
  },
  "deps_user_info": {
    "boost": {
      "stacktrace_addr2line_available": "False"
    }
  },
  "dependencies": [
    {
      "version": "1.71.0",
      "description": "Boost provides free peer-reviewed portable C++ source libraries",
      "rootpath": "/home/nilsnolde/.conan/data/boost/1.71.0/_/_/package/524ea35a8120baabdde02483add58d81bf541327",
      "sysroot": "",
      "include_paths": [
        "/home/nilsnolde/.conan/data/boost/1.71.0/_/_/package/524ea35a8120baabdde02483add58d81bf541327/include"
      ],
      "lib_paths": [],
      "bin_paths": [],
      "build_paths": [
        "/home/nilsnolde/.conan/data/boost/1.71.0/_/_/package/524ea35a8120baabdde02483add58d81bf541327/"
      ],
      "res_paths": [],
      "libs": [],
      "system_libs": [],
      "defines": [],
      "cflags": [],
      "cxxflags": [],
      "sharedlinkflags": [],
      "exelinkflags": [],
      "frameworks": [],
      "framework_paths": [],
      "names": {
        "cmake_find_package": "Boost",
        "cmake_find_package_multi": "Boost"
      },
      "filenames": {
        "cmake_find_package": "Boost",
        "cmake_find_package_multi": "Boost"
      },
      "cppflags": [],
      "name": "boost"
    }
  ],
  "settings": {
    "arch": "x86_64",
    "arch_build": "x86_64",
    "build_type": "Release",
    "compiler": "gcc",
    "compiler.libcxx": "libstdc++",
    "compiler.version": "11",
    "os": "Linux",
    "os_build": "Linux"
  },
  "options": {
    "boost": {
      "asio_no_deprecated": "False",
      "buildid": "None",
      "bzip2": "True",
      "debug_level": "0",
      "diagnostic_definitions": "False",
      "error_code_header_only": "False",
      "extra_b2_flags": "None",
      "filesystem_no_deprecated": "False",
      "header_only": "True",
      "i18n_backend": "deprecated",
      "layout": "system",
      "lzma": "False",
      "magic_autolink": "False",
      "multithreading": "True",
      "namespace": "boost",
      "namespace_alias": "False",
      "pch": "True",
      "python_executable": "None",
      "python_version": "None",
      "segmented_stacks": "False",
      "system_no_deprecated": "False",
      "visibility": "hidden",
      "without_atomic": "True",
      "without_chrono": "True",
      "without_container": "True",
      "without_context": "True",
      "without_contract": "True",
      "without_coroutine": "True",
      "without_date_time": "True",
      "without_exception": "True",
      "without_fiber": "True",
      "without_filesystem": "True",
      "without_graph": "True",
      "without_graph_parallel": "True",
      "without_iostreams": "True",
      "without_locale": "True",
      "without_log": "True",
      "without_math": "True",
      "without_mpi": "True",
      "without_program_options": "True",
      "without_python": "True",
      "without_random": "True",
      "without_regex": "True",
      "without_serialization": "True",
      "without_stacktrace": "True",
      "without_system": "True",
      "without_test": "True",
      "without_thread": "True",
      "without_timer": "True",
      "without_type_erasure": "True",
      "without_wave": "True",
      "zlib": "True",
      "zstd": "False"
    }
  }
}

the command for a super-project where valhalla is in ./lib:

conan install --install-folder $PWD/conan_build --remote conancenter lib/valhalla

@kevinkreiser
Copy link
Member

i have a question about your other project that uses valhalla as a submodule. how are you including valhalla in that downstream cmake project? i have used add_subdirectory before and it seemed to do the right thing by including all the valhalla targets etc in my project. why then dont the BOOST:: targets also show up for you? i guess im asking are you sure you need that file? granted i know nothing about your project, but just checking 😄

@nilsnolde
Copy link
Member Author

Oh yeah, a cmake build wouldn’t be a problem. It’s a setuptools build for python, so I need all the include paths etc. it’s not even about building Valhalla itself, just about building the binding code.

kevinkreiser
kevinkreiser previously approved these changes Jan 7, 2022
Copy link
Member

@kevinkreiser kevinkreiser left a comment

Choose a reason for hiding this comment

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

if its helpful to someone to have the generated json i dont mind!

@nilsnolde
Copy link
Member Author

can you re-approve @kevinkreiser ? thx!

CHANGELOG.md Outdated
Comment on lines 53 to 54
* CHANGED: fix more protobuf unstable 3.x API [#3494](https://github.com/valhalla/valhalla/pull/3494)
* CHANGED: fix more protobuf unstable 3.x API [#3494](https://github.com/valhalla/valhalla/pull/3494) & [#3501](https://github.com/valhalla/valhalla/pull/3501)
Copy link
Member

Choose a reason for hiding this comment

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

seems duplicated with the next line that references both prs, do you want two separate or one with both in it. surely you dont want 3 references?

Copy link
Member Author

Choose a reason for hiding this comment

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

🤦 thanks!

@kevinkreiser kevinkreiser merged commit af4272b into master Jan 9, 2022
@kevinkreiser kevinkreiser deleted the nn-conan-json branch January 9, 2022 02:38
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.

None yet

2 participants