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

brew install bond #1062

Closed
ankane opened this issue Jul 26, 2020 · 6 comments
Closed

brew install bond #1062

ankane opened this issue Jul 26, 2020 · 6 comments
Labels

Comments

@ankane
Copy link

ankane commented Jul 26, 2020

Hi, thanks for open sourcing this project! I'm hoping to add bond to Homebrew so Mac users can install it with:

brew install bond

However, I'm running into an error when trying to test it.

Undefined symbols for architecture x86_64:
  "examples::serialization::Struct::Schema::s_n_metadata", referenced from:
      boost::disable_if_c<(is_reader<examples::serialization::Struct const&>::value) && (is_fast_path_field<examples::serialization::Struct::Schema::var::n_type, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> >::value), bool>::type bond::detail::NonBasicTypeField<examples::serialization::Struct::Schema::var::n_type, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols>, examples::serialization::Struct const&>(examples::serialization::Struct::Schema::var::n_type const&, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> const&, examples::serialization::Struct const&) in serialization-74f814.o
      boost::enable_if_c<(!(is_bond_type<examples::serialization::Struct::Schema::var::n_type::field_type>::value)) && (std::is_same<examples::serialization::Struct::Schema::var::n_type::field_modifier, std::__1::integral_constant<bond::_bond_enumerators::Modifier::Modifier, (bond::_bond_enumerators::Modifier::Modifier)0> >::value), void>::type bond::detail::OptionalDefault<examples::serialization::Struct>::operator()<examples::serialization::Struct::Schema::var::n_type>(examples::serialization::Struct::Schema::var::n_type const&) in serialization-74f814.o
      void bond::DynamicParser<bond::CompactBinaryReader<bond::InputBuffer>&>::ReadFields<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<3l>, examples::serialization::Struct::Schema::var::n_type, boost::mpl::l_item<mpl_::long_<2l>, examples::serialization::Struct::Schema::var::str_type, boost::mpl::l_item<mpl_::long_<1l>, examples::serialization::Struct::Schema::var::items_type, boost::mpl::l_end> > > >, bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > >(boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<3l>, examples::serialization::Struct::Schema::var::n_type, boost::mpl::l_item<mpl_::long_<2l>, examples::serialization::Struct::Schema::var::str_type, boost::mpl::l_item<mpl_::long_<1l>, examples::serialization::Struct::Schema::var::items_type, boost::mpl::l_end> > > > const&, unsigned short&, bond::_bond_enumerators::BondDataType::BondDataType&, bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > const&) in serialization-74f814.o
      bond::reflection::FieldTemplate<(unsigned short)0, std::__1::integral_constant<bond::_bond_enumerators::Modifier::Modifier, (bond::_bond_enumerators::Modifier::Modifier)0>, examples::serialization::Struct, unsigned int, &(examples::serialization::Struct::n), &(examples::serialization::Struct::Schema::s_n_metadata)>::metadata in serialization-74f814.o
  "examples::serialization::Struct::Schema::s_str_metadata", referenced from:
      boost::disable_if_c<(is_reader<examples::serialization::Struct const&>::value) && (is_fast_path_field<examples::serialization::Struct::Schema::var::str_type, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> >::value), bool>::type bond::detail::NonBasicTypeField<examples::serialization::Struct::Schema::var::str_type, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols>, examples::serialization::Struct const&>(examples::serialization::Struct::Schema::var::str_type const&, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> const&, examples::serialization::Struct const&) in serialization-74f814.o
      boost::enable_if_c<(!(is_bond_type<examples::serialization::Struct::Schema::var::str_type::field_type>::value)) && (std::is_same<examples::serialization::Struct::Schema::var::str_type::field_modifier, std::__1::integral_constant<bond::_bond_enumerators::Modifier::Modifier, (bond::_bond_enumerators::Modifier::Modifier)0> >::value), void>::type bond::detail::OptionalDefault<examples::serialization::Struct>::operator()<examples::serialization::Struct::Schema::var::str_type>(examples::serialization::Struct::Schema::var::str_type const&) in serialization-74f814.o
      void bond::DynamicParser<bond::CompactBinaryReader<bond::InputBuffer>&>::ReadFields<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<2l>, examples::serialization::Struct::Schema::var::str_type, boost::mpl::l_item<mpl_::long_<1l>, examples::serialization::Struct::Schema::var::items_type, boost::mpl::l_end> > >, bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > >(boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<2l>, examples::serialization::Struct::Schema::var::str_type, boost::mpl::l_item<mpl_::long_<1l>, examples::serialization::Struct::Schema::var::items_type, boost::mpl::l_end> > > const&, unsigned short&, bond::_bond_enumerators::BondDataType::BondDataType&, bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > const&) in serialization-74f814.o
      bond::reflection::FieldTemplate<(unsigned short)1, std::__1::integral_constant<bond::_bond_enumerators::Modifier::Modifier, (bond::_bond_enumerators::Modifier::Modifier)0>, examples::serialization::Struct, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, &(examples::serialization::Struct::str), &(examples::serialization::Struct::Schema::s_str_metadata)>::metadata in serialization-74f814.o
  "examples::serialization::Struct::Schema::s_items_metadata", referenced from:
      boost::disable_if_c<(is_reader<examples::serialization::Struct const&>::value) && (is_fast_path_field<examples::serialization::Struct::Schema::var::items_type, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> >::value), bool>::type bond::detail::NonBasicTypeField<examples::serialization::Struct::Schema::var::items_type, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols>, examples::serialization::Struct const&>(examples::serialization::Struct::Schema::var::items_type const&, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> const&, examples::serialization::Struct const&) in serialization-74f814.o
      boost::enable_if_c<(!(is_bond_type<examples::serialization::Struct::Schema::var::items_type::field_type>::value)) && (std::is_same<examples::serialization::Struct::Schema::var::items_type::field_modifier, std::__1::integral_constant<bond::_bond_enumerators::Modifier::Modifier, (bond::_bond_enumerators::Modifier::Modifier)0> >::value), void>::type bond::detail::OptionalDefault<examples::serialization::Struct>::operator()<examples::serialization::Struct::Schema::var::items_type>(examples::serialization::Struct::Schema::var::items_type const&) in serialization-74f814.o
      void bond::DynamicParser<bond::CompactBinaryReader<bond::InputBuffer>&>::ReadFields<boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<1l>, examples::serialization::Struct::Schema::var::items_type, boost::mpl::l_end> >, bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > >(boost::mpl::l_iter<boost::mpl::l_item<mpl_::long_<1l>, examples::serialization::Struct::Schema::var::items_type, boost::mpl::l_end> > const&, unsigned short&, bond::_bond_enumerators::BondDataType::BondDataType&, bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > const&) in serialization-74f814.o
      bond::reflection::FieldTemplate<(unsigned short)2, std::__1::integral_constant<bond::_bond_enumerators::Modifier::Modifier, (bond::_bond_enumerators::Modifier::Modifier)0>, examples::serialization::Struct, std::__1::vector<double, std::__1::allocator<double> >, &(examples::serialization::Struct::items), &(examples::serialization::Struct::Schema::s_items_metadata)>::metadata in serialization-74f814.o
  "examples::serialization::Struct::Schema::metadata", referenced from:
      boost::disable_if_c<((hierarchy_depth<examples::serialization::Struct::Schema>::value) > (expected_depth<bond::Serializer<bond::CompactBinaryWriter<bond::CompactBinaryCounter::type>, bond::BuiltInProtocols> >::value)), bool>::type bond::detail::ParserInheritance<examples::serialization::Struct const&, bond::StaticParser<examples::serialization::Struct const&> >::Read<examples::serialization::Struct::Schema, bond::Serializer<bond::CompactBinaryWriter<bond::CompactBinaryCounter::type>, bond::BuiltInProtocols> >(examples::serialization::Struct::Schema const&, bond::Serializer<bond::CompactBinaryWriter<bond::CompactBinaryCounter::type>, bond::BuiltInProtocols> const&) in serialization-74f814.o
      boost::disable_if_c<((hierarchy_depth<examples::serialization::Struct::Schema>::value) > (expected_depth<bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> >::value)), bool>::type bond::detail::ParserInheritance<examples::serialization::Struct const&, bond::StaticParser<examples::serialization::Struct const&> >::Read<examples::serialization::Struct::Schema, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> >(examples::serialization::Struct::Schema const&, bond::Serializer<bond::CompactBinaryWriter<bond::OutputMemoryStream<std::__1::allocator<char> > >, bond::BuiltInProtocols> const&) in serialization-74f814.o
      boost::disable_if_c<((hierarchy_depth<examples::serialization::Struct::Schema>::value) > (expected_depth<bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > >::value)), bool>::type bond::detail::ParserInheritance<bond::CompactBinaryReader<bond::InputBuffer>&, bond::DynamicParser<bond::CompactBinaryReader<bond::InputBuffer>&> >::Read<examples::serialization::Struct::Schema, bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > >(examples::serialization::Struct::Schema const&, bond::To<examples::serialization::Struct, bond::BuiltInProtocols, bond::RequiredFieldValiadator<examples::serialization::Struct> > const&) in serialization-74f814.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like there may be a missing lib, but not sure what that is.

Formula (includes test code): https://github.com/ankane/homebrew-core/blob/bond/Formula/bond.rb
Full build logs: https://github.com/ankane/homebrew-core/runs/912492258?check_suite_focus=true

Also, the gbc binary that's created doesn't have read permissions (---x--x--x instead of -r-xr-xr-x), which seems uncommon. Is this something that's easy to fix?

@chwarr
Copy link
Member

chwarr commented Jul 30, 2020

Undefined symbols for architecture x86_64:
"examples::serialization::Struct::Schema::s_n_metadata"

That symbol should be in the generated _types.cpp file (see: example .bond file and the expected _types.cpp for it). Particularly since you noticed that gbc is missing read permissions, I'd check that code gen successfully ran, that those files were compiled, and that they were included in the final linker input somehow (either as .o or .a files, depending on how they get packaged).

Also, the gbc binary that's created doesn't have read permissions (---x--x--x instead of -r-xr-xr-x), which seems uncommon. Is this something that's easy to fix?

It looks like the permissions are incorrectly specified for installing gbc:

install (FILES ${output}
    PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
    DESTINATION bin)

If you submit a PR that adds the three _READ permissions, I can merge that.

(I don't have any experience with brew, and I don't currently have a macOS system to work on.)

@ankane
Copy link
Author

ankane commented Jul 31, 2020

Hey @chwarr, thanks for the response! I somehow missed the _types.cpp file, so everything is working now. I submitted a PR to Homebrew here: Homebrew/homebrew-core#58894

@ankane ankane closed this as completed Jul 31, 2020
@ankane
Copy link
Author

ankane commented Jul 31, 2020

The formula was just accepted, making installation pretty much instant on Mac 🎉

@johnib
Copy link

johnib commented Nov 4, 2024

How do we install bond today via homebrew? I don't see this as an option anymore.

➜  build git:(master) ✗ brew install bond
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################################################################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################################################################################################################################################################################################### 100.0%
Warning: No available formula with the name "bond". Did you mean bnd or bind?
==> Searching for similarly named formulae and casks...
==> Formulae
bnd                                                                                                                                                    bind

To install bnd, run:
  brew install bnd

@ankane
Copy link
Author

ankane commented Nov 4, 2024

See #1194

@johnib
Copy link

johnib commented Nov 4, 2024

See #1194

Any other way to install bond on macOS ?

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

No branches or pull requests

3 participants