From 28d28618e9472dd9ddfec206da099c158f30a8fb Mon Sep 17 00:00:00 2001
From: Graham Nelson
- Supervisor::go_operational(); + Supervisor::go_operational(); InbuildReport::install(to_install, confirmed, path_to_inbuild);
- Supervisor::go_operational(); + Supervisor::go_operational(); int use = SHELL_METHODOLOGY; if (dry_run_mode) use = DRY_RUN_METHODOLOGY; build_methodology *BM; @@ -286,7 +289,7 @@ following is run, Preform is ready for use.int Main::load_preform(inform_language *L) { - if (Supervisor::dash_internal_was_used()) { + if (Supervisor::dash_internal_was_used()) { filename *F = Filenames::in(Languages::path_to_bundle(L), I"Syntax.preform"); return LoadPreform::load(F, L); } else { @@ -347,7 +350,7 @@ the order in which filenames are read from a directory listing. Errors::with_text("requirement malformed: %S", errors); } else { linked_list *L = NEW_LINKED_LIST(inbuild_search_result); - Nests::search_for(req, Supervisor::shared_nest_list(), L); + Nests::search_for(req, Supervisor::shared_nest_list(), L); inbuild_search_result *R; LOOP_OVER_LINKED_LIST(R, inbuild_search_result, L) Main::add_target(R->copy); @@ -448,6 +451,8 @@ other options to the selection defined here. enum RESULTS_CLSW enum INSTALL_CLSW enum CONFIRMED_CLSW +enum VERBOSE_CLSW +enum VERBOSITY_CLSWRead the command line2.9 =
@@ -516,7 +521,11 @@ other options to the selection defined here. L"write HTML report file to X (for use within Inform GUI apps)"); CommandLine::declare_boolean_switch(CONFIRMED_CLSW, L"confirmed", 1, L"confirm installation in the Inform GUI apps", TRUE); - Supervisor::declare_options(); + CommandLine::declare_boolean_switch(VERBOSE_CLSW, L"verbose", 1, + L"equivalent to -verbosity=1", FALSE); + CommandLine::declare_numerical_switch(VERBOSITY_CLSW, L"verbosity", 1, + L"how much explanation to print: lowest is 0 (default), highest is 3"); + Supervisor::declare_options(); CommandLine::read(argc, argv, NULL, &Main::option, &Main::bareword); @@ -585,8 +594,10 @@ other options to the selection defined here. case INSTALL_CLSW: to_install = Main::file_or_path_to_copy(arg, TRUE); break; case RESULTS_CLSW: InbuildReport::set_filename(Filenames::from_text(arg)); break; case CONFIRMED_CLSW: confirmed = val; break; + case VERBOSE_CLSW: Supervisor::set_verbosity(1); break; + case VERBOSITY_CLSW: Supervisor::set_verbosity(val); break; } - Supervisor::option(id, val, arg, state); + Supervisor::option(id, val, arg, state); }
§4. This is called for a command-line argument which doesn't appear as diff --git a/docs/inbuild/M-rc.html b/docs/inbuild/M-rc.html index 124678ab4..8693b37ac 100644 --- a/docs/inbuild/M-rc.html +++ b/docs/inbuild/M-rc.html @@ -89,6 +89,8 @@ and those not documented in this manual are covered in that one. -use-locate show file paths of all the extensions, kits and so on needed to use -use-missing show the extensions, kits and so on which are needed to use but missing -use-needs show all the extensions, kits and so on needed to use +-verbose equivalent to -verbosity=1 (default is -no-verbose) +-verbosity=N how much explanation to print: lowest is 0 (default), highest is 3 -verify-registry X verify roster.json metadata of registry in the directory X -no-versions-in-filenames don't append _v number to destination filenames on -copy-to or -sync-to (default is -versions-in-filenames) diff --git a/docs/supervisor-module/1-ic.html b/docs/supervisor-module/1-ic.html index 3142d57b1..b3b69a3ae 100644 --- a/docs/supervisor-module/1-ic.html +++ b/docs/supervisor-module/1-ic.html @@ -59,9 +59,30 @@ function togglePopup(material_id) {
Who shall supervise the supervisor? This section of code will.
-§1. Phases. The supervisor module provides services to the parent tool. +
§1. Verbosity. It is both a strength and a source of anxiety that build managers work in +an autonomous sort of way, doing "whatever is necessary". Some users want +silence while this happens, and others expect detailed explanations. +
+ ++int supervisor_verbosity = 0; +#define SVEXPLAIN(level, args...) { \ + if (supervisor_verbosity >= level) Writers::printf(STDOUT, args); \ +} ++ + +
+void Supervisor::set_verbosity(int level) { + if (level < 0) level = 0; + if (level > 3) level = 3; + supervisor_verbosity = level; + if (level > 0) WRITE_TO(STDOUT, "(Verbosity set to %d)\n", level); +} ++
§3. Phases. The supervisor module provides services to the parent tool.
This section defines how the parent communicates with us to get everything @@ -82,7 +103,7 @@ at which time the parent can freely use its facilities. enum GRAPH_CONSTRUCTION_INBUILD_PHASE enum OPERATIONAL_INBUILD_PHASE -
§2. We're going to use the following assertions to make sure we don't slip up. +
§4. We're going to use the following assertions to make sure we don't slip up. Some functions run only in some phases. Phases can be skipped, but not taken out of turn.
@@ -97,12 +118,27 @@ out of turn.int inbuild_phase = STARTUP_INBUILD_PHASE; -void Supervisor::enter_phase(int p) { - if (p <= inbuild_phase) internal_error("phases out of sequence"); +void Supervisor::enter_phase(int p) { + SVEXPLAIN(2, "(Supervisor phase %d: %S -> %d: %S)\n", + inbuild_phase, Supervisor::phase_name(inbuild_phase), p, Supervisor::phase_name(p)); inbuild_phase = p; } + +text_stream *Supervisor::phase_name(int p) { + switch (p) { + case STARTUP_INBUILD_PHASE: return I"startup"; + case CONFIGURATION_INBUILD_PHASE: return I"configuration"; + case PRETINKERING_INBUILD_PHASE: return I"pretinkering"; + case TINKERING_INBUILD_PHASE: return I"tinkering"; + case NESTED_INBUILD_PHASE: return I"nested"; + case TARGETED_INBUILD_PHASE: return I"targeted"; + case GRAPH_CONSTRUCTION_INBUILD_PHASE: return I"graphing"; + case OPERATIONAL_INBUILD_PHASE: return I"operational"; + } + return I"<unknown phase>"; +}-
§3. Startup phase. The following is called when the supervisor module starts up. +
§5. Startup phase. The following is called when the supervisor module starts up.
@@ -115,7 +151,7 @@ out of turn. inbuild_genre *project_file_genre = NULL; inbuild_genre *template_genre = NULL; -void Supervisor::start(void) { +void Supervisor::start(void) { ExtensionManager::start(); ExtensionBundleManager::start(); KitManager::start(); @@ -132,11 +168,11 @@ out of turn. ControlStructures::create_standard(); - inbuild_phase = CONFIGURATION_INBUILD_PHASE; - Supervisor::set_defaults(); + Supervisor::enter_phase(CONFIGURATION_INBUILD_PHASE); + Supervisor::set_defaults(); }-
§4. Configuration phase. Initially, then, we are in the configuration phase. When the parent defines +
§6. Configuration phase. Initially, then, we are in the configuration phase. When the parent defines
its command-line options, we expect it to call Supervisor::declare_options
so that we can define further options — this provides the large set of
common options found in both inform7 and inbuild, our two possible parents.
@@ -145,12 +181,12 @@ common options found in both
§4.1. These options all predate the 2015-20 reworking of the compiler, and their
+ §6.1. These options all predate the 2015-20 reworking of the compiler, and their
names are a series of historical accidents. -format in particular works in
a clunky sort of way and should perhaps be deprecated in favour of some
better way to choose a virtual machine to compile to.
@@ -168,7 +204,7 @@ better way to choose a virtual machine to compile to.
enum RNG_CLSW
enum CASE_CLSW
- §4.2. Declare Inform-related options4.2 =
+ §6.2. Declare Inform-related options6.2 =
§4.3. Again, except for -nest, these go back to the mid-2010s.
+ §6.3. Again, except for -nest, these go back to the mid-2010s.
§4.4. Declare resource-related options4.4 =
+ §6.4. Declare resource-related options6.4 =
§4.5. These are all new in 2020. They are not formally shared with the inter tool,
+ §6.5. These are all new in 2020. They are not formally shared with the inter tool,
but -pipeline-file and -variable have the same effect as they would there.
§4.6. Declare Inter-related options4.6 =
+ §6.6. Declare Inter-related options6.6 =
§5. Use of the above options will cause the following global variables to be
+ §7. Use of the above options will cause the following global variables to be
set appropriately.
§6. The pipeline name can be set not only here but also by inform7 much
+ §8. The pipeline name can be set not only here but also by inform7 much
later on (way past the configuration stage), if it reads a sentence like:
§7. The supervisor module itself doesn't parse command-line options: that's for
+ §9. The supervisor module itself doesn't parse command-line options: that's for
the parent to do, using code from Foundation. When the parent finds an option
it doesn't know about, that will be one of ours, so it should call the following:
§7.1. Note that the following has no effect unless the pipeline module is part
+ §9.1. Note that the following has no effect unless the pipeline module is part
of the parent. In practice, that will be true for inform7 but not inbuild.
Set a pipeline variable7.1 =
+ Set a pipeline variable9.1 =
§7.2. 16339 is a well-known prime number for use in 16-bit random number algorithms,
+ §9.2. 16339 is a well-known prime number for use in 16-bit random number algorithms,
such as the one used in the Z-machine VM. It works fine in 32-bit cases too.
Seed the random number generator7.2 =
+ Seed the random number generator9.2 =
§8. The Pretinkering, Tinkering, Nested and Projected phases. Once the tool has finished with the command line, it should call this
+ §10. The Pretinkering, Tinkering, Nested and Projected phases. Once the tool has finished with the command line, it should call this
function. Inbuild rapidly runs through the next few phases as it does so.
From the "nested" phase, the final list of nests in the search path for
finding kits, extensions and so on exists; from the "targeted" phase,
@@ -398,31 +435,31 @@ which continues until the parent calls void Supervisor::optioneering_complete(inbuild_copy *C, int compile_only,
int (*preform_callback)(inform_language *)) {
RUN_ONLY_IN_PHASE(CONFIGURATION_INBUILD_PHASE)
- inbuild_phase = PRETINKERING_INBUILD_PHASE;
+ Supervisor::enter_phase(PRETINKERING_INBUILD_PHASE);
shared_preform_callback = preform_callback;
- Find the virtual machine8.1;
- Supervisor::make_project_from_command_line(C);
+ Find the virtual machine10.1;
+ Supervisor::make_project_from_command_line(C);
- Supervisor::create_default_externals();
- inbuild_phase = TINKERING_INBUILD_PHASE;
- Supervisor::sort_nest_list();
+ Supervisor::create_default_externals();
+ Supervisor::enter_phase(TINKERING_INBUILD_PHASE);
+ Supervisor::sort_nest_list();
- inbuild_phase = NESTED_INBUILD_PHASE;
+ Supervisor::enter_phase(NESTED_INBUILD_PHASE);
inform_project *proj;
LOOP_OVER(proj, inform_project)
Projects::set_compilation_options(proj,
this_is_a_release_compile, compile_only, rng_seed_at_start_of_play);
- inbuild_phase = TARGETED_INBUILD_PHASE;
+ Supervisor::enter_phase(TARGETED_INBUILD_PHASE);
}
- §8.1. The VM to be used depends on the settings of all three of -format,
+ §10.1. The VM to be used depends on the settings of all three of -format,
-release and -debug, and those can be given in any order at the command
line, which is why we couldn't work this out earlier:
Find the virtual machine8.1 =
+ Find the virtual machine10.1 =
§10. The Graph Construction and Operational phases. inbuild is now in the Targeted phase, then, meaning that the parent has
+ §12. The Graph Construction and Operational phases. inbuild is now in the Targeted phase, then, meaning that the parent has
called Supervisor::optioneering_complete and has been making further
preparations of its own. (For example, it could attach further kit
dependencies to the shared project.) The parent has one further duty to
@@ -464,13 +502,13 @@ We do that copy by copy.
§11. The nest list. Nests are directories which hold resources to be used by the Intools, and
+ §13. The nest list. Nests are directories which hold resources to be used by the Intools, and
one of Inbuild's main roles is to search and manage nests. All nests can
hold extensions, kits, language definitions, and so on.
§12. Inform customarily has exactly one -internal and one -external nest,
+ §14. Inform customarily has exactly one -internal and one -external nest,
but in fact any number of each is allowed, including none. However, the
first to be declared are used by the compiler as "the" internal and external
nests, respectively.
@@ -508,22 +546,27 @@ nests, respectively.
inbuild_nest *shared_internal_nest = NULL;
inbuild_nest *shared_external_nest = NULL;
-inbuild_nest *Supervisor::add_nest(pathname *P, int tag) {
+inbuild_nest *Supervisor::add_nest(pathname *P, int tag) {
RUN_ONLY_BEFORE_PHASE(TINKERING_INBUILD_PHASE)
if (unsorted_nest_list == NULL)
unsorted_nest_list = NEW_LINKED_LIST(inbuild_nest);
inbuild_nest *N = Nests::new(P);
Nests::set_tag(N, tag);
+ int set_shared = FALSE;
ADD_TO_LINKED_LIST(N, inbuild_nest, unsorted_nest_list);
- if ((tag == EXTERNAL_NEST_TAG) && (shared_external_nest == NULL))
- shared_external_nest = N;
- if ((tag == INTERNAL_NEST_TAG) && (shared_internal_nest == NULL))
- shared_internal_nest = N;
+ if ((tag == EXTERNAL_NEST_TAG) && (shared_external_nest == NULL)) {
+ shared_external_nest = N; set_shared = TRUE;
+ }
+ if ((tag == INTERNAL_NEST_TAG) && (shared_internal_nest == NULL)) {
+ shared_internal_nest = N; set_shared = TRUE;
+ }
if (tag == INTERNAL_NEST_TAG) Nests::protect(N);
+ SVEXPLAIN(2, "(%S%S nest set at %p)\n",
+ (set_shared)?I"shared ":I"", Nests::tag_name(tag), P);
return N;
}
-void Supervisor::create_default_externals(void) {
+void Supervisor::create_default_externals(void) {
RUN_ONLY_BEFORE_PHASE(TINKERING_INBUILD_PHASE)
inbuild_nest *E = shared_external_nest;
if (E == NULL) {
@@ -536,16 +579,18 @@ nests, respectively.
DISCARD_TEXT(SF)
}
P = Pathnames::down(P, I"Inform");
- E = Supervisor::add_nest(P, EXTERNAL_NEST_TAG);
+ SVEXPLAIN(1, "(in absence of explicit -external, inventing -external %p)\n", P);
+ SVEXPLAIN(2, "(because home path, according to environment variable HOME, is %p)\n", home_path);
+ E = Supervisor::add_nest(P, EXTERNAL_NEST_TAG);
}
}
- §13. It is then sorted in tag order:
+ §15. It is then sorted in tag order:
§14. And the rest of Inform or Inbuild can now use:
+ §16. And the rest of Inform or Inbuild can now use:
§15. This tells the html module where to find, say, CSS files. Those files
+ §17. This is the default location for internal resources, to be used if there is
+no better indication of where they are.
+ §18. This tells the html module where to find, say, CSS files. Those files
are not managed by inbuild, have no versions, or anything fancy: they're
just plain old files.
§16. As noted above, the transient area is used for ephemera such as dynamically
+ §19. As noted above, the transient area is used for ephemera such as dynamically
written documentation and telemetry files. -transient sets it, but otherwise
the external nest is used.
§17. The shared project. In any single run, each of the Inform tools concerns itself with a single
+ §20. The shared project. In any single run, each of the Inform tools concerns itself with a single
Inform 7 program. This can be presented to it either in a project bundle
(a directory which contains source, settings, space for an index and for
temporary build files), or as a single file (just a text file containing
source text).
It is also possible o set a folder to be the project bundle, and nevertheless
+ It is also possible to set a folder to be the project bundle, and nevertheless
specify a file somewhere else to be the source text. What you can't do is
specify the bundle twice, or specify the file twice.
§18. If we are given a -project on the command line, we can then work out
+ §21. If we are given a -project on the command line, we can then work out
where its Materials folder is, and therefore where any expert settings files
would be. Note that the name of the expert settings file depends on the name
of the parent, i.e., it will be inform7-settings.txt or inbuild-settings.txt
@@ -641,22 +710,27 @@ depending on who's asking.
§19. This is a deceptively simple-looking function, which took a lot of time
+ §22. This is a deceptively simple-looking function, which took a lot of time
to get right. The situation is that the parent tool may already have
identified a copy C to be the main Inform project of this run, or it may not.
If it has, we ignore -project but apply -source to change its source text
@@ -667,21 +741,29 @@ location. If it hasn't, we create a project using
inform_project *chosen_project = NULL;
-void Supervisor::make_project_from_command_line(inbuild_copy *C) {
+void Supervisor::make_project_from_command_line(inbuild_copy *C) {
RUN_ONLY_IN_PHASE(PRETINKERING_INBUILD_PHASE)
filename *F = NULL; result of -source at the command line
pathname *P = NULL; result of -project at the command line
if (project_bundle_request) P = project_bundle_request;
if (project_file_request) F = project_file_request;
- if (C == NULL) {
- if (P) {
- C = ProjectBundleManager::claim_folder_as_copy(P);
- if (C == NULL) Errors::fatal("No such Inform project directory");
- } else if (F) {
- C = ProjectFileManager::claim_file_as_copy(F);
- if (C == NULL) Errors::fatal("No such Inform source file");
+ if (C) {
+ if (C->location_if_path) {
+ SVEXPLAIN(1, "(project identified by parent tool: %p)\n", C->location_if_path);
+ } else {
+ SVEXPLAIN(1, "(project identified by parent tool: %f)\n", C->location_if_file);
}
+ } else if (P) {
+ SVEXPLAIN(1, "(project identified by -project: %p)\n", P);
+ C = ProjectBundleManager::claim_folder_as_copy(P);
+ if (C == NULL) Errors::fatal("No such Inform project directory");
+ } else if (F) {
+ SVEXPLAIN(1, "(project identified by -source: %f)\n", F);
+ C = ProjectFileManager::claim_file_as_copy(F);
+ if (C == NULL) Errors::fatal("No such Inform source file");
+ } else {
+ SVEXPLAIN(1, "(no designated project)\n");
}
if (C) {
inform_project *proj = Projects::from_copy(C);
@@ -689,12 +771,14 @@ location. If it hasn't, we create a project using if (F) {
Projects::set_primary_source(proj, F);
Projects::set_primary_output(proj, transpiled_output_file);
+ if (transpiled_output_file)
+ SVEXPLAIN(1, "(transpiled output redirected to: %f)\n", transpiled_output_file);
}
chosen_project = proj;
}
}
-inform_project *Supervisor::project_set_at_command_line(void) {
+inform_project *Supervisor::project_set_at_command_line(void) {
return chosen_project;
}
diff --git a/docs/supervisor-module/1-sm.html b/docs/supervisor-module/1-sm.html
index 8ee2377a8..39e149d76 100644
--- a/docs/supervisor-module/1-sm.html
+++ b/docs/supervisor-module/1-sm.html
@@ -151,7 +151,7 @@ which use this module:
Writers::register_writer('J', &Languages::log);
Log::declare_aspect(EXTENSIONS_CENSUS_DA, L"extensions census", FALSE, FALSE);
Log::declare_aspect(HEADINGS_DA, L"headings", FALSE, FALSE);
- Supervisor::start();
+ Supervisor::start();
Declare the tree annotations3.2;
}
void SupervisorModule::end(void) {
diff --git a/docs/supervisor-module/2-cps.html b/docs/supervisor-module/2-cps.html
index a4c85b9dd..b49039ec2 100644
--- a/docs/supervisor-module/2-cps.html
+++ b/docs/supervisor-module/2-cps.html
@@ -91,7 +91,7 @@ stored here.
CLASS_DEFINITION
} inbuild_copy;
- §2. Copies are created by the managers for the respective genres, usually when
claiming. If you are a manager, do not call this...
Nests are repositories of Inform-related resources. §1. Creation. To "create" a nest here does not mean actually altering the file system, for
example by making a directory: nests here are merely notes in memory of
@@ -73,7 +73,7 @@ positions in the file system hierarchy which may or may not exist.
int tag_value; used to indicate whether internal, external, and such
CLASS_DEFINITION
} inbuild_nest;
-inbuild_nest *Nests::new(pathname *P) {
+inbuild_nest *Nests::new(pathname *P) {
inbuild_nest *N = CREATE(inbuild_nest);
N->location = P;
N->read_only = FALSE;
@@ -98,29 +98,48 @@ see below for why. Lower-tag-numbered origins are better than later ones.
enum EXTENSION_NEST_TAG
§4. Search list. When we search for copies, we do so by looking through nests in a list. The
+ §5. Search list. When we search for copies, we do so by looking through nests in a list. The
following builds such lists, removing duplicates — where duplicates are
shown up by having the same textual form of pathname. (This is not foolproof
by any means: Unix is replete with ways to describe the same directory, thanks
@@ -146,7 +165,7 @@ would just produce search results which were more copious than needed.)
ADD_TO_LINKED_LIST(N, inbuild_nest, search_list);
}
- §5. Search results. When we search a list of nests for copies satisfying certain requirements,
+ §6. Search results. When we search a list of nests for copies satisfying certain requirements,
we create one of these for each hit:
§6. These can be created only as entries in a list:
+ §7. These can be created only as entries in a list:
§7. And here is our search engine, such as it is. For each nest, we ask each
+ §8. And here is our search engine, such as it is. For each nest, we ask each
genre's manager to look for copies of that genre:
§8. Oftentimes, we want only the single best result, and won't even look at the
+ §9. Oftentimes, we want only the single best result, and won't even look at the
others:
§9. Where "better" is defined as follows. This innocent-looking function is
+ §10. Where "better" is defined as follows. This innocent-looking function is
in fact critical to what Inbuild does. It uses tags on nests to prefer copies
in the Materials folder to those in the external nest, and to prefer those in
turn to copies in the internal nest; and within nests of equal importance,
@@ -212,7 +231,7 @@ semantic version numbers.
void Supervisor::declare_options(void) {
RUN_ONLY_IN_PHASE(CONFIGURATION_INBUILD_PHASE)
- Declare Inform-related options4.2;
- Declare resource-related options4.4;
- Declare Inter-related options4.6;
+ Declare Inform-related options6.2;
+ Declare resource-related options6.4;
+ Declare Inter-related options6.6;
}
-
@@ -195,8 +231,8 @@ better way to choose a virtual machine to compile to.
L"make any source links refer to the source in extension example X");
CommandLine::end_group();
-
-
+enum INBUILD_RESOURCES_CLSG
@@ -205,7 +241,7 @@ better way to choose a virtual machine to compile to.
enum EXTERNAL_CLSW
enum TRANSIENT_CLSW
-
@@ -220,8 +256,8 @@ better way to choose a virtual machine to compile to.
L"use X for transient data such as the extensions census");
CommandLine::end_group();
-
-
+
@@ -246,8 +282,8 @@ but -pipeline-file L"set pipeline variable X (in form name=value)");
CommandLine::end_group();
-
-
+
text_stream *inter_pipeline_name = NULL;
-void Supervisor::set_inter_pipeline(text_stream *name) {
+void Supervisor::set_inter_pipeline(text_stream *name) {
if (inter_pipeline_name == NULL) inter_pipeline_name = Str::new();
else Str::clear(inter_pipeline_name);
WRITE_TO(inter_pipeline_name, "%S", name);
+ SVEXPLAIN(1, "(inter pipeline name set to %S)\n", name);
}
-
@@ -363,20 +400,20 @@ of the parent. In practice, that will be true for }
Regexp::dispose_of(&mr);
-
-
+
if (val) rng_seed_at_start_of_play = -16339;
else rng_seed_at_start_of_play = 0;
-
-
+
@@ -432,24 +469,25 @@ line, which is why we couldn't work this out earlier:
with_debugging = TRUE;
if (Str::len(ext) == 0) ext = I"Inform6";
target_vm *VM = TargetVMs::find_with_hint(ext, with_debugging);
- Supervisor::set_current_vm(VM);
+ Supervisor::set_current_vm(VM);
if (VM == NULL) Errors::fatal("unrecognised compilation format");
-
-
+
+
target_vm *current_target_VM = NULL;
-target_vm *Supervisor::current_vm(void) {
+target_vm *Supervisor::current_vm(void) {
RUN_ONLY_FROM_PHASE(TINKERING_INBUILD_PHASE)
return current_target_VM;
}
-void Supervisor::set_current_vm(target_vm *VM) {
+void Supervisor::set_current_vm(target_vm *VM) {
RUN_ONLY_IN_PHASE(PRETINKERING_INBUILD_PHASE)
current_target_VM = VM;
+ SVEXPLAIN(1, "(target VM set to %S)\n", TargetVMs::get_full_format_text(VM));
}
-
void Supervisor::go_operational(void) {
RUN_ONLY_IN_PHASE(TARGETED_INBUILD_PHASE)
- inbuild_phase = GRAPH_CONSTRUCTION_INBUILD_PHASE;
+ Supervisor::enter_phase(GRAPH_CONSTRUCTION_INBUILD_PHASE);
Copies::graph_everything();
- inbuild_phase = OPERATIONAL_INBUILD_PHASE;
+ Supervisor::enter_phase(OPERATIONAL_INBUILD_PHASE);
if (census_mode) ExtensionWebsite::handle_census_mode();
}
-
linked_list *shared_nest_list = NULL;
-void Supervisor::sort_nest_list(void) {
+void Supervisor::sort_nest_list(void) {
RUN_ONLY_IN_PHASE(TINKERING_INBUILD_PHASE)
shared_nest_list = NEW_LINKED_LIST(inbuild_nest);
inbuild_nest *N;
@@ -561,13 +606,27 @@ nests, respectively.
LOOP_OVER_LINKED_LIST(N, inbuild_nest, unsorted_nest_list)
if (Nests::get_tag(N) == INTERNAL_NEST_TAG)
ADD_TO_LINKED_LIST(N, inbuild_nest, shared_nest_list);
+ Supervisor::report_nest_list(2, I"unsorted", unsorted_nest_list);
+ Supervisor::report_nest_list(1, I"shared", shared_nest_list);
+ SVEXPLAIN(1, "(shared internal nest: %p)\n", Nests::get_location(shared_internal_nest));
+ SVEXPLAIN(1, "(shared external nest: %p)\n", Nests::get_location(shared_external_nest));
+}
+
+void Supervisor::report_nest_list(int level, text_stream *desc, linked_list *L) {
+ SVEXPLAIN(level, "(%S nest list:", desc);
+ if (LinkedLists::len(L) == 0) { SVEXPLAIN(level, " empty)\n"); return; }
+ inbuild_nest *N;
+ LOOP_OVER_LINKED_LIST(N, inbuild_nest, L)
+ SVEXPLAIN(level, "\n %S %p",
+ Nests::tag_name(Nests::get_tag(N)), Nests::get_location(N));
+ SVEXPLAIN(level, ")\n");
}
-
-linked_list *Supervisor::shared_nest_list(void) {
+linked_list *Supervisor::shared_nest_list(void) {
RUN_ONLY_FROM_PHASE(NESTED_INBUILD_PHASE)
if (shared_nest_list == NULL) internal_error("nest list never sorted");
return shared_nest_list;
@@ -578,31 +637,40 @@ nests, respectively.
return shared_internal_nest;
}
-inbuild_nest *Supervisor::external(void) {
+inbuild_nest *Supervisor::external(void) {
RUN_ONLY_FROM_PHASE(NESTED_INBUILD_PHASE)
return shared_external_nest;
}
-
+pathname *Supervisor::default_internal_path(void) {
+ return Pathnames::from_text(I"inform7/Internal");
+}
+
+define INSTALLED_FILES_HTML_CALLBACK Supervisor::installed_files
+
-define INSTALLED_FILES_HTML_CALLBACK Supervisor::installed_files
pathname *Supervisor::installed_files(void) {
if (shared_internal_nest) return shared_internal_nest->location;
- return Pathnames::from_text(I"inform7/Internal");
+ return Supervisor::default_internal_path();
}
-
-pathname *Supervisor::transient(void) {
+pathname *Supervisor::transient(void) {
RUN_ONLY_FROM_PHASE(TINKERING_INBUILD_PHASE)
if (shared_transient_resources == NULL)
if (shared_external_nest)
@@ -610,14 +678,14 @@ the external nest is used.
return shared_transient_resources;
}
-
-int Supervisor::set_I7_bundle(pathname *P) {
+int Supervisor::set_I7_bundle(pathname *P) {
RUN_ONLY_FROM_PHASE(CONFIGURATION_INBUILD_PHASE)
if (project_bundle_request) return FALSE;
project_bundle_request = P;
+ SVEXPLAIN(1, "(set project bundle path to: %p)\n", project_bundle_request);
pathname *materials = Projects::materialise_pathname(
Pathnames::up(P), Pathnames::directory_name(P));
TEMPORARY_TEXT(leaf)
WRITE_TO(leaf, "%s-settings.txt", PROGRAM_NAME);
filename *expert_settings = Filenames::in(materials, leaf);
- if (TextFiles::exists(expert_settings))
+ if (TextFiles::exists(expert_settings)) {
+ SVEXPLAIN(1, "(reading further command-line settings from: %f)\n", expert_settings);
CommandLine::also_read_file(expert_settings);
+ } else {
+ SVEXPLAIN(2, "(no command-line settings file is present at %f)\n");
+ }
DISCARD_TEXT(leaf)
return TRUE;
}
-
+
+
-int Nests::get_tag(inbuild_nest *N) {
+int Nests::get_tag(inbuild_nest *N) {
if (N == NULL) return -1;
return N->tag_value;
}
-void Nests::set_tag(inbuild_nest *N, int t) {
+void Nests::set_tag(inbuild_nest *N, int t) {
if (N == NULL) internal_error("no nest");
N->tag_value = t;
}
+
+text_stream *Nests::tag_name(int t) {
+ switch (t) {
+ case MATERIALS_NEST_TAG: return I"materials";
+ case EXTERNAL_NEST_TAG: return I"external";
+ case GENERIC_NEST_TAG: return I"generic";
+ case INTERNAL_NEST_TAG: return I"internal";
+ case EXTENSION_NEST_TAG: return I"extension";
+ }
+ return I"<unknown nest tag>";
+}
-void Nests::protect(inbuild_nest *N) {
+void Nests::protect(inbuild_nest *N) {
N->read_only = TRUE;
}
-int Nests::is_protected(inbuild_nest *N) {
+int Nests::is_protected(inbuild_nest *N) {
if (N == NULL) return FALSE;
return N->read_only;
}
-
+pathname *Nests::get_location(inbuild_nest *N) {
+ if (N == NULL) return NULL;
+ return N->location;
+}
+
+
-
-void Nests::add_search_result(linked_list *results, inbuild_nest *N, inbuild_copy *C,
+void Nests::add_search_result(linked_list *results, inbuild_nest *N, inbuild_copy *C,
inbuild_requirement *req) {
inbuild_search_result *R = CREATE(inbuild_search_result);
R->nest = N;
@@ -172,12 +191,12 @@ we create one of these for each hit:
ADD_TO_LINKED_LIST(R, inbuild_search_result, results);
}
-
-void Nests::search_for(inbuild_requirement *req,
+void Nests::search_for(inbuild_requirement *req,
linked_list *search_list, linked_list *results) {
inbuild_nest *N;
LOOP_OVER_LINKED_LIST(N, inbuild_nest, search_list) {
@@ -187,23 +206,23 @@ genre's manager to look for copies of that genre:
}
}
-
-inbuild_search_result *Nests::search_for_best(inbuild_requirement *req,
+inbuild_search_result *Nests::search_for_best(inbuild_requirement *req,
linked_list *search_list) {
linked_list *L = NEW_LINKED_LIST(inbuild_search_result);
- Nests::search_for(req, search_list, L);
+ Nests::search_for(req, search_list, L);
inbuild_search_result *best = NULL, *search_result;
LOOP_OVER_LINKED_LIST(search_result, inbuild_search_result, L)
- if (Nests::better_result(search_result, best))
+ if (Nests::better_result(search_result, best))
best = search_result;
return best;
}
-
-int Nests::better_result(inbuild_search_result *R1, inbuild_search_result *R2) {
+int Nests::better_result(inbuild_search_result *R1, inbuild_search_result *R2) {
Something is better than nothing
if (R1 == NULL) return FALSE;
if (R2 == NULL) return TRUE;
diff --git a/docs/supervisor-module/3-ib.html b/docs/supervisor-module/3-ib.html
index 0c78fba42..b42447d93 100644
--- a/docs/supervisor-module/3-ib.html
+++ b/docs/supervisor-module/3-ib.html
@@ -191,7 +191,7 @@ for each time we recurse.
no_build_generations++;
WRITE_TO(T, "Incremental build %d:\n", no_build_generations);
int rv = IncrementalBuild::recurse(OUT, T, gb, V, BM, &changes,
- no_build_generations, Supervisor::shared_nest_list());
+ no_build_generations, Supervisor::shared_nest_list());
WRITE_TO(T, "%d change(s)\n", changes);
return rv;
}
diff --git a/docs/supervisor-module/3-is.html b/docs/supervisor-module/3-is.html
index fd5275205..9c1ba4f27 100644
--- a/docs/supervisor-module/3-is.html
+++ b/docs/supervisor-module/3-is.html
@@ -70,7 +70,7 @@ is being held in memory by in
build_skill *build_kit_using_inter_skill = NULL;
build_skill *code_generate_using_inter_skill = NULL;
-void InterSkill::create(void) {
+void InterSkill::create(void) {
build_kit_using_inter_skill =
BuildSteps::new_skill(I"build kit using inter");
METHOD_ADD(build_kit_using_inter_skill, BUILD_SKILL_COMMAND_MTID,
@@ -174,7 +174,7 @@ should be, so the effect is the same.
inbuild_requirement *req =
Requirements::any_version_of(
Works::new(pipeline_genre, name, NULL));
- inbuild_search_result *R = Nests::search_for_best(req, search_list);
+ inbuild_search_result *R = Nests::search_for_best(req, search_list);
if (R == NULL) return NULL;
return R->copy->location_if_file;
}
@@ -213,7 +213,7 @@ it defaults to compile
inbuild_requirement *req =
Requirements::any_version_of(
Works::new(pipeline_genre, inter_pipeline_name, NULL));
- inbuild_search_result *R = Nests::search_for_best(req, search_list);
+ inbuild_search_result *R = Nests::search_for_best(req, search_list);
if (R == NULL) {
Errors::with_text("inter pipeline '%S' could not be found",
inter_pipeline_name);
diff --git a/docs/supervisor-module/3-is2.html b/docs/supervisor-module/3-is2.html
index 927ace8a3..149ecc6d9 100644
--- a/docs/supervisor-module/3-is2.html
+++ b/docs/supervisor-module/3-is2.html
@@ -66,7 +66,7 @@ if we are running inside info
build_skill *compile_using_inform7_skill = NULL;
-void Inform7Skill::create(void) {
+void Inform7Skill::create(void) {
compile_using_inform7_skill =
BuildSteps::new_skill(I"compile using inform7");
METHOD_ADD(compile_using_inform7_skill, BUILD_SKILL_COMMAND_MTID,
diff --git a/docs/supervisor-module/3-is3.html b/docs/supervisor-module/3-is3.html
index d996f0649..d5a0aabe6 100644
--- a/docs/supervisor-module/3-is3.html
+++ b/docs/supervisor-module/3-is3.html
@@ -67,7 +67,7 @@ called as a function.
build_skill *compile_using_inform6_skill = NULL;
-void Inform6Skill::create(void) {
+void Inform6Skill::create(void) {
compile_using_inform6_skill =
BuildSteps::new_skill(I"compile using inform6");
METHOD_ADD(compile_using_inform6_skill, BUILD_SKILL_COMMAND_MTID,
diff --git a/docs/supervisor-module/3-is4.html b/docs/supervisor-module/3-is4.html
index 67d867220..79c413b0f 100644
--- a/docs/supervisor-module/3-is4.html
+++ b/docs/supervisor-module/3-is4.html
@@ -64,7 +64,7 @@ function togglePopup(material_id) {
build_skill *package_using_inblorb_skill = NULL;
-void InblorbSkill::create(void) {
+void InblorbSkill::create(void) {
package_using_inblorb_skill =
BuildSteps::new_skill(I"package using inblorb");
METHOD_ADD(package_using_inblorb_skill, BUILD_SKILL_COMMAND_MTID,
diff --git a/docs/supervisor-module/4-ebm.html b/docs/supervisor-module/4-ebm.html
index 3f90e4f59..45b40840a 100644
--- a/docs/supervisor-module/4-ebm.html
+++ b/docs/supervisor-module/4-ebm.html
@@ -65,7 +65,7 @@ function togglePopup(material_id) {
-void ExtensionBundleManager::start(void) {
+void ExtensionBundleManager::start(void) {
extension_bundle_genre = Genres::new(I"extensionbundle", TRUE);
Genres::place_in_class(extension_bundle_genre, 1);
METHOD_ADD(extension_bundle_genre, GENRE_WRITE_WORK_MTID, ExtensionBundleManager::write_work);
@@ -480,7 +480,7 @@ copy name.
pathname *Q = Pathnames::down(P, entry);
inbuild_copy *C = ExtensionBundleManager::claim_folder_as_copy(Q, N);
if ((C) && (Requirements::meets(C->edition, req))) {
- Nests::add_search_result(search_results, N, C, req);
+ Nests::add_search_result(search_results, N, C, req);
} else if ((recurse) && (Str::ne(entry, I"Reserved")) && (Str::ne(entry, I"Source"))) {
ExtensionBundleManager::search_nest_for_r(Q, N, req, search_results, TRUE);
}
diff --git a/docs/supervisor-module/4-em.html b/docs/supervisor-module/4-em.html
index fcb6fdf4b..491e81f92 100644
--- a/docs/supervisor-module/4-em.html
+++ b/docs/supervisor-module/4-em.html
@@ -78,7 +78,7 @@ later on, as needed, just for extensions of interest: see below.
-void ExtensionManager::start(void) {
+void ExtensionManager::start(void) {
extension_genre = Genres::new(I"extension", TRUE);
Genres::place_in_class(extension_genre, 1);
METHOD_ADD(extension_genre, GENRE_WRITE_WORK_MTID, ExtensionManager::write_work);
@@ -233,7 +233,7 @@ with leafnames beginning . (Str::get_first_char(Filenames::get_leafname(F)) != '.')) {
inbuild_copy *C = ExtensionManager::claim_file_as_copy(F, N);
if ((C) && (Requirements::meets(C->edition, req))) {
- Nests::add_search_result(search_results, N, C, req);
+ Nests::add_search_result(search_results, N, C, req);
}
}
DISCARD_TEXT(fext)
diff --git a/docs/supervisor-module/4-km.html b/docs/supervisor-module/4-km.html
index 9fb743bc4..d6c1a81cb 100644
--- a/docs/supervisor-module/4-km.html
+++ b/docs/supervisor-module/4-km.html
@@ -72,7 +72,7 @@ the metadata file.
-void KitManager::start(void) {
+void KitManager::start(void) {
kit_genre = Genres::new(I"kit", TRUE);
METHOD_ADD(kit_genre, GENRE_WRITE_WORK_MTID, KitManager::write_work);
METHOD_ADD(kit_genre, GENRE_CLAIM_AS_COPY_MTID, KitManager::claim_as_copy);
@@ -199,7 +199,7 @@ requirements.
pathname *Q = Pathnames::down(P, entry);
inbuild_copy *C = KitManager::claim_folder_as_copy(Q, N);
if ((C) && (Requirements::meets(C->edition, req))) {
- Nests::add_search_result(search_results, N, C, req);
+ Nests::add_search_result(search_results, N, C, req);
}
}
}
diff --git a/docs/supervisor-module/4-lm.html b/docs/supervisor-module/4-lm.html
index 94b7787fe..fc766e67c 100644
--- a/docs/supervisor-module/4-lm.html
+++ b/docs/supervisor-module/4-lm.html
@@ -69,7 +69,7 @@ vertices with no build or use edges.
-void LanguageManager::start(void) { +void LanguageManager::start(void) { language_genre = Genres::new(I"language", TRUE); METHOD_ADD(language_genre, GENRE_WRITE_WORK_MTID, LanguageManager::write_work); METHOD_ADD(language_genre, GENRE_CLAIM_AS_COPY_MTID, LanguageManager::claim_as_copy); @@ -177,7 +177,7 @@ requirements. pathname *Q = Pathnames::down(P, entry); inbuild_copy *C = LanguageManager::claim_folder_as_copy(Q, N); if ((C) && (Requirements::meets(C->edition, req))) { - Nests::add_search_result(search_results, N, C, req); + Nests::add_search_result(search_results, N, C, req); } } } diff --git a/docs/supervisor-module/4-pbm.html b/docs/supervisor-module/4-pbm.html index f032dce4c..fdf8d1356 100644 --- a/docs/supervisor-module/4-pbm.html +++ b/docs/supervisor-module/4-pbm.html @@ -77,7 +77,7 @@ However it is stored in the file system, a project is a project.-void ProjectBundleManager::start(void) { +void ProjectBundleManager::start(void) { project_bundle_genre = Genres::new(I"projectbundle", FALSE); METHOD_ADD(project_bundle_genre, GENRE_WRITE_WORK_MTID, ProjectBundleManager::write_work); METHOD_ADD(project_bundle_genre, GENRE_CLAIM_AS_COPY_MTID, ProjectBundleManager::claim_as_copy); @@ -131,7 +131,7 @@ not a file, false if we know the reverse, and otherwise not applicable. } } -inbuild_copy *ProjectBundleManager::claim_folder_as_copy(pathname *P) { +inbuild_copy *ProjectBundleManager::claim_folder_as_copy(pathname *P) { if (Directories::exists(P) == FALSE) return NULL; inbuild_copy *C = ProjectBundleManager::new_copy(Pathnames::directory_name(P), P); Police extraneous contents3.1; @@ -301,11 +301,12 @@ not a file, false if we know the reverse, and otherwise not applicable. if (Platform::is_folder_separator(Str::get_last_char(entry)) == FALSE) { TEMPORARY_TEXT(ext) Filenames::write_extension(ext, Filenames::from_text(entry)); - if (Str::eq_insensitive(ext, I".html") == FALSE) { + if ((Str::eq_insensitive(ext, I".html") == FALSE) && + (Str::eq_insensitive(ext, I".xml") == FALSE)) { TEMPORARY_TEXT(error_text) WRITE_TO(error_text, "the 'Index' subdirectory of the project directory '%S' contains a " - "file called '%S', but can only contain HTML files", + "file called '%S', but can only contain HTML and XML files", Pathnames::directory_name(P), entry); Copies::attach_error(C, CopyErrors::new_T(PROJECT_MALFORMED_CE, -1, error_text)); DISCARD_TEXT(error_text) diff --git a/docs/supervisor-module/4-pfm.html b/docs/supervisor-module/4-pfm.html index 181cafc38..9c70d130b 100644 --- a/docs/supervisor-module/4-pfm.html +++ b/docs/supervisor-module/4-pfm.html @@ -75,7 +75,7 @@ However it is stored in the file system, a project is a project.-void ProjectFileManager::start(void) { +void ProjectFileManager::start(void) { project_file_genre = Genres::new(I"projectfile", FALSE); METHOD_ADD(project_file_genre, GENRE_WRITE_WORK_MTID, ProjectFileManager::write_work); METHOD_ADD(project_file_genre, GENRE_CLAIM_AS_COPY_MTID, ProjectFileManager::claim_as_copy); @@ -132,7 +132,7 @@ or .i7. } } -inbuild_copy *ProjectFileManager::claim_file_as_copy(filename *F) { +inbuild_copy *ProjectFileManager::claim_file_as_copy(filename *F) { if (TextFiles::exists(F) == FALSE) return NULL; inbuild_copy *C = ProjectFileManager::new_copy(Filenames::get_leafname(F), F); inform_project *proj = ProjectFileManager::from_copy(C); diff --git a/docs/supervisor-module/4-pm.html b/docs/supervisor-module/4-pm.html index 0eeed1e53..228841bf1 100644 --- a/docs/supervisor-module/4-pm.html +++ b/docs/supervisor-module/4-pm.html @@ -68,7 +68,7 @@ graphs are single vertices with no build or use edges.-void PipelineManager::start(void) { +void PipelineManager::start(void) { pipeline_genre = Genres::new(I"pipeline", TRUE); METHOD_ADD(pipeline_genre, GENRE_WRITE_WORK_MTID, PipelineManager::write_work); METHOD_ADD(pipeline_genre, GENRE_CLAIM_AS_COPY_MTID, PipelineManager::claim_as_copy); @@ -156,7 +156,7 @@ requirements. filename *F = Filenames::in(P, entry); inbuild_copy *C = PipelineManager::claim_file_as_copy(F, NULL, N); if ((C) && (Requirements::meets(C->edition, req))) { - Nests::add_search_result(search_results, N, C, req); + Nests::add_search_result(search_results, N, C, req); } } } diff --git a/docs/supervisor-module/4-tm.html b/docs/supervisor-module/4-tm.html index fdcbb5163..cf80d076d 100644 --- a/docs/supervisor-module/4-tm.html +++ b/docs/supervisor-module/4-tm.html @@ -69,7 +69,7 @@ vertices with no build or use edges.-void TemplateManager::start(void) { +void TemplateManager::start(void) { template_genre = Genres::new(I"template", TRUE); METHOD_ADD(template_genre, GENRE_WRITE_WORK_MTID, TemplateManager::write_work); METHOD_ADD(template_genre, GENRE_CLAIM_AS_COPY_MTID, TemplateManager::claim_as_copy); @@ -154,7 +154,7 @@ requirements. pathname *Q = Pathnames::down(P, entry); inbuild_copy *C = TemplateManager::claim_folder_as_copy(Q, N); if ((C) && (Requirements::meets(C->edition, req))) { - Nests::add_search_result(search_results, N, C, req); + Nests::add_search_result(search_results, N, C, req); } } } diff --git a/docs/supervisor-module/5-es.html b/docs/supervisor-module/5-es.html index a7c77fe6e..2c37f3d5a 100644 --- a/docs/supervisor-module/5-es.html +++ b/docs/supervisor-module/5-es.html @@ -882,13 +882,13 @@ the Materials folder of the project in question:linked_list *Extensions::nest_list(inform_extension *E) { - if (E == NULL) return Supervisor::shared_nest_list(); + if (E == NULL) return Supervisor::shared_nest_list(); RUN_ONLY_FROM_PHASE(NESTED_INBUILD_PHASE) if (LinkedLists::len(E->search_list) == 0) { inform_project *proj = E->read_into_project; if (proj) ADD_TO_LINKED_LIST(proj->materials_nest, inbuild_nest, E->search_list); inbuild_nest *N; - linked_list *L = Supervisor::shared_nest_list(); + linked_list *L = Supervisor::shared_nest_list(); LOOP_OVER_LINKED_LIST(N, inbuild_nest, L) ADD_TO_LINKED_LIST(N, inbuild_nest, E->search_list); } diff --git a/docs/supervisor-module/5-ks.html b/docs/supervisor-module/5-ks.html index 982b7cede..a14c5e281 100644 --- a/docs/supervisor-module/5-ks.html +++ b/docs/supervisor-module/5-ks.html @@ -374,7 +374,7 @@ a kit, going only on a name such as inform_kit *Kits::find_by_name(text_stream *name, linked_list *nest_list, inbuild_requirement *req) { if (req == NULL) req = Requirements::any_version_of(Works::new(kit_genre, name, I"")); - inbuild_search_result *R = Nests::search_for_best(req, nest_list); + inbuild_search_result *R = Nests::search_for_best(req, nest_list); if (R == NULL) return NULL; inbuild_copy *C = R->copy; return KitManager::from_copy(C); diff --git a/docs/supervisor-module/5-ls.html b/docs/supervisor-module/5-ls.html index 63e1863aa..87a466d0a 100644 --- a/docs/supervisor-module/5-ls.html +++ b/docs/supervisor-module/5-ls.html @@ -280,7 +280,7 @@ include the Materials folder for any relevant project. WRITE_TO(title, "%S Language", name); inbuild_requirement *extension_req = Requirements::any_version_of(Works::new(extension_bundle_genre, title, author)); - inbuild_search_result *extension_R = Nests::search_for_best(extension_req, search); + inbuild_search_result *extension_R = Nests::search_for_best(extension_req, search); DISCARD_TEXT(title) if (extension_R) { inform_extension *E = Extensions::from_copy(extension_R->copy); @@ -290,7 +290,7 @@ include the Materials folder for any relevant project. ADD_TO_LINKED_LIST(N, inbuild_nest, longer); inbuild_requirement *req = Requirements::any_version_of(Works::new(language_genre, name, I"")); - inbuild_search_result *R = Nests::search_for_best(req, longer); + inbuild_search_result *R = Nests::search_for_best(req, longer); if (R) { inform_language *L = LanguageManager::from_copy(R->copy); L->belongs_to = E; @@ -301,7 +301,7 @@ include the Materials folder for any relevant project. } inbuild_requirement *req = Requirements::any_version_of(Works::new(language_genre, name, I"")); - inbuild_search_result *R = Nests::search_for_best(req, search); + inbuild_search_result *R = Nests::search_for_best(req, search); Regexp::dispose_of(&mr); if (R) return LanguageManager::from_copy(R->copy); return NULL; @@ -315,7 +315,7 @@ so the function is now deprecated:text_stream *Languages::find_by_native_cue(text_stream *cue, linked_list *search) { linked_list *results = NEW_LINKED_LIST(inbuild_search_result); - Nests::search_for(Requirements::anything_of_genre(language_genre), search, results); + Nests::search_for(Requirements::anything_of_genre(language_genre), search, results); inbuild_search_result *search_result; LOOP_OVER_LINKED_LIST(search_result, inbuild_search_result, results) { inform_language *L = LanguageManager::from_copy(search_result->copy); diff --git a/docs/supervisor-module/5-ps2.html b/docs/supervisor-module/5-ps2.html index f4fca83ab..e3c122593 100644 --- a/docs/supervisor-module/5-ps2.html +++ b/docs/supervisor-module/5-ps2.html @@ -132,7 +132,7 @@ placeholders. else M = Projects::materialise_pathname( P, Filenames::get_leafname(proj->as_copy->location_if_file)); - proj->materials_nest = Supervisor::add_nest(M, MATERIALS_NEST_TAG); + proj->materials_nest = Supervisor::add_nest(M, MATERIALS_NEST_TAG); proj->search_list = NEW_LINKED_LIST(inbuild_nest); proj->primary_source = NULL; proj->extensions_included = NEW_LINKED_LIST(inform_extension); @@ -242,7 +242,7 @@ but ending .materials<-pathname *Projects::materialise_pathname(pathname *in, text_stream *leaf) { +pathname *Projects::materialise_pathname(pathname *in, text_stream *leaf) { TEMPORARY_TEXT(mf) WRITE_TO(mf, "%S", leaf); int i = Str::len(mf)-1; @@ -286,7 +286,7 @@ is small, but one likes to minimise the effect of the CWD.) pathname *Projects::build_path(inform_project *proj) { if (proj->as_copy->location_if_path) return Pathnames::down(Projects::path(proj), I"Build"); - return Supervisor::transient(); + return Supervisor::transient(); } inbuild_nest *Projects::materials_nest(inform_project *proj) { @@ -306,12 +306,12 @@ reasons, this list is created on demand.linked_list *Projects::nest_list(inform_project *proj) { - if (proj == NULL) return Supervisor::shared_nest_list(); + if (proj == NULL) return Supervisor::shared_nest_list(); RUN_ONLY_FROM_PHASE(NESTED_INBUILD_PHASE) if (LinkedLists::len(proj->search_list) == 0) { ADD_TO_LINKED_LIST(proj->materials_nest, inbuild_nest, proj->search_list); inbuild_nest *N; - linked_list *L = Supervisor::shared_nest_list(); + linked_list *L = Supervisor::shared_nest_list(); LOOP_OVER_LINKED_LIST(N, inbuild_nest, L) ADD_TO_LINKED_LIST(N, inbuild_nest, proj->search_list); } @@ -330,7 +330,7 @@ reasons, this list is created on demand.-inform_project *Projects::from_copy(inbuild_copy *C) { +inform_project *Projects::from_copy(inbuild_copy *C) { inform_project *project = ProjectBundleManager::from_copy(C); if (project == NULL) project = ProjectFileManager::from_copy(C); return project; @@ -341,7 +341,7 @@ has a single, "primary", one.-void Projects::set_primary_source(inform_project *proj, filename *F) { +void Projects::set_primary_source(inform_project *proj, filename *F) { proj->primary_source = F; } @@ -564,7 +564,7 @@ and that means it's not beneath our notice.)-void Projects::set_compilation_options(inform_project *proj, int r, int co, int rng) { +void Projects::set_compilation_options(inform_project *proj, int r, int co, int rng) { proj->compile_for_release = r; proj->compile_only = co; proj->fix_rng = rng; @@ -633,7 +633,7 @@ at least one kit, and probably several.int forcible_basic_mode = FALSE; -void Projects::enter_forcible_basic_mode(void) { +void Projects::enter_forcible_basic_mode(void) { forcible_basic_mode = TRUE; } @@ -906,7 +906,7 @@ details instead.-void Projects::set_primary_output(inform_project *proj, filename *F) { +void Projects::set_primary_output(inform_project *proj, filename *F) { proj->primary_output = F; } @@ -915,7 +915,7 @@ details instead. if (proj->stand_alone) { return Filenames::set_extension(proj->primary_source, TargetVMs::get_transpiled_extension( - Supervisor::current_vm())); + Supervisor::current_vm())); } else { pathname *build_folder = Projects::build_path(proj); return Filenames::in(build_folder, I"auto.inf"); @@ -1013,7 +1013,7 @@ elaborate use of inblorb to- target_vm *VM = Supervisor::current_vm(); + target_vm *VM = Supervisor::current_vm(); filename *inf_F = Projects::get_primary_output(proj); vertex for the inter code put together in memory @@ -1246,7 +1246,7 @@ like Basic Inform or Standard Rules; and also any sentences in the Projects::early_source_text(early, proj); if (Str::len(early) > 0) Feeds::feed_text(early); DISCARD_TEXT(early) - inbuild_nest *ext = Supervisor::external(); + inbuild_nest *ext = Supervisor::external(); if (ext) OptionsFile::read( Filenames::in(ext->location, I"Options.txt")); wording early_W = Wordings::new(wc, lexer_wordcount-1); diff --git a/docs/supervisor-module/6-cs.html b/docs/supervisor-module/6-cs.html index 18f9d9211..2f6bec296 100644 --- a/docs/supervisor-module/6-cs.html +++ b/docs/supervisor-module/6-cs.html @@ -121,7 +121,7 @@ extensions cannot extend it.-void ControlStructures::create_standard(void) { +void ControlStructures::create_standard(void) { switch_CSP = ControlStructures::new(I"SWI"); switch_CSP->body_empty_except_for_subordinates = TRUE; switch_CSP->indent_subblocks = TRUE; diff --git a/docs/supervisor-module/6-hdn.html b/docs/supervisor-module/6-hdn.html index 487e4ead1..885c60465 100644 --- a/docs/supervisor-module/6-hdn.html +++ b/docs/supervisor-module/6-hdn.html @@ -523,7 +523,7 @@ otherwise. <current-virtual-machine> internal { if (<virtual-machine>(W)) { compatibility_specification *vms = (compatibility_specification *) <<rp>>; - ==> { Compatibility::test(vms, Supervisor::current_vm()), - }; + ==> { Compatibility::test(vms, Supervisor::current_vm()), - }; return TRUE; } else { ==> { fail nonterminal }; diff --git a/docs/supervisor-module/6-inc.html b/docs/supervisor-module/6-inc.html index 4497f630b..d8589404a 100644 --- a/docs/supervisor-module/6-inc.html +++ b/docs/supervisor-module/6-inc.html @@ -340,7 +340,7 @@ Sausages by Mr Punch, and loaded it, but then read the sentenceinbuild_search_result *search_result = - Nests::search_for_best(req, Projects::nest_list(for_project)); + Nests::search_for_best(req, Projects::nest_list(for_project)); if (search_result) { E = Extensions::from_copy(search_result->copy); Extensions::set_inclusion_sentence(E, at); @@ -348,7 +348,7 @@ Sausages by Mr Punch, and loaded it, but then read the sentence if (Nests::get_tag(search_result->nest) == INTERNAL_NEST_TAG) E->loaded_from_built_in_area = TRUE; compatibility_specification *C = E->as_copy->edition->compatibility; - if (Compatibility::test(C, Supervisor::current_vm()) == FALSE) + if (Compatibility::test(C, Supervisor::current_vm()) == FALSE) Issue a problem message saying that the VM does not meet requirements6.1.1; if (LinkedLists::len(search_result->copy->errors_reading_source_text) == 0) { @@ -388,7 +388,7 @@ report this problem at the inclusion line.inbuild_requirement *req2 = Requirements::any_version_of(req->work); linked_list *L = NEW_LINKED_LIST(inbuild_search_result); - Nests::search_for(req2, Projects::nest_list(for_project), L); + Nests::search_for(req2, Projects::nest_list(for_project), L); if (LinkedLists::len(L) == 0) { copy_error *CE = CopyErrors::new(SYNTAX_CE, BogusExtension_SYNERROR); CopyErrors::supply_node(CE, current_sentence); diff --git a/docs/supervisor-module/6-st.html b/docs/supervisor-module/6-st.html index c1cf0a4b4..b71d33697 100644 --- a/docs/supervisor-module/6-st.html +++ b/docs/supervisor-module/6-st.html @@ -108,7 +108,7 @@ perhaps combining our feed with that of others. text_stream *leaf = Filenames::get_leafname(F); if (primary) leaf = I"main source text"; int mode = UNICODE_UFBHM; - target_vm *vm = Supervisor::current_vm(); + target_vm *vm = Supervisor::current_vm(); if (TargetVMs::is_16_bit(vm)) mode = ZSCII_UFBHM; sf = TextFromFiles::feed_open_file_into_lexer(F, handle, leaf, documentation_only, ref, mode); diff --git a/docs/supervisor-module/7-cns.html b/docs/supervisor-module/7-cns.html index 2377a448a..ea898902d 100644 --- a/docs/supervisor-module/7-cns.html +++ b/docs/supervisor-module/7-cns.html @@ -88,7 +88,7 @@ compiled in case (b). C->search_list = NEW_LINKED_LIST(inbuild_nest); ADD_TO_LINKED_LIST(C->search_list, inbuild_nest, proj->search_list); inbuild_nest *N; - linked_list *L = Supervisor::shared_nest_list(); + linked_list *L = Supervisor::shared_nest_list(); LOOP_OVER_LINKED_LIST(N, inbuild_nest, L) if (Nests::get_tag(N) == INTERNAL_NEST_TAG) ADD_TO_LINKED_LIST(N, inbuild_nest, C->search_list); @@ -134,7 +134,7 @@ is created. (These are called ECDs below.)
- The structure extension_census_datum is accessed in 6/hdn, 6/inc, 7/dct, 7/ip, 7/ip2 and here.
§5. An ECD is actually a wrapper for an inform_extension object in disguise, -since the inbuild_search_result found that. +since the inbuild_search_result found that.
@@ -204,14 +204,14 @@ handed to qsort
§7. Performing the census. For some reason a census often makes a good story (cf. Luke 2:1-5), but here there's disappointingly little to tell, because the work is all done by a -single call to Nests::search_for. +single call to Nests::search_for.
extension_census *ExtensionCensus::perform(inform_project *proj) { extension_census *C = ExtensionCensus::new(proj); inbuild_requirement *req = Requirements::anything_of_genre(extension_genre); - Nests::search_for(req, C->search_list, C->raw_data); + Nests::search_for(req, C->search_list, C->raw_data); inbuild_search_result *R; LOOP_OVER_LINKED_LIST(R, inbuild_search_result, C->raw_data) { diff --git a/docs/supervisor-module/7-dct.html b/docs/supervisor-module/7-dct.html index 0f6c44c82..beeb4bdf2 100644 --- a/docs/supervisor-module/7-dct.html +++ b/docs/supervisor-module/7-dct.html @@ -85,7 +85,7 @@ loss if this should be mislaid.)filename *ExtensionDictionary::filename(void) { - pathname *P = Supervisor::transient(); + pathname *P = Supervisor::transient(); if (P == NULL) return NULL; P = Pathnames::down(P, I"Documentation"); P = Pathnames::down(P, I"Census"); @@ -329,7 +329,7 @@ days when overlong records were truncated. inbuild_requirement *req = Requirements::any_version_of(Works::new(extension_genre, title, author)); inbuild_search_result *R = - Nests::search_for_best(req, Supervisor::shared_nest_list()); + Nests::search_for_best(req, Supervisor::shared_nest_list()); if (R) ExtensionDictionary::new_ede(Extensions::from_copy(R->copy), category, author, title, headword); } else { diff --git a/docs/supervisor-module/7-tm.html b/docs/supervisor-module/7-tm.html index 64ea965e2..2ff395d29 100644 --- a/docs/supervisor-module/7-tm.html +++ b/docs/supervisor-module/7-tm.html @@ -97,7 +97,7 @@ same either way. Here are the functions for (a) and (b) respectively:-void ExtensionWebsite::handle_census_mode(void) { +void ExtensionWebsite::handle_census_mode(void) { HTML::set_link_abbreviation_path(NULL); ExtensionWebsite::go(NULL, TRUE); } @@ -197,7 +197,7 @@ in the same area but not as part of the site.pathname *ExtensionWebsite::home_URL(inform_project *proj) { if (proj == NULL) { - pathname *P = Supervisor::transient(); + pathname *P = Supervisor::transient(); if (P == NULL) return NULL; if (Pathnames::create_in_file_system(P) == 0) return NULL; P = Pathnames::down(P, I"Documentation"); diff --git a/docs/supervisor-module/7-tr.html b/docs/supervisor-module/7-tr.html index 1b42e3baa..bbc6acff7 100644 --- a/docs/supervisor-module/7-tr.html +++ b/docs/supervisor-module/7-tr.html @@ -123,7 +123,7 @@ produces a second report.void InbuildReport::install(inbuild_copy *C, int confirmed, pathname *to_tool) { - inform_project *project = Supervisor::project_set_at_command_line(); + inform_project *project = Supervisor::project_set_at_command_line(); if (project == NULL) Errors::fatal("-project not set at command line"); TEMPORARY_TEXT(pname) WRITE_TO(pname, "'%S'", project->as_copy->edition->work->title); @@ -324,7 +324,7 @@ produces a second report. inbuild_requirement *req = Requirements::anything_of_genre(extension_bundle_genre); linked_list *search_list = NEW_LINKED_LIST(inbuild_nest); ADD_TO_LINKED_LIST(Projects::materials_nest(project), inbuild_nest, search_list); - Nests::search_for(req, search_list, L); + Nests::search_for(req, search_list, L);§2.5.2. List the extensions currently installed in the project2.5.2 = diff --git a/docs/supervisor-module/P-wtmd.html b/docs/supervisor-module/P-wtmd.html index e027b273b..45562527f 100644 --- a/docs/supervisor-module/P-wtmd.html +++ b/docs/supervisor-module/P-wtmd.html @@ -96,22 +96,22 @@ saying "now build this".
- (1) supervisor has to be started and stopped at each end of the parent's run, by calling SupervisorModule::start and SupervisorModule::end. -The former calls Supervisor::start in turn, and that activates a number of +The former calls Supervisor::start in turn, and that activates a number of subsystems with further calls. But all modules do something like this.
- (2) More unusually, when the parent is creating its command-line options, it -should call Supervisor::declare_options to add more. This allows all tools +should call Supervisor::declare_options to add more. This allows all tools containing the Supervisor to offer a unified set of command-line options to configure it.1 When the parent is given a switch that it doesn't recognise, -it should call Supervisor::option; and when it has fully processed the -command line, it should call Supervisor::optioneering_complete. +it should call Supervisor::option; and when it has fully processed the +command line, it should call Supervisor::optioneering_complete.
- (3) The parent can now, if it chooses, make calls into supervisor to set -up additional dependencies. But eventually it will call Supervisor::go_operational. +up additional dependencies. But eventually it will call Supervisor::go_operational. The Supervisor is now ready for use!
There is no single "go" button: instead, the Supervisor provides a suite of functions to call, each acting on a "copy" — an instance of some software at a given filing system location. When inform7 is the parent, it follows -the call to Supervisor::go_operational with a single call to Copies::build +the call to Supervisor::go_operational with a single call to Copies::build on the copy representing the current Inform 7 project. But when inbuild is the parent, a variety of other functions may be made.
@@ -123,7 +123,7 @@ to see the effect. example, "Inform 7 extension" and "website template" are both genres. Each different genre is represented by an inbuild_genre object, whose method calls provide the behaviour distinctive to that genre. The currently seven -genre objects are created during Supervisor::start, which calls out to +genre objects are created during Supervisor::start, which calls out to ExtensionManager::start, KitManager::start, and so on: the seven sections of Chapter 4: Genre Management are exactly the method calls for the seven genre objects. @@ -174,7 +174,7 @@ typed: $ inform7 -internal inform7/Internal -external ~/mystuff -project Tadpoles.informthen all three command-line switches here would actually be parsed by -Supervisor::option, rather than by anything in the core module. +Supervisor::option, rather than by anything in the core module. They would set the "internal" and "external" nest (see Manual (in inbuild)), creating an inbuild_nest object for each. The Inform 7 project for the run would also be set. This would become whose genre is project_bundle_genre. @@ -185,7 +185,7 @@ run would also be set. This would become whose genre is
@@ -202,9 +202,9 @@ which matches any extension by Emily Short. ↩supervisor does this by creating an inbuild_requirement object to specify what it wants, and then calling its -search engine Nests::search_for. This builds a list of inbuild_search_result +search engine Nests::search_for. This builds a list of inbuild_search_result objects, each pointing to a new copy which matches the requirement given.§6. Although such searches can be used with vague requirements to scan for, say, everything with a given genre, they can also be used to seek specific -pieces of software which we will need. Nests::search_for_best is a version +pieces of software which we will need. Nests::search_for_best is a version of the search engine which returns a single result (or none): the best one. -Best is defined by Nests::better_result and makes careful use of both +Best is defined by Nests::better_result and makes careful use of both semantic versioning and the user's intentions to ensure a happy outcome. For example, if an Inform project says
@@ -213,7 +213,7 @@ For example, if an Inform project saysInclude Upturned Faces by Raphael.
-then Nests::search_for_best will be used to seek which copy of this +
then Nests::search_for_best will be used to seek which copy of this extension to use.
@@ -297,7 +297,7 @@ templates, there are no dependencies, so there's nothing to build. For kits, extensions and projects, the task is performed by Kits::construct_graph, Extensions::construct_graph and Projects::construct_graph. Kits are graphed when the Supervisor "goes operational", because -Supervisor::go_operational calls Copies::construct_graph for +Supervisor::go_operational calls Copies::construct_graph for every extant copy. @@ -505,7 +505,7 @@ i.e., has edges out to.How does one "build a vertex", though? The answer is that if a vertex has been given a build_script, one follows this script. The script is only a list of build_step objects, and each step is an application of a build_skill. -There are only a few skills known to the Supervisor, created by Supervisor::start. +There are only a few skills known to the Supervisor, created by Supervisor::start. For example, assimilating a kit is a skill; but the need to apply this skill to a particular copy of WorldModelKit is a build step.
diff --git a/inbuild/Chapter 1/Main.w b/inbuild/Chapter 1/Main.w index 438a71680..39744958b 100644 --- a/inbuild/Chapter 1/Main.w +++ b/inbuild/Chapter 1/Main.w @@ -87,9 +87,12 @@ error in this case. if (D->location_if_file) Supervisor::set_I7_source(D->location_if_file); } if ((LinkedLists::len(unsorted_nest_list) == 0) || - ((others_exist == FALSE) && (D))) + ((others_exist == FALSE) && (D))) { + SVEXPLAIN(1, "(in absence of explicit -internal, inventing -internal %p)\n", + Supervisor::default_internal_path()); Supervisor::add_nest( - Pathnames::from_text(I"inform7/Internal"), INTERNAL_NEST_TAG); + Supervisor::default_internal_path(), INTERNAL_NEST_TAG); + } Supervisor::optioneering_complete(D, FALSE, &Main::load_preform); inform_project *proj; LOOP_OVER(proj, inform_project) @@ -359,6 +362,8 @@ other options to the selection defined here. @e RESULTS_CLSW @e INSTALL_CLSW @e CONFIRMED_CLSW +@e VERBOSE_CLSW +@e VERBOSITY_CLSW @= CommandLine::declare_heading( @@ -424,6 +429,10 @@ other options to the selection defined here. L"write HTML report file to X (for use within Inform GUI apps)"); CommandLine::declare_boolean_switch(CONFIRMED_CLSW, L"confirmed", 1, L"confirm installation in the Inform GUI apps", TRUE); + CommandLine::declare_boolean_switch(VERBOSE_CLSW, L"verbose", 1, + L"equivalent to -verbosity=1", FALSE); + CommandLine::declare_numerical_switch(VERBOSITY_CLSW, L"verbosity", 1, + L"how much explanation to print: lowest is 0 (default), highest is 3"); Supervisor::declare_options(); CommandLine::read(argc, argv, NULL, &Main::option, &Main::bareword); @@ -491,6 +500,8 @@ void Main::option(int id, int val, text_stream *arg, void *state) { case INSTALL_CLSW: to_install = Main::file_or_path_to_copy(arg, TRUE); break; case RESULTS_CLSW: InbuildReport::set_filename(Filenames::from_text(arg)); break; case CONFIRMED_CLSW: confirmed = val; break; + case VERBOSE_CLSW: Supervisor::set_verbosity(1); break; + case VERBOSITY_CLSW: Supervisor::set_verbosity(val); break; } Supervisor::option(id, val, arg, state); } diff --git a/inbuild/Figures/help.txt b/inbuild/Figures/help.txt index 79b2e166a..d62bb9c3b 100644 --- a/inbuild/Figures/help.txt +++ b/inbuild/Figures/help.txt @@ -30,6 +30,8 @@ usage: inbuild [-TASK] TARGET1 TARGET2 ... -use-locate show file paths of all the extensions, kits and so on needed to use -use-missing show the extensions, kits and so on which are needed to use but missing -use-needs show all the extensions, kits and so on needed to use +-verbose equivalent to -verbosity=1 (default is -no-verbose) +-verbosity=N how much explanation to print: lowest is 0 (default), highest is 3 -verify-registry X verify roster.json metadata of registry in the directory X -no-versions-in-filenames don't append _v number to destination filenames on -copy-to or -sync-to (default is -versions-in-filenames) diff --git a/inbuild/supervisor-module/Chapter 1/Inbuild Control.w b/inbuild/supervisor-module/Chapter 1/Inbuild Control.w index eef61db1b..477c0606f 100644 --- a/inbuild/supervisor-module/Chapter 1/Inbuild Control.w +++ b/inbuild/supervisor-module/Chapter 1/Inbuild Control.w @@ -2,6 +2,25 @@ Who shall supervise the supervisor? This section of code will. +@h Verbosity. +It is both a strength and a source of anxiety that build managers work in +an autonomous sort of way, doing "whatever is necessary". Some users want +silence while this happens, and others expect detailed explanations. + += (early code) +int supervisor_verbosity = 0; +#define SVEXPLAIN(level, args...) { \ + if (supervisor_verbosity >= level) Writers::printf(STDOUT, args); \ +} + +@ = +void Supervisor::set_verbosity(int level) { + if (level < 0) level = 0; + if (level > 3) level = 3; + supervisor_verbosity = level; + if (level > 0) WRITE_TO(STDOUT, "(Verbosity set to %d)\n", level); +} + @h Phases. The //supervisor// module provides services to the parent tool. @@ -37,10 +56,25 @@ out of turn. = int inbuild_phase = STARTUP_INBUILD_PHASE; void Supervisor::enter_phase(int p) { - if (p <= inbuild_phase) internal_error("phases out of sequence"); + SVEXPLAIN(2, "(Supervisor phase %d: %S -> %d: %S)\n", + inbuild_phase, Supervisor::phase_name(inbuild_phase), p, Supervisor::phase_name(p)); inbuild_phase = p; } +text_stream *Supervisor::phase_name(int p) { + switch (p) { + case STARTUP_INBUILD_PHASE: return I"startup"; + case CONFIGURATION_INBUILD_PHASE: return I"configuration"; + case PRETINKERING_INBUILD_PHASE: return I"pretinkering"; + case TINKERING_INBUILD_PHASE: return I"tinkering"; + case NESTED_INBUILD_PHASE: return I"nested"; + case TARGETED_INBUILD_PHASE: return I"targeted"; + case GRAPH_CONSTRUCTION_INBUILD_PHASE: return I"graphing"; + case OPERATIONAL_INBUILD_PHASE: return I"operational"; + } + return I" "; +} + @h Startup phase. The following is called when the //supervisor// module starts up. @@ -71,7 +105,7 @@ void Supervisor::start(void) { ControlStructures::create_standard(); - inbuild_phase = CONFIGURATION_INBUILD_PHASE; + Supervisor::enter_phase(CONFIGURATION_INBUILD_PHASE); Supervisor::set_defaults(); } @@ -209,6 +243,7 @@ void Supervisor::set_inter_pipeline(text_stream *name) { if (inter_pipeline_name == NULL) inter_pipeline_name = Str::new(); else Str::clear(inter_pipeline_name); WRITE_TO(inter_pipeline_name, "%S", name); + SVEXPLAIN(1, "(inter pipeline name set to %S)\n", name); } @ The //supervisor// module itself doesn't parse command-line options: that's for @@ -308,23 +343,23 @@ int (*shared_preform_callback)(inform_language *); void Supervisor::optioneering_complete(inbuild_copy *C, int compile_only, int (*preform_callback)(inform_language *)) { RUN_ONLY_IN_PHASE(CONFIGURATION_INBUILD_PHASE) - inbuild_phase = PRETINKERING_INBUILD_PHASE; + Supervisor::enter_phase(PRETINKERING_INBUILD_PHASE); shared_preform_callback = preform_callback; @ ; Supervisor::make_project_from_command_line(C); Supervisor::create_default_externals(); - inbuild_phase = TINKERING_INBUILD_PHASE; + Supervisor::enter_phase(TINKERING_INBUILD_PHASE); Supervisor::sort_nest_list(); - inbuild_phase = NESTED_INBUILD_PHASE; + Supervisor::enter_phase(NESTED_INBUILD_PHASE); inform_project *proj; LOOP_OVER(proj, inform_project) Projects::set_compilation_options(proj, this_is_a_release_compile, compile_only, rng_seed_at_start_of_play); - inbuild_phase = TARGETED_INBUILD_PHASE; + Supervisor::enter_phase(TARGETED_INBUILD_PHASE); } @ The VM to be used depends on the settings of all three of |-format|, @@ -350,6 +385,7 @@ target_vm *Supervisor::current_vm(void) { void Supervisor::set_current_vm(target_vm *VM) { RUN_ONLY_IN_PHASE(PRETINKERING_INBUILD_PHASE) current_target_VM = VM; + SVEXPLAIN(1, "(target VM set to %S)\n", TargetVMs::get_full_format_text(VM)); } @h The Graph Construction and Operational phases. @@ -366,9 +402,9 @@ We do that copy by copy. = void Supervisor::go_operational(void) { RUN_ONLY_IN_PHASE(TARGETED_INBUILD_PHASE) - inbuild_phase = GRAPH_CONSTRUCTION_INBUILD_PHASE; + Supervisor::enter_phase(GRAPH_CONSTRUCTION_INBUILD_PHASE); Copies::graph_everything(); - inbuild_phase = OPERATIONAL_INBUILD_PHASE; + Supervisor::enter_phase(OPERATIONAL_INBUILD_PHASE); if (census_mode) ExtensionWebsite::handle_census_mode(); } @@ -415,12 +451,17 @@ inbuild_nest *Supervisor::add_nest(pathname *P, int tag) { unsorted_nest_list = NEW_LINKED_LIST(inbuild_nest); inbuild_nest *N = Nests::new(P); Nests::set_tag(N, tag); + int set_shared = FALSE; ADD_TO_LINKED_LIST(N, inbuild_nest, unsorted_nest_list); - if ((tag == EXTERNAL_NEST_TAG) && (shared_external_nest == NULL)) - shared_external_nest = N; - if ((tag == INTERNAL_NEST_TAG) && (shared_internal_nest == NULL)) - shared_internal_nest = N; + if ((tag == EXTERNAL_NEST_TAG) && (shared_external_nest == NULL)) { + shared_external_nest = N; set_shared = TRUE; + } + if ((tag == INTERNAL_NEST_TAG) && (shared_internal_nest == NULL)) { + shared_internal_nest = N; set_shared = TRUE; + } if (tag == INTERNAL_NEST_TAG) Nests::protect(N); + SVEXPLAIN(2, "(%S%S nest set at %p)\n", + (set_shared)?I"shared ":I"", Nests::tag_name(tag), P); return N; } @@ -437,6 +478,8 @@ void Supervisor::create_default_externals(void) { DISCARD_TEXT(SF) } P = Pathnames::down(P, I"Inform"); + SVEXPLAIN(1, "(in absence of explicit -external, inventing -external %p)\n", P); + SVEXPLAIN(2, "(because home path, according to environment variable HOME, is %p)\n", home_path); E = Supervisor::add_nest(P, EXTERNAL_NEST_TAG); } } @@ -461,6 +504,20 @@ void Supervisor::sort_nest_list(void) { LOOP_OVER_LINKED_LIST(N, inbuild_nest, unsorted_nest_list) if (Nests::get_tag(N) == INTERNAL_NEST_TAG) ADD_TO_LINKED_LIST(N, inbuild_nest, shared_nest_list); + Supervisor::report_nest_list(2, I"unsorted", unsorted_nest_list); + Supervisor::report_nest_list(1, I"shared", shared_nest_list); + SVEXPLAIN(1, "(shared internal nest: %p)\n", Nests::get_location(shared_internal_nest)); + SVEXPLAIN(1, "(shared external nest: %p)\n", Nests::get_location(shared_external_nest)); +} + +void Supervisor::report_nest_list(int level, text_stream *desc, linked_list *L) { + SVEXPLAIN(level, "(%S nest list:", desc); + if (LinkedLists::len(L) == 0) { SVEXPLAIN(level, " empty)\n"); return; } + inbuild_nest *N; + LOOP_OVER_LINKED_LIST(N, inbuild_nest, L) + SVEXPLAIN(level, "\n %S %p", + Nests::tag_name(Nests::get_tag(N)), Nests::get_location(N)); + SVEXPLAIN(level, ")\n"); } @ And the rest of Inform or Inbuild can now use: @@ -482,6 +539,14 @@ inbuild_nest *Supervisor::external(void) { return shared_external_nest; } +@ This is the default location for internal resources, to be used if there is +no better indication of where they are. + += +pathname *Supervisor::default_internal_path(void) { + return Pathnames::from_text(I"inform7/Internal"); +} + @ This tells the //html// module where to find, say, CSS files. Those files are not managed by //inbuild//, have no versions, or anything fancy: they're just plain old files. @@ -491,7 +556,7 @@ just plain old files. = pathname *Supervisor::installed_files(void) { if (shared_internal_nest) return shared_internal_nest->location; - return Pathnames::from_text(I"inform7/Internal"); + return Supervisor::default_internal_path(); } @ As noted above, the transient area is used for ephemera such as dynamically @@ -514,7 +579,7 @@ Inform 7 program. This can be presented to it either in a project bundle temporary build files), or as a single file (just a text file containing source text). -It is also possible o set a folder to be the project bundle, and nevertheless +It is also possible to set a folder to be the project bundle, and nevertheless specify a file somewhere else to be the source text. What you can't do is specify the bundle twice, or specify the file twice. @@ -526,6 +591,7 @@ int Supervisor::set_I7_source(filename *F) { RUN_ONLY_FROM_PHASE(CONFIGURATION_INBUILD_PHASE) if (project_file_request) return FALSE; project_file_request = F; + SVEXPLAIN(1, "(set project source file to: %f)\n", project_file_request); return TRUE; } @@ -540,13 +606,18 @@ int Supervisor::set_I7_bundle(pathname *P) { RUN_ONLY_FROM_PHASE(CONFIGURATION_INBUILD_PHASE) if (project_bundle_request) return FALSE; project_bundle_request = P; + SVEXPLAIN(1, "(set project bundle path to: %p)\n", project_bundle_request); pathname *materials = Projects::materialise_pathname( Pathnames::up(P), Pathnames::directory_name(P)); TEMPORARY_TEXT(leaf) WRITE_TO(leaf, "%s-settings.txt", PROGRAM_NAME); filename *expert_settings = Filenames::in(materials, leaf); - if (TextFiles::exists(expert_settings)) + if (TextFiles::exists(expert_settings)) { + SVEXPLAIN(1, "(reading further command-line settings from: %f)\n", expert_settings); CommandLine::also_read_file(expert_settings); + } else { + SVEXPLAIN(2, "(no command-line settings file is present at %f)\n"); + } DISCARD_TEXT(leaf) return TRUE; } @@ -568,14 +639,22 @@ void Supervisor::make_project_from_command_line(inbuild_copy *C) { pathname *P = NULL; /* result of |-project| at the command line */ if (project_bundle_request) P = project_bundle_request; if (project_file_request) F = project_file_request; - if (C == NULL) { - if (P) { - C = ProjectBundleManager::claim_folder_as_copy(P); - if (C == NULL) Errors::fatal("No such Inform project directory"); - } else if (F) { - C = ProjectFileManager::claim_file_as_copy(F); - if (C == NULL) Errors::fatal("No such Inform source file"); + if (C) { + if (C->location_if_path) { + SVEXPLAIN(1, "(project identified by parent tool: %p)\n", C->location_if_path); + } else { + SVEXPLAIN(1, "(project identified by parent tool: %f)\n", C->location_if_file); } + } else if (P) { + SVEXPLAIN(1, "(project identified by -project: %p)\n", P); + C = ProjectBundleManager::claim_folder_as_copy(P); + if (C == NULL) Errors::fatal("No such Inform project directory"); + } else if (F) { + SVEXPLAIN(1, "(project identified by -source: %f)\n", F); + C = ProjectFileManager::claim_file_as_copy(F); + if (C == NULL) Errors::fatal("No such Inform source file"); + } else { + SVEXPLAIN(1, "(no designated project)\n"); } if (C) { inform_project *proj = Projects::from_copy(C); @@ -583,6 +662,8 @@ void Supervisor::make_project_from_command_line(inbuild_copy *C) { if (F) { Projects::set_primary_source(proj, F); Projects::set_primary_output(proj, transpiled_output_file); + if (transpiled_output_file) + SVEXPLAIN(1, "(transpiled output redirected to: %f)\n", transpiled_output_file); } chosen_project = proj; } diff --git a/inbuild/supervisor-module/Chapter 2/Nests.w b/inbuild/supervisor-module/Chapter 2/Nests.w index 70be6a0dc..5203e6db5 100644 --- a/inbuild/supervisor-module/Chapter 2/Nests.w +++ b/inbuild/supervisor-module/Chapter 2/Nests.w @@ -48,6 +48,17 @@ void Nests::set_tag(inbuild_nest *N, int t) { N->tag_value = t; } +text_stream *Nests::tag_name(int t) { + switch (t) { + case MATERIALS_NEST_TAG: return I"materials"; + case EXTERNAL_NEST_TAG: return I"external"; + case GENERIC_NEST_TAG: return I"generic"; + case INTERNAL_NEST_TAG: return I"internal"; + case EXTENSION_NEST_TAG: return I"extension"; + } + return I" "; +} + @ = void Nests::protect(inbuild_nest *N) { N->read_only = TRUE; @@ -58,6 +69,12 @@ int Nests::is_protected(inbuild_nest *N) { return N->read_only; } +@ = +pathname *Nests::get_location(inbuild_nest *N) { + if (N == NULL) return NULL; + return N->location; +} + @h Search list. When we search for copies, we do so by looking through nests in a list. The following builds such lists, removing duplicates -- where duplicates are diff --git a/inbuild/supervisor-module/Chapter 4/Project Bundle Manager.w b/inbuild/supervisor-module/Chapter 4/Project Bundle Manager.w index 4b3f1771c..47c5a74fe 100644 --- a/inbuild/supervisor-module/Chapter 4/Project Bundle Manager.w +++ b/inbuild/supervisor-module/Chapter 4/Project Bundle Manager.w @@ -221,11 +221,12 @@ inbuild_copy *ProjectBundleManager::claim_folder_as_copy(pathname *P) { if (Platform::is_folder_separator(Str::get_last_char(entry)) == FALSE) { TEMPORARY_TEXT(ext) Filenames::write_extension(ext, Filenames::from_text(entry)); - if (Str::eq_insensitive(ext, I".html") == FALSE) { + if ((Str::eq_insensitive(ext, I".html") == FALSE) && + (Str::eq_insensitive(ext, I".xml") == FALSE)) { TEMPORARY_TEXT(error_text) WRITE_TO(error_text, "the 'Index' subdirectory of the project directory '%S' contains a " - "file called '%S', but can only contain HTML files", + "file called '%S', but can only contain HTML and XML files", Pathnames::directory_name(P), entry); Copies::attach_error(C, CopyErrors::new_T(PROJECT_MALFORMED_CE, -1, error_text)); DISCARD_TEXT(error_text) diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt index 45d91e032..678183082 100644 --- a/inform7/Figures/memory-diagnostics.txt +++ b/inform7/Figures/memory-diagnostics.txt @@ -1,4 +1,4 @@ -Total memory consumption was 123162K = 120 MB +Total memory consumption was 123165K = 120 MB ---- was used for 2063851 objects, in 367798 frames in 0 x 800K = 0K = 0 MB: @@ -251,7 +251,7 @@ Total memory consumption was 123162K = 120 MB 100.0% was used for memory not allocated for objects: - 57.5% text stream storage 72572840 bytes in 488028 claims + 57.5% text stream storage 72575744 bytes in 488060 claims 4.2% dictionary storage 5319680 bytes in 7630 claims ---- sorting 2752 bytes in 394 claims 5.7% source text 7200000 bytes in 3 claims diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index d40239663..5bb5eba3e 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,10 +1,10 @@ 100.0% in inform7 run - 67.3% in compilation to Inter - 45.2% in //Sequence::undertake_queued_tasks// - 4.7% in //MajorNodes::pre_pass// - 3.6% in //MajorNodes::pass_1// - 1.8% in //ImperativeDefinitions::assess_all// - 1.8% in //RTKindConstructors::compile// + 67.6% in compilation to Inter + 45.6% in //Sequence::undertake_queued_tasks// + 4.6% in //MajorNodes::pre_pass// + 3.5% in //MajorNodes::pass_1// + 1.7% in //ImperativeDefinitions::assess_all// + 1.7% in //RTKindConstructors::compile// 1.4% in //RTPhrasebook::compile_entries// 1.0% in //Sequence::lint_inter// 0.7% in //ImperativeDefinitions::compile_first_block// @@ -13,17 +13,17 @@ 0.3% in //Sequence::undertake_queued_tasks// 0.3% in //Sequence::undertake_queued_tasks// 0.3% in //World::stage_V// - 5.0% not specifically accounted for - 28.9% in running Inter pipeline - 9.0% in step 5/15: load-binary-kits - 8.3% in step 14/15: generate inform6 -> auto.inf + 5.1% not specifically accounted for + 28.7% in running Inter pipeline + 9.3% in step 5/15: load-binary-kits + 8.2% in step 14/15: generate inform6 -> auto.inf 5.7% in step 6/15: make-synoptic-module - 1.8% in step 9/15: make-identifiers-unique + 1.7% in step 9/15: make-identifiers-unique 0.3% in step 11/15: eliminate-redundant-labels 0.3% in step 12/15: eliminate-redundant-operations 0.3% in step 4/15: compile-splats 0.3% in step 7/15: shorten-wiring 0.3% in step 8/15: detect-indirect-calls - 2.1% not specifically accounted for + 1.8% not specifically accounted for 3.2% in supervisor 0.4% not specifically accounted for diff --git a/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json b/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json index 4b49eb79c..0c973f1df 100644 --- a/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json +++ b/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "BasicInformExtrasKit", - "version": "10.2.0-beta+6W51" + "version": "10.2.0-beta+6W52" }, "kit-details": { "has-priority": 1 diff --git a/inform7/Internal/Inter/BasicInformKit/kit_metadata.json b/inform7/Internal/Inter/BasicInformKit/kit_metadata.json index 0dd2a4413..b86f1b599 100644 --- a/inform7/Internal/Inter/BasicInformKit/kit_metadata.json +++ b/inform7/Internal/Inter/BasicInformKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "BasicInformKit", - "version": "10.2.0-beta+6W51" + "version": "10.2.0-beta+6W52" }, "needs": [ { "unless": { diff --git a/inform7/Internal/Inter/CommandParserKit/kit_metadata.json b/inform7/Internal/Inter/CommandParserKit/kit_metadata.json index d0e06fec2..66ec56ad4 100644 --- a/inform7/Internal/Inter/CommandParserKit/kit_metadata.json +++ b/inform7/Internal/Inter/CommandParserKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "CommandParserKit", - "version": "10.2.0-beta+6W51" + "version": "10.2.0-beta+6W52" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json b/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json index 8b7a23a4a..65f392526 100644 --- a/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json +++ b/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "EnglishLanguageKit", - "version": "10.2.0-beta+6W51" + "version": "10.2.0-beta+6W52" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/WorldModelKit/kit_metadata.json b/inform7/Internal/Inter/WorldModelKit/kit_metadata.json index 363a908d7..1a7141b74 100644 --- a/inform7/Internal/Inter/WorldModelKit/kit_metadata.json +++ b/inform7/Internal/Inter/WorldModelKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "WorldModelKit", - "version": "10.2.0-beta+6W51" + "version": "10.2.0-beta+6W52" }, "needs": [ { "need": {