public static Result GetPathToRuntimePack()

in src/dotnet/ReSharperPlugin.DotNetDisassembler/JitDisasm/JitPathUtils.cs [9:36]


    public static Result<string> GetPathToRuntimePack(string pathToLocalCoreClr, string arch)
    {
        var result = GetPathToCoreClrChecked(pathToLocalCoreClr, arch);
        if (!result.Succeed)
            return Result.Fail(result.FailMessage);

        string runtimePacksPath = Path.Combine(pathToLocalCoreClr, @"artifacts\bin\runtime");
        string runtimePackPath = null;
        if (Directory.Exists(runtimePacksPath))
        {
            var packs = Directory.GetDirectories(runtimePacksPath, "*-windows-Release-" + arch);
            runtimePackPath = packs.OrderByDescending(i => i).FirstOrDefault();
        }

        if (!Directory.Exists(runtimePackPath))
        {
            var msg =
                $"""
                 Please, build a runtime-pack in your local repo:

                 Run 'build.cmd Clr+Clr.Aot+Libs -c Release -a {arch}' in the repo root
                 Don't worry, you won't have to re-build it every time you change something in jit, vm or corelib.
                 """;
            return Result.Fail(msg);
        }

        return Result.Success(runtimePackPath);
    }