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

88 auto install embedded bundles from executable #109

Merged

Conversation

karthikreddy09
Copy link
Member

Install all embedded bundles in the executable binary at framework startup.

Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
Deleted usBundleUtils.h public header

Signed-off-by: The Mathworks Inc, < Roy.Lurie@mathworks.com>

Removed public header usBundleUtils.h

Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >

Fixup platform specific code in BundleUtils & test failure fixes on linux.

Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >

Fixes for Mac static builds and windows shared builds.

Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com>

Auto-install initial changes (works on Mac OS X for shared libs)

Signed-off-by: The Mathworks Inc, < Roy.Lurie@mathworks.com >

Remove symbol lookup for GetBundleContext inline method

Signed-off-by: The Mathworks Inc. <Roy.Lurie@mathworks.com>
Fixed a wrong commit. 

Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
}

void* GetSymbol_impl(const std::string& bundleName, const std::string& libLocation, const char* symbol)
std::string GetExecutablePath()
Copy link
Member Author

Choose a reason for hiding this comment

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

Using dlsym to find "main" symbol in the handle returned by dlopen(0, RTLD_LAZY) does not work.
see http://coliru.stacked-crooked.com/a/fd8dd59f2c6c8baa

Copy link
Member

Choose a reason for hiding this comment

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

That is because the executable is not linked with -rdynamic, as mentioned in #90 (comment). See also http://coliru.stacked-crooked.com/a/e68dcb2883c24514. I am okay with the current implementation though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I should have read your comment carefully. Clearly, I had my blinders on.

Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
@@ -138,6 +138,11 @@ void Bundle::Stop(uint32_t options)

void Bundle::Uninstall()
{
if (!IsSharedLibrary(GetLocation()))
{
throw std::runtime_error("Bundles embedded in the executable are not uninstallable");
Copy link
Member

Choose a reason for hiding this comment

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

The "not uninstallable" part sounds awkward to me. What do you think about something like

Bundles embedded in an executable cannot be uninstalled.

?

@saschazelzer
Copy link
Member

This looks good to me for merging, after the comments have been resolved.

saschazelzer and others added 2 commits July 29, 2016 09:56
Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
@saschazelzer
Copy link
Member

Great work. Just to be clear: +1 for merging (the US_DEBUG conflicts could be resolved in the merge commit).

@karthikreddy09
Copy link
Member Author

Working on it … :-)
I rebased auto-install onto development and encountered test failures in static builds. Investigating the failures.

-Abhinay.

From: Sascha Zelzer notifications@github.com
Reply-To: CppMicroServices/CppMicroServices reply@reply.github.com
Date: Friday, July 29, 2016 at 1:38 PM
To: CppMicroServices/CppMicroServices CppMicroServices@noreply.github.com
Cc: Abhinay Reddyreddy karthikreddy09@icloud.com, Author author@noreply.github.com
Subject: Re: [CppMicroServices/CppMicroServices] 88 auto install embedded bundles from executable (#109)

Great work. Just to be clear: +1 for merging (the US_DEBUG conflicts could be resolved in the merge commit).


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Conflicts:
	core/include/usBundleUtils.h
	core/src/bundle/usBundleUtils.cpp
	core/test/usFrameworkTest.cpp
Signed-off-by: The Mathworks Inc < Roy.Lurie@mathworks.com >
Signed-off-by: The Mathworks Inc < Roy.Lurie@mathworks.com >
// Private util function to return system bundle's log sink
std::shared_ptr<LogSink> GetFrameworkLogSink()
{
auto sink = GetBundleContext().GetLogSink();
Copy link
Member

Choose a reason for hiding this comment

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

could be simplified to return GetBundleContext().GetLogSink();

Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
Signed-off-by: The Mathworks Inc < Roy.Lurie@mathworks.com >
@jeffdiclemente
Copy link
Member

This looks good to merge.
Can you please include a change to usBundleEvent.cpp line 108 from

  case BundleEvent::BUNDLE_STOPPED:         return os << "BUNDLE_STOPPED"; 

to

  case BundleEvent::BUNDLE_STOPPED:         return os << "STOPPED"; 

This is a trivial issue which was missed in a previous PR. Thanks.

Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
@karthikreddy09 karthikreddy09 merged commit 1cd2e24 into development Aug 1, 2016
@jeffdiclemente jeffdiclemente deleted the 88-auto-install-embedded-bundles-from-executable branch August 2, 2016 11:11
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

3 participants