[m-rev.] for review: make mmc --make not symlink target file unnecessarily
Ian MacLarty
maclarty at csse.unimelb.edu.au
Wed Apr 11 13:53:46 AEST 2007
On Wed, Apr 11, 2007 at 12:56:27PM +1000, Peter Wang wrote:
> Branches: main
>
> When using mmc --make --use-grade-subdirs, don't make a symlink or copy of
> the target file to the user directory if the file in the user directory is
> already up to date. This avoids bumping the timestamp unnecessarily.
>
> compiler/compile_target_code.m:
> Make post_link_make_symlink_or_copy check the timestamp of the file
> in the user directory and do nothing if it is the same as the
> timestamp of the file to be linked/copied.
>
> Add an output argument to post_link_make_symlink_or_copy to indicate
> if the symlink/copy was made.
>
> compiler/make.program_target.m:
> Make build_linked_target_2 only write a "Made symlink/copy of ..."
> message if the symlink/copy is actually made by
> post_link_make_symlink_or_copy.
>
> Also make it warn in the case that there is nothing for mmc --make to
> do. This was previously the case only for --no-use-grade-subdirs.
>
> compiler/make.util.m:
> Change maybe_symlink_or_copy_linked_target_message to write "Made
> symlink/copy ..." rather than "Making symlink/copy ..." as the
> message is now written after the fact.
>
>
> Index: compiler/compile_target_code.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
> retrieving revision 1.105
> diff -u -r1.105 compile_target_code.m
> --- compiler/compile_target_code.m 2 Mar 2007 02:56:37 -0000 1.105
> +++ compiler/compile_target_code.m 11 Apr 2007 02:54:22 -0000
> @@ -104,13 +104,16 @@
> :- pred link(io.output_stream::in, linked_target_type::in, module_name::in,
> list(string)::in, bool::out, io::di, io::uo) is det.
>
> - % post_link_make_symlink_or_copy(TargetType, MainModuleName, Succeeded)
> + % post_link_make_symlink_or_copy(TargetType, MainModuleName, Succeeded,
> + % DidSomething)
> %
> % If `--use-grade-subdirs' is enabled, link or copy the executable or
> - % library into the user's directory after having successfully built it.
> + % library into the user's directory after having successfully built it,
> + % if the target does not exist or is not up-to-date.
> %
Perhaps describe the DidSomething argument in the comments, or alternatively
change its name to MadeSymLinkOrCopy.
Looks fine otherwise.
Ian.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list