[m-rev.] for review: add missing prereqs for .class files

Julien Fischer juliensf at gmail.com
Fri Oct 3 11:55:30 AEST 2025


On Thu, 2 Oct 2025 at 22:23, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
>
> On Fri, 26 Sep 2025 17:19:01 +1000, Julien Fischer <juliensf at gmail.com> wrote:
> > Ok.  So, what does cur_dir mean with respect to source file mappings across
> > directories?  (E.g where some of the Mercury source files are physically
> > located in another directory and we use source file mapping to point to them.)
> > In that case, are such mapped source files treated as being in the
> > current directory?
>
> The attached diff addresses this comment. For Julien to review post-commit.

> Fix incorrect documentation of src_cur_dir ...
>
> compiler/make.make_info.m:
>     ... and give the type a non-misleading name.
>
> compiler/make.prereqs.m:
>     Conform to the change above.
>
> compiler/make.program_target.m:
>     Fix too-long line.
>
> diff --git a/compiler/make.make_info.m b/compiler/make.make_info.m
> index a1aabdf6f..bd326c00f 100644
> --- a/compiler/make.make_info.m
> +++ b/compiler/make.make_info.m

...

> +    % Given a module named say module_a, we use values of this type to decide,
> +    % for each module imported by module_a, directly or indirectly, whether
> +    % we should require its .java file to be built before we compile
> +    % module_a.java to module_a.class. The idea is that it *the responsibility
> +    % to build module_b.java* that is local to this invocation of mmc --make.
> +    % We assume that src_is_not_local modules are in libraries that we are
> +    % now using, meaning that their .java files should have been built
> +    % when the library itself was built.
> +    %
> +    % We do not normally build .class files one by one. In java grades,
> +    % the make_linked_target_2 predicate in make.program_target.m invokes
> +    % make_class_files_for_all_program_modules, which first (re)builds
> +    % all java files in the program, and then compiles them to .class files.
> +    % The only situation in which values of this type come into play is
> +    % when a java grade compilation wants to generate .class files but
> +    % does not want to proceed to build an executable or library.
> +    % This happens e.g. when we execute the test cases in tests/valid.
> +    %
> +    % NOTE The mmake script cannot handle properly situations in which
> +    % Mercury.options contains references to modules whose sources are

s/Mercury.options/Mercury.modules/ there.

That looks fine otherwise.

Julien.


More information about the reviews mailing list