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

[release/8.0-rc1] [mono] Add a --path command line argument as an alternative to MONO_P… #90678

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/mono/mono/mini/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,7 @@ mini_usage (void)
#endif
" --handlers Install custom handlers, use --help-handlers for details.\n"
" --aot-path=PATH List of additional directories to search for AOT images.\n"
" --path=DIR Add DIR to the list of directories to search for assemblies.\n"
);

g_print ("\nOptions:\n");
Expand Down Expand Up @@ -2069,6 +2070,7 @@ mono_main (int argc, char* argv[])
char *aot_options = NULL;
GPtrArray *agents = NULL;
char *extra_bindings_config_file = NULL;
GList *paths = NULL;
#ifdef MONO_JIT_INFO_TABLE_TEST
int test_jit_info_table = FALSE;
#endif
Expand Down Expand Up @@ -2294,6 +2296,8 @@ mono_main (int argc, char* argv[])
g_free (tmp);
split++;
}
} else if (strncmp (argv [i], "--path=", 7) == 0) {
paths = g_list_append (paths, argv [i] + 7);
} else if (strncmp (argv [i], "--compile-all=", 14) == 0) {
action = DO_COMPILE;
recompilation_times = atoi (argv [i] + 14);
Expand Down Expand Up @@ -2503,6 +2507,16 @@ mono_main (int argc, char* argv[])
if (g_hasenv ("MONO_XDEBUG"))
enable_debugging = TRUE;

if (paths) {
char **p = g_new0 (char *, g_list_length (paths) + 1);
int pindex = 0;
for (GList *l = paths; l; l = l->next)
p [pindex ++] = (char*)l->data;
g_list_free (paths);

mono_set_assemblies_path_direct (p);
}

#ifdef MONO_CROSS_COMPILE
if (!mono_compile_aot) {
fprintf (stderr, "This mono runtime is compiled for cross-compiling. Only the --aot option is supported.\n");
Expand Down
Loading