Delete JIT_PATH host key/value pair (#35359)
authorJan Kotas <jkotas@microsoft.com>
Fri, 24 Apr 2020 04:03:08 +0000 (21:03 -0700)
committerGitHub <noreply@github.com>
Fri, 24 Apr 2020 04:03:08 +0000 (21:03 -0700)
This was originally introduced to deal with the JIT being in a separate NuGet package. No longer the case for a years.

src/coreclr/src/dlls/mscoree/unixinterface.cpp
src/coreclr/src/vm/codeman.cpp
src/installer/corehost/cli/hostmisc/pal.h
src/installer/corehost/cli/hostpolicy/coreclr.cpp
src/installer/corehost/cli/hostpolicy/coreclr.h
src/installer/corehost/cli/hostpolicy/deps_resolver.cpp
src/installer/corehost/cli/hostpolicy/deps_resolver.h
src/installer/corehost/cli/hostpolicy/hostpolicy_context.cpp
src/installer/test/HostActivation.Tests/SharedFxLookup.cs

index 35d7c56..f54e7c7 100644 (file)
@@ -130,11 +130,6 @@ static void ConvertConfigPropertiesToUnicode(
     *propertyValuesWRef = propertyValuesW;
 }
 
-#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-// Reference to the global holding the path to the JIT
-extern LPCWSTR g_CLRJITPath;
-#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-
 #ifdef FEATURE_GDBJIT
 GetInfoForMethodDelegate getInfoForMethodDelegate = NULL;
 extern "C" int coreclr_create_delegate(void*, unsigned int, const char*, const char*, const char*, void**);
@@ -198,11 +193,6 @@ int coreclr_initialize(
     // This will take ownership of propertyKeysWTemp and propertyValuesWTemp
     Configuration::InitializeConfigurationKnobs(propertyCount, propertyKeysW, propertyValuesW);
 
-#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-    // Fetch the path to JIT binary, if specified
-    g_CLRJITPath = Configuration::GetKnobStringValue(W("JIT_PATH"));
-#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-
     STARTUP_FLAGS startupFlags;
     InitializeStartupFlags(&startupFlags);
 
index 863b54a..b13ccd1 100644 (file)
@@ -1541,14 +1541,6 @@ struct JIT_LOAD_DATA
 // Here's the global data for JIT load and initialization state.
 JIT_LOAD_DATA g_JitLoadData;
 
-#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-
-// Global that holds the path to custom JIT location
-LPCWSTR g_CLRJITPath = nullptr;
-
-#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-
-
 // LoadAndInitializeJIT: load the JIT dll into the process, and initialize it (call the UtilCode initialization function,
 // check the JIT-EE interface GUID, etc.)
 //
@@ -1587,21 +1579,6 @@ static void LoadAndInitializeJIT(LPCWSTR pwzJitName, OUT HINSTANCE* phJit, OUT I
     extern HINSTANCE g_hThisInst;
     bool havePath = false;
 
-#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
-    if (g_CLRJITPath != nullptr)
-    {
-        // If we have been asked to load a specific JIT binary, load from that path.
-        // The main JIT load will use exactly that name because pwzJitName will have
-        // been computed as the last component of g_CLRJITPath by ExecutionManager::GetJitName().
-        // Non-primary JIT names (such as compatjit or altjit) will be loaded from the
-        // same directory.
-        // (Ideally, g_CLRJITPath would just be the JIT path without the filename component,
-        // but that's not how the JIT_PATH variable was originally defined.)
-        CoreClrFolderHolder.Set(g_CLRJITPath);
-        havePath = true;
-    }
-    else
-#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
     if (WszGetModuleFileName(g_hThisInst, CoreClrFolderHolder))
     {
         // Load JIT from next to CoreCLR binary
@@ -4381,8 +4358,6 @@ BOOL ExecutionManager::IsReadyToRunCode(PCODE currentPC)
     return FALSE;
 }
 
-#ifndef DACCESS_COMPILE
-
 #ifndef FEATURE_MERGE_JIT_AND_ENGINE
 /*********************************************************************/
 // This static method returns the name of the jit dll
@@ -4391,34 +4366,10 @@ LPCWSTR ExecutionManager::GetJitName()
 {
     STANDARD_VM_CONTRACT;
 
-    LPCWSTR  pwzJitName = NULL;
-
-#if !defined(CROSSGEN_COMPILE)
-    if (g_CLRJITPath != nullptr)
-    {
-        const WCHAR* p = wcsrchr(g_CLRJITPath, DIRECTORY_SEPARATOR_CHAR_W);
-        if (p != nullptr)
-        {
-            pwzJitName = p + 1; // Return just the filename, not the directory name
-        }
-        else
-        {
-            pwzJitName = g_CLRJITPath;
-        }
-    }
-#endif // !defined(CROSSGEN_COMPILE)
-
-    if (NULL == pwzJitName)
-    {
-        pwzJitName = MAKEDLLNAME_W(W("clrjit"));
-    }
-
-    return pwzJitName;
+    return MAKEDLLNAME_W(W("clrjit"));
 }
 #endif // !FEATURE_MERGE_JIT_AND_ENGINE
 
-#endif // #ifndef DACCESS_COMPILE
-
 RangeSection* ExecutionManager::GetRangeSection(TADDR addr)
 {
     CONTRACTL {
index 10cb0e2..3b03e74 100644 (file)
@@ -79,8 +79,6 @@
 #define FALLBACK_HOST_RID _X("linux")
 #endif
 
-#define LIBCLRJIT_NAME MAKE_LIBNAME("clrjit")
-
 #define LIBCORECLR_FILENAME (LIB_PREFIX _X("coreclr"))
 #define LIBCORECLR_NAME MAKE_LIBNAME("coreclr")
 
index b329a72..4acca6a 100644 (file)
@@ -200,7 +200,6 @@ namespace
         _X("FX_DEPS_FILE"),
         _X("PROBING_DIRECTORIES"),
         _X("FX_PRODUCT_VERSION"),
-        _X("JIT_PATH"),
         _X("STARTUP_HOOKS"),
         _X("APP_PATHS"),
         _X("APP_NI_PATHS"),
index a06e81f..72a4859 100644 (file)
@@ -63,7 +63,6 @@ enum class common_property
     FxDepsFile,
     ProbingDirectories,
     FxProductVersion,
-    JitPath,
     StartUpHooks,
     AppPaths,
     AppNIPaths,
index 06ededa..5d863a4 100644 (file)
@@ -593,11 +593,6 @@ void deps_resolver_t::init_known_entry_path(const deps_entry_t& entry, const pal
         m_coreclr_library_version = entry.library_version;
         return;
     }
-    if (m_clrjit_path.empty() && ends_with(path, DIR_SEPARATOR + pal::string_t(LIBCLRJIT_NAME), false))
-    {
-        m_clrjit_path = path;
-        return;
-    }
 }
 
 void deps_resolver_t::resolve_additional_deps(const arguments_t& args, const deps_json_t::rid_fallback_graph_t& rid_fallback_graph)
@@ -826,7 +821,6 @@ bool deps_resolver_t::resolve_probe_dirs(
         add_unique_path(asset_type, m_app_dir, &items, output, &non_serviced, core_servicing);
 
         (void) library_exists_in_dir(m_app_dir, LIBCORECLR_NAME, &m_coreclr_path);
-        (void) library_exists_in_dir(m_app_dir, LIBCLRJIT_NAME, &m_clrjit_path);
     }
 
     // Handle any additional deps.json that were specified.
@@ -892,7 +886,6 @@ bool deps_resolver_t::resolve_probe_paths(probe_paths_t* probe_paths, std::unord
 
     // If we found coreclr and the jit during native path probe, set the paths now.
     probe_paths->coreclr = m_coreclr_path;
-    probe_paths->clrjit = m_clrjit_path;
 
     return true;
 }
index f2b27d4..c3387fb 100644 (file)
@@ -23,7 +23,6 @@ struct probe_paths_t
     pal::string_t native;
     pal::string_t resources;
     pal::string_t coreclr;
-    pal::string_t clrjit;
 };
 
 struct deps_resolved_asset_t
@@ -259,9 +258,6 @@ private:
     // Special entry for coreclr library version
     pal::string_t m_coreclr_library_version;
 
-    // Special entry for JIT path
-    pal::string_t m_clrjit_path;
-
     // The filepaths for the app custom deps
     std::vector<pal::string_t> m_additional_deps_files;
 
index bb4a965..0ee7bf9 100644 (file)
@@ -86,21 +86,6 @@ int hostpolicy_context_t::initialize(hostpolicy_init_t &hostpolicy_init, const a
 
     probe_paths.tpa.append(corelib_path);
 
-    pal::string_t clrjit_path = probe_paths.clrjit;
-    if (clrjit_path.empty())
-    {
-        trace::warning(_X("Could not resolve CLRJit path"));
-    }
-    else if (pal::realpath(&clrjit_path))
-    {
-        trace::verbose(_X("The resolved JIT path is '%s'"), clrjit_path.c_str());
-    }
-    else
-    {
-        clrjit_path.clear();
-        trace::warning(_X("Could not resolve symlink to CLRJit path '%s'"), probe_paths.clrjit.c_str());
-    }
-
     const fx_definition_vector_t &fx_definitions = resolver.get_fx_definitions();
 
     pal::string_t fx_deps_str;
@@ -147,9 +132,6 @@ int hostpolicy_context_t::initialize(hostpolicy_init_t &hostpolicy_init, const a
     coreclr_properties.add(common_property::FxProductVersion, clr_library_version.c_str());
     coreclr_properties.add(common_property::RuntimeIdentifier, get_current_runtime_id(true /*use_fallback*/).c_str());
 
-    if (!clrjit_path.empty())
-        coreclr_properties.add(common_property::JitPath, clrjit_path.c_str());
-
     bool set_app_paths = false;
 
     // Runtime options config properties.
index e7cd16d..0139077 100644 (file)
@@ -189,13 +189,6 @@ namespace Microsoft.DotNet.CoreSetup.Test.HostActivation
             coreClrProperty.Parent.Add(newCoreClrProperty);
             coreClrProperty.Remove();
 
-            // Change the clrjit.dll asset to specify only "clrjit.dll" as the relative path (no directories).
-            string clrJitLibraryName = RuntimeInformationExtensions.GetSharedLibraryFileNameForCurrentPlatform("clrjit");
-            JProperty clrJitProperty = netCoreAppNativeAssets.First(p => p.Name.Contains(clrJitLibraryName));
-            JProperty newClrJitProperty = new JProperty(clrJitProperty.Name.Substring(clrJitProperty.Name.LastIndexOf('/') + 1), clrJitProperty.Value);
-            clrJitProperty.Parent.Add(newClrJitProperty);
-            clrJitProperty.Remove();
-
             File.WriteAllText(sharedFxDepsJsonPath, root.ToString());
 
             dotnet.Exec(appDll)
@@ -205,8 +198,7 @@ namespace Microsoft.DotNet.CoreSetup.Test.HostActivation
                 .CaptureStdErr()
                 .Execute()
                 .Should().Pass()
-                .And.HaveStdErrContaining($"CoreCLR path = '{Path.Combine(sharedFxPath, coreClrLibraryName)}'")
-                .And.HaveStdErrContaining($"The resolved JIT path is '{Path.Combine(sharedFxPath, clrJitLibraryName)}'");
+                .And.HaveStdErrContaining($"CoreCLR path = '{Path.Combine(sharedFxPath, coreClrLibraryName)}'");
         }
     }
 }