Skip to content

Commit

Permalink
[Single-exe] A few small updates
Browse files Browse the repository at this point in the history
Make a few small improvements to the single-file bundle handling code.
Implements changes suggested by @janvorli in dotnet#26504
  • Loading branch information
swaroop-sridhar committed Sep 17, 2019
1 parent 81c08e8 commit 6a4bf97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/binder/assemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ namespace BINDER_SPACE
_ASSERTE(ppSystemAssembly != NULL);

ReleaseHolder<Assembly> pSystemAssembly;
StackSString sCoreLib;

// For normal runs, corelib is expected to be found in systemDirectory.
// For self-contained single-file bundles, corelib is expected within the bundle
Expand All @@ -657,7 +656,7 @@ namespace BINDER_SPACE
sCoreLibDir.Append(DIRECTORY_SEPARATOR_CHAR_W);
}

sCoreLib = sCoreLibDir;
StackSString sCoreLib(sCoreLibDir);
sCoreLib.Append(CoreLibName_IL_W);

// At run-time, System.Private.CoreLib.dll is expected to be the NI image.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/hosts/unixcorebundle/bundle/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool runner_t::probe(const char *relative_path, int64_t *size, int64_t *offset)
{
for (file_entry_t& entry : m_manifest.files)
{
if (strcmp(entry.relative_path().c_str(), relative_path) == 0)
if(entry.relative_path() == relative_path)
{
*size = entry.size();
*offset = entry.offset();
Expand Down
5 changes: 4 additions & 1 deletion src/dlls/mscoree/unixinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ static void ConvertConfigPropertiesToUnicode(
// If this application is a single-file bundle, the bundle-probe callback
// is passed in as the value of "BUNDLE_PROBE" property (masquarading as char *).
// Therefore obtain the value; don't convert it to Unicode.
//
// This method of communicating "BUNDLE_PROBE" as a string is a temporary hack.
// Please see https://github.com/dotnet/coreclr/issues/26752 about
// designing a better corehost-coreclr interface.

*bundleProbe = (BundleProbe *)propertyValues[propertyIndex];
propertyKeysW[propertyIndex] = W("BUNDLE_PROBE");
Expand Down Expand Up @@ -175,7 +179,6 @@ extern "C" int coreclr_create_delegate(void*, unsigned int, const char*, const c
// Returns:
// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed
//

extern "C"
DLLEXPORT
int coreclr_initialize(
Expand Down

0 comments on commit 6a4bf97

Please sign in to comment.