[m-rev.] for review: build grade_lib by default

Julien Fischer jfischer at opturion.com
Tue Apr 14 19:04:51 AEST 2020



On Tue, 14 Apr 2020, Peter Wang wrote:

> On Mon, 13 Apr 2020 07:22:49 +1000 (AEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>> 
>> Build the grade_lib directory by default.
>> 
>> This should prevent bit rot in its code, such as that caused by the
>> move of the one_or_more type from list.m to one_or_more.m.
>> 
>> Mmakefile:
>>     Add grade_lib to the list of directories to build, to the list of
>>     directories in which dependencies are made, the list of directories
>>     in which tags files are made, and the list of directories to clean.
>>
>>     Do not include the grade library in source distributions. In the
>>     intended use case, the grade library modules that the compiler needs
>>     will be present in the source distribution in the *compiler* directory.
>
> configure wants to produce grade_lib/GRADE_LIB_FLAGS from
> GRADE_LIB_FLAGS.in so I think the grade_lib needs to be included
> in the source distribution.
>
> After the following change, the resulting srcdist still doesn't
> build without a bootstrap compiler. Hopefully the problem is
> obvious to someone else:
>
> make[2]: Entering directory '/tmp/mercury-srcdist-DEV/grade_lib'
> mmc --grade hlc.gc.pregen     --mercury-linkage static --flags GRADE_LIB_FLAGS      -f *.m
> ../scripts/mmc: 31: exec: /tmp/mercury-srcdist-DEV/Install/bin/mercury_compile: not found

I'll commit the following, which fixes the problem.

Julien.

diff --git a/Mmakefile b/Mmakefile
index 9a77629..018ca3d 100644
--- a/Mmakefile
+++ b/Mmakefile
@@ -150,7 +150,13 @@ compiler/$(deps_subdir)mercury_compile.dep: library/$(deps_subdir)$(STD_LIB_NAME
  	+cd compiler && $(SUBDIR_MMAKE) depend

  .PHONY: dep_grade_lib
-dep_grade_lib:
+dep_grade_lib: grade_lib/$(deps_subdir)/choose_grade.dep \
+	grade_lib/$(deps_subdir)/test_grades.dep \
+	grade_lib/$(deps_subdir)/try_all_grade_structs.dep
+
+grade_lib/$(deps_subdir)/choose_grade.dep \
+grade_lib/$(deps_subdir)/test_grades.dep \
+grade_lib/$(deps_subdir)/try_all_grade_structs.dep:
  	+cd grade_lib && $(SUBDIR_MMAKE) dep

  .PHONY: dep_slice
@@ -508,6 +514,8 @@ tar: 	$(GENERATED_DOCS)
  	+cd deep_profiler && $(SUBDIR_MMAKE) cs tags
  	+cd mfilterjavac && $(SUBDIR_MMAKE) depend
  	+cd mfilterjavac && $(SUBDIR_MMAKE) cs tags
+	+cd grade_lib && $(SUBDIR_MMAKE) depend
+	+cd grade_lib && $(SUBDIR_MMAKE) cs tags
  	+cd doc && $(SUBDIR_MMAKE) info html dvi mdb_doc
  	# the following commands might fail on Windows?
  	-cd bindist && $(SUBDIR_MMAKE) bindist.Makefile
@@ -534,7 +542,6 @@ tar: 	$(GENERATED_DOCS)
  	export ROOTNAME;						\
  	cd .. && (							\
  		mkdir stuff-to-exclude;					\
-		mv $$ROOTNAME/grade_lib stuff-to-exclude;		\
  		test -d $$ROOTNAME/bytecode && 				\
  			mv $$ROOTNAME/bytecode stuff-to-exclude; 	\
  		mv $$ROOTNAME/extras/quickcheck stuff-to-exclude;	\


More information about the reviews mailing list