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

Eliminate redundant deep dependencies #386

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

mohawk2
Copy link
Member

@mohawk2 mohawk2 commented Dec 26, 2020

EUMM-generated makefiles currently have direct dependencies e.g. from manifypods to module files under lib, which are redundant because manifypods also depends on pure_all, which indirectly depends on those module files. A particular culprit is things depending on $(FIRST_MAKEFILE) directly, rather than via config. This PR eliminates those redundant dependencies.

Here is a run of pure-perl-make --analyse-redundancy (from CPAN Make), on PDL::Stats:

$ pure-perl-make --analyse-redundancy 
Redundant direct dep: Makefile.aperl Makefile
  Recipe Makefile.aperl:0:
	$(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
	$(NOECHO) $(PERLRUNINST) \
		Makefile.PL DIR="Basic:Distr:GLM:GSL:Kmeans:TS" \
		MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
		MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
    Makefile.aperl pm_to_blib Makefile
      (already seen Makefile.aperl:0)
    Makefile.aperl static Makefile
      (already seen Makefile.aperl:0)
Redundant direct dep: all pure_all
  Recipe all:0:
	$(NOECHO) $(NOOP)
    all manifypods pure_all
      (already seen all:0)
Redundant direct dep: distdir create_distdir
  Recipe distdir:0:
	$(NOECHO) $(NOOP)
    distdir distmeta create_distdir
      (already seen distdir:0)
    distdir distmeta metafile create_distdir
      (already seen distdir:0)
Redundant direct dep: distmeta create_distdir
  Recipe distmeta:0:
	$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -e q{META.yml};' \
	  -e 'eval { maniadd({q{META.yml} => q{Module YAML meta-data (added by MakeMaker)}}) }' \
	  -e '    or die "Could not add META.yml to MANIFEST: $${'\''@'\''}"' --
	$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -f q{META.json};' \
	  -e 'eval { maniadd({q{META.json} => q{Module JSON meta-data (added by MakeMaker)}}) }' \
	  -e '    or die "Could not add META.json to MANIFEST: $${'\''@'\''}"' --
    distmeta metafile create_distdir
      (already seen distmeta:0)
Redundant direct dep: dynamic Makefile
  Recipe dynamic:0:
	$(NOECHO) $(NOOP)
    dynamic config Makefile
      (already seen dynamic:0)
Redundant direct dep: manifypods Stats.pm
  Recipe manifypods:0:
	$(NOECHO) $(POD2MAN) --section=$(MAN3SECTION) --perm_rw=$(PERM_RW) -u \
	  Stats.pm $(INST_MAN3DIR)/PDL::Stats.$(MAN3EXT) 
    manifypods pure_all pm_to_blib Stats.pm
      (already seen manifypods:0)
Redundant direct dep: manifypods config
  Recipe manifypods:0:
	$(NOECHO) $(POD2MAN) --section=$(MAN3SECTION) --perm_rw=$(PERM_RW) -u \
	  Stats.pm $(INST_MAN3DIR)/PDL::Stats.$(MAN3EXT) 
    manifypods pure_all config
      (already seen manifypods:0)
    manifypods pure_all linkext dynamic config
      (already seen manifypods:0)
Redundant direct dep: pure_all config
  Recipe pure_all:0:
	$(NOECHO) $(NOOP)
	$(NOECHO) $(NOOP)
    pure_all linkext dynamic config
      (already seen pure_all:0)
Redundant direct dep: subdirs-test_dynamic dynamic
  Recipe subdirs-test_dynamic:0:
	$(NOECHO) cd Basic && $(MAKE) test_dynamic $(PASTHRU)
	$(NOECHO) cd Distr && $(MAKE) test_dynamic $(PASTHRU)
	$(NOECHO) cd GLM && $(MAKE) test_dynamic $(PASTHRU)
	$(NOECHO) cd GSL && $(MAKE) test_dynamic $(PASTHRU)
	$(NOECHO) cd Kmeans && $(MAKE) test_dynamic $(PASTHRU)
	$(NOECHO) cd TS && $(MAKE) test_dynamic $(PASTHRU)
    subdirs-test_dynamic pure_all linkext dynamic
      (already seen subdirs-test_dynamic:0)
Redundant direct dep: testdb_dynamic dynamic
  Recipe testdb_dynamic:0:
	PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
    testdb_dynamic pure_all linkext dynamic
      (already seen testdb_dynamic:0)
Redundant direct dep: testdb_static static
  Recipe testdb_static:0:
	PERL_DL_NONLAZY=1 "/home/osboxes/PDL-Stats/$(MAP_TARGET)" $(MAP_PERLINC) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
    testdb_static perl Makefile.aperl static
      (already seen testdb_static:0)

The makefile for Graph is visualised here, using tkgvizmakefile (not PDL::Stats which is too big as it has 5 subdirs, and the tool pulls in all the recursive makefiles):

tf dot

The bottom left shows distdir depending on create_distdir both directly (and redundantly), but also via distmeta.

@haarg haarg marked this pull request as draft December 27, 2020 05:33
@haarg
Copy link
Member

haarg commented May 18, 2022

Why is it a problem to have these dependencies? If the manifypods target uses the files directly, it seems appropriate to have direct dependencies on the files.

@mohawk2
Copy link
Member Author

mohawk2 commented May 18, 2022

That's an excellent point (and possibly showing I chose the example poorly)! However, that highlights to me that manifypods should actually depend on the .pm files, not on pure_all?

@Leont
Copy link
Member

Leont commented May 18, 2022

However, that highlights to me that manifypods should actually depend on the .pm files, not on pure_all?

That would have made more sense, but odds are something somewhere is depending on this because it overrides pure_all specifically and not adding .pm entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants