pksunkara / reign

Opinionated Isomorphic Web Framework in Rust
https://reign.rs
Apache License 2.0
5 stars 3 forks source link

Allow dynamic linking of reign during development #32

Open pksunkara opened 3 years ago

pksunkara commented 3 years ago

Inspired by https://github.com/bevyengine/bevy/pull/808


There seems to be issues when trying to do this. Maybe because of re-exports? Or just maybe http and hyper crates don't support dynamic libs?

  = note: Undefined symbols for architecture x86_64:
            "http::header::map::HeaderMap$LT$T$GT$::remove_all_extra_values::h2e46f72c22c7526e", referenced from:
                http::header::map::HeaderMap$LT$T$GT$::insert_occupied::hf94d066ed0f6ae9d in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.ko4qmh4uojfmwpc.rcgu.o)
            "_$LT$http..header..map..GetAll$LT$T$GT$$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$::into_iter::h3614775a008f77b2", referenced from:
                http::header::map::GetAll$LT$T$GT$::iter::h2cf8946ebe4c5c40 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.ko4qmh4uojfmwpc.rcgu.o)
            "_$LT$http..header..map..ValueIter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h2a8e6839a7b78e45", referenced from:
                core::iter::traits::iterator::Iterator::fold::h017ddb3be660b2f5 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.ko4qmh4uojfmwpc.rcgu.o)
            "http::header::map::HeaderMap$LT$T$GT$::get_all::h9b77ea5655bd57c6", referenced from:
                reign_router::middleware::cookie::CookieParser::parse::hfdfdc1ef0a722456 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.k4xogw30vcznki3.rcgu.o)
            "_$LT$hyper..error..Error$u20$as$u20$core..fmt..Debug$GT$::fmt::hc3bade33ef8ef13a", referenced from:
                _$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$::fmt::h0ff2862b352792f0 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.5amrgwv35f7hx3la.rcgu.o)
                l___unnamed_1 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.5amrgwv35f7hx3la.rcgu.o)
            "_$LT$hyper..error..Error$u20$as$u20$std..error..Error$GT$::source::hf92c7124f95c8b23", referenced from:
                std::error::Error::cause::h2f250d8cccd02786 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.5amrgwv35f7hx3la.rcgu.o)
                l___unnamed_1 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.5amrgwv35f7hx3la.rcgu.o)
            "core::fmt::ArgumentV1::new::h9fc8575f3adc46ee", referenced from:
                _$LT$reign_router..middleware..request_logger..RequestLogger$u20$as$u20$reign_router..middleware..Middleware$GT$::handle::_$u7b$$u7b$closure$u7d$$u7d$::h8dfb647ef6c9bac8 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42vj86vl6ansl68g.rcgu.o)
            "alloc::boxed::Box$LT$T$GT$::into_raw::h859734651312690c", referenced from:
                alloc::boxed::Box$LT$dyn$u20$core..any..Any$GT$::downcast::h5f6905840c94a2a0 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42t16f2bespk2lfq.rcgu.o)
                alloc::boxed::Box$LT$dyn$u20$core..any..Any$GT$::downcast::h93f81359929622e6 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42t16f2bespk2lfq.rcgu.o)
            "hyper::body::body::Body::new::h4c7f775f0278f351", referenced from:
                hyper::body::body::Body::empty::h07263ce6279607da in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.3mhjwjgb8grwjt7p.rcgu.o)
                _$LT$hyper..body..body..Body$u20$as$u20$core..convert..From$LT$bytes..bytes..Bytes$GT$$GT$::from::h2cad0a5109c83305 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.3mhjwjgb8grwjt7p.rcgu.o)
            "hashbrown::raw::RawTable$LT$T$GT$::iter_hash::h49fdcfaf79c5f71b", referenced from:
                hashbrown::raw::RawTable$LT$T$GT$::find::hd1e3a442f5e40e18 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
            "_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$::into_iter::h469ee3732c527a17", referenced from:
                hashbrown::raw::RawTable$LT$T$GT$::find::hd1e3a442f5e40e18 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
            "_$LT$hashbrown..raw..RawIterHash$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hed8a24405e6aa1fa", referenced from:
                hashbrown::raw::RawTable$LT$T$GT$::find::hd1e3a442f5e40e18 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
            "hashbrown::raw::RawTable$LT$T$GT$::probe_seq::hae72148ef85a7578", referenced from:
                hashbrown::raw::RawTable$LT$T$GT$::rehash_in_place::_$u7b$$u7b$closure$u7d$$u7d$::ha2a8073c3e7e9133 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::find_insert_slot::hddf4d3daa28db146 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
            "std::error::Error::backtrace::h3f77128d146dc45f", referenced from:
                l___unnamed_1 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.55oloxoum5ui8xkd.rcgu.o)
            "core::fmt::ArgumentV1::new::hb69fe40837e6895a", referenced from:
                _$LT$reign_router..middleware..request_logger..RequestLogger$u20$as$u20$reign_router..middleware..Middleware$GT$::handle::_$u7b$$u7b$closure$u7d$$u7d$::h8dfb647ef6c9bac8 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42vj86vl6ansl68g.rcgu.o)
            "hashbrown::raw::Bucket$LT$T$GT$::as_ref::hd628bb8bd6195454", referenced from:
                hashbrown::raw::RawTable$LT$T$GT$::rehash_in_place::h0fc8bf1ac134bdc4 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::find::hd1e3a442f5e40e18 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::resize::hf4656e8405b8f938 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
            "hashbrown::raw::RawTable$LT$T$GT$::set_ctrl::hc5fd0456c030b3f4", referenced from:
                hashbrown::raw::RawTable$LT$T$GT$::rehash_in_place::h0fc8bf1ac134bdc4 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::rehash_in_place::_$u7b$$u7b$closure$u7d$$u7d$::h16c705b8ae3e1c7d in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::insert::h3a7489720cfab29a in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::resize::hf4656e8405b8f938 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
            "core::option::Option$LT$T$GT$::unwrap::ha468bd9cd073afb1", referenced from:
                reign_view::parse::element::Element::templates::h13b851f263c5b32d in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1s2kwwaz121gdyym.rcgu.o)
                reign_view::parse::parse_stream::ParseStream::is_match::h2cb1df546a644d96 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
                reign_view::parse::parse_stream::ParseStream::matched::hca2cb8ce42a031f3 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
                reign_view::parse::parse_stream::ParseStream::capture::h86240493e9c59515 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
                reign_view::parse::parse_stream::ParseStream::peek::h37491672783aa7c9 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
                reign_view::parse::parse_stream::ParseStream::step::h01acd5c99db4f888 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
                reign_view::parse::parse_stream::ParseStream::seek::h7f8b373c9de9a860 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
                ...
            "hashbrown::raw::RawTable$LT$T$GT$::bucket::h7e1ad3441b498a42", referenced from:
                hashbrown::raw::RawTable$LT$T$GT$::rehash_in_place::h0fc8bf1ac134bdc4 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::rehash_in_place::_$u7b$$u7b$closure$u7d$$u7d$::h16c705b8ae3e1c7d in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::insert::h3a7489720cfab29a in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::resize::hf4656e8405b8f938 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
            "core::result::Result$LT$T$C$E$GT$::ok::he7af6d761dd063f2", referenced from:
                _$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$::into_iter::h2839a0a1f0a844e8 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.2f4szj9jgt57jgpl.rcgu.o)
            "core::ptr::drop_in_place::he69c5d6c09aeb852", referenced from:
                _$LT$reign_router..middleware..runtime..Runtime$u20$as$u20$reign_router..middleware..Middleware$GT$::handle::_$u7b$$u7b$closure$u7d$$u7d$::h1ab025fa7056e0f4 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.2cgnh172aywdqey4.rcgu.o)
                _$LT$reign_router..middleware..headers_default..HeadersDefault$u20$as$u20$reign_router..middleware..Middleware$GT$::handle::_$u7b$$u7b$closure$u7d$$u7d$::h730039649b5d255b in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.3t0bq1auf9dubu7z.rcgu.o)
                _$LT$reign_router..middleware..request_logger..RequestLogger$u20$as$u20$reign_router..middleware..Middleware$GT$::handle::_$u7b$$u7b$closure$u7d$$u7d$::h8dfb647ef6c9bac8 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42vj86vl6ansl68g.rcgu.o)
            "_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$::fmt::hf48dc578980c76c5", referenced from:
                _$LT$reign_router..middleware..request_logger..RequestLogger$u20$as$u20$reign_router..middleware..Middleware$GT$::handle::_$u7b$$u7b$closure$u7d$$u7d$::h8dfb647ef6c9bac8 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42vj86vl6ansl68g.rcgu.o)
            "_$LT$core..hash..BuildHasherDefault$LT$H$GT$$u20$as$u20$core..hash..BuildHasher$GT$::build_hasher::h06b615b4c52fef74", referenced from:
                hashbrown::map::make_hash::h8ebe6336b8145448 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.2fzzfowhjj5sgpoe.rcgu.o)
            "core::ptr::drop_in_place::h6c0db20210e6e31d", referenced from:
                core::ptr::drop_in_place::h87822ae9181801ba in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.1ctjngrsmj1kzzgy.rcgu.o)
                core::ptr::drop_in_place::he15071d0969c95c4 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.1ctjngrsmj1kzzgy.rcgu.o)
                alloc::boxed::Box$LT$dyn$u20$core..any..Any$GT$::downcast::h5f6905840c94a2a0 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42t16f2bespk2lfq.rcgu.o)
                alloc::boxed::Box$LT$dyn$u20$core..any..Any$GT$::downcast::h93f81359929622e6 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42t16f2bespk2lfq.rcgu.o)
            "core::result::Result$LT$T$C$E$GT$::expect::haf3e15917b07a234", referenced from:
                _$LT$reign_router..middleware..runtime..Runtime$u20$as$u20$reign_router..middleware..Middleware$GT$::handle::_$u7b$$u7b$closure$u7d$$u7d$::h1ab025fa7056e0f4 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.2cgnh172aywdqey4.rcgu.o)
            "core::intrinsics::copy_nonoverlapping::hf63019d9b9b9a8f3", referenced from:
                core::ptr::swap_nonoverlapping_one::h19b6e91307d7a7b8 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.23zgdgvb5b4lih3i.rcgu.o)
                core::ptr::mut_ptr::_$LT$impl$u20$$BP$mut$u20$T$GT$::copy_from_nonoverlapping::hf0804026f2c22e4a in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.463nqrsrtws0pbrl.rcgu.o)
            "_$LT$core..any..TypeId$u20$as$u20$core..hash..Hash$GT$::hash::he6c70107c95977be", referenced from:
                hashbrown::map::make_hash::h8ebe6336b8145448 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.2fzzfowhjj5sgpoe.rcgu.o)
            "core::ptr::drop_in_place::h38a0eb573ce9b362", referenced from:
                core::ptr::drop_in_place::h690400da4741c521 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.1ctjngrsmj1kzzgy.rcgu.o)
                core::ptr::drop_in_place::h84067a4d5479ad95 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.1ctjngrsmj1kzzgy.rcgu.o)
                core::ptr::drop_in_place::hfcd779556fda7c85 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.1ctjngrsmj1kzzgy.rcgu.o)
                reign_router::request::Request::new::h94383e7322582aaf in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.496yn7950l8shig6.rcgu.o)
                http::extensions::Extensions::insert::h7969aef3d7e30c0d in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.4e6ss50k4rhojbbj.rcgu.o)
                l___unnamed_1 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.4e6ss50k4rhojbbj.rcgu.o)
            "std::error::Error::type_id::hd3148b0e443e53c5", referenced from:
                l___unnamed_1 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.55oloxoum5ui8xkd.rcgu.o)
            "core::ptr::drop_in_place::h74329ef32ce2fcb5", referenced from:
                core::ptr::drop_in_place::hd9628a11feb20368 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.1ctjngrsmj1kzzgy.rcgu.o)
                l___unnamed_1 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.5amrgwv35f7hx3la.rcgu.o)
            "core::result::Result$LT$T$C$E$GT$::unwrap::hd3b03cfbd5d53f46", referenced from:
                reign_router::middleware::headers_default::HeadersDefault::add::h2de83361f50f8623 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.40lataypc9idjfkx.rcgu.o)
                reign_router::middleware::runtime::Runtime::new::h52a5ed6e3beb4bc4 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.o9sad98n7of9nrr.rcgu.o)
            "core::ptr::read::h962ddb2c0288ac57", referenced from:
                core::ptr::swap_nonoverlapping_one::h19b6e91307d7a7b8 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.23zgdgvb5b4lih3i.rcgu.o)
            "core::option::Option$LT$T$GT$::is_none::hcae7d928db6cea39", referenced from:
                reign_view::parse::parse_stream::ParseStream::matched::hca2cb8ce42a031f3 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
                reign_view::parse::parse_stream::ParseStream::peek::h37491672783aa7c9 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
                reign_view::parse::parse_stream::ParseStream::step::h01acd5c99db4f888 in libreign_view-117d62ee09a93ac2.rlib(reign_view-117d62ee09a93ac2.1xh1qp8oc5mxtd8m.rcgu.o)
            "core::result::Result$LT$T$C$E$GT$::unwrap::hf527ee943d662fc7", referenced from:
                _$LT$reign_router..middleware..request_logger..RequestLogger$u20$as$u20$reign_router..middleware..Middleware$GT$::handle::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hb00fca8a5ef851ca in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.42vj86vl6ansl68g.rcgu.o)
            "hashbrown::raw::RawTable$LT$T$GT$::ctrl::h5a67ec3a43330e8f", referenced from:
                hashbrown::raw::RawTable$LT$T$GT$::rehash_in_place::h0fc8bf1ac134bdc4 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::rehash_in_place::_$u7b$$u7b$closure$u7d$$u7d$::h16c705b8ae3e1c7d in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::find_insert_slot::hddf4d3daa28db146 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::fallible_with_capacity::hb6ad9060c4c76a4e in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
                hashbrown::raw::RawTable$LT$T$GT$::insert::h3a7489720cfab29a in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.38qv3ymis72or18l.rcgu.o)
            "_$LT$hyper..error..Error$u20$as$u20$core..fmt..Display$GT$::fmt::hf585ab3f9a9847c0", referenced from:
                _$LT$reign_router..error..Error$u20$as$u20$core..fmt..Display$GT$::fmt::h947a7190649fbae6 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.23gkjfqw1fonl4y9.rcgu.o)
                l___unnamed_1 in libreign_router-db5bba656ac6aafe.rlib(reign_router-db5bba656ac6aafe.5amrgwv35f7hx3la.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)