-
Notifications
You must be signed in to change notification settings - Fork 256
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
88 auto install embedded bundles from executable #109
Conversation
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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
?
This looks good to me for merging, after the comments have been resolved. |
Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
Great work. Just to be clear: +1 for merging (the US_DEBUG conflicts could be resolved in the merge commit). |
Working on it … :-) -Abhinay. From: Sascha Zelzer notifications@github.com Great work. Just to be clear: +1 for merging (the US_DEBUG conflicts could be resolved in the merge commit). — |
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(); |
There was a problem hiding this comment.
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 >
This looks good to merge.
to
This is a trivial issue which was missed in a previous PR. Thanks. |
Signed-off-by: The Mathworks Inc. < Roy.Lurie@mathworks.com >
Install all embedded bundles in the executable binary at framework startup.