git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] NO_PERL support

From
Jeff King <peff@peff.net>
Date
Apr 3, 2009, 13:20 UTC
Message-ID
<20090403132029.GC21153@coredump.intra.peff.net>
In-Reply-To
<20090403T065545Z@curie.orbis-terrarum.net>

[cc'ing Johannes because of some possibly related work in the test scripts; see below]

On Fri, Apr 03, 2009 at 12:03:50AM -0700, Robin H. Johnson wrote:
> The attached patch adds NO_PERL to the build system, in the same fashion
> as NO_TCLTK.

I think this is a good change. One of my less-abled test platforms has a broken perl, and I end up having to manually skip a lot of tests. Being able to set NO_PERL and have the tests themselves realize they must be skipped will be much cleaner.

Show 9 quoted lines
> Effects:
> - No perl-based scripts or code are installed:
> 	$SCRIPT_PERL
> 	git-instaweb
> 	gitweb
> 	git-cvsserver
> 	git-svn
> - git-add does NOT have interactive support.
> - None of the tests for the disabled stuff gets run.
Hmm. With this patch, a user with a NO_PERL build will just get:
  $ git svn
  git: 'svn' is not a git-command. See 'git --help'.
  $ git add -i
  error: unknown switch `i'
  usage: ...

I wonder if we should be a little nicer and say "we know about this command or option, but we did not build support for it". OTOH, what you have mirrors what NO_TCLTK does, so perhaps it is not a big deal.

Show 9 quoted lines
> @@ -1067,6 +1079,11 @@ endif
>  ifeq ($(TCLTK_PATH),)
>  NO_TCLTK=NoThanks
>  endif
> +ifeq ($(PERL_PATH),)
> +NO_PERL=NoThanks
> +export NO_PERL
> +export NO_PERL_MAKEMAKER
> +endif

Do we have to actually export here? NO_TCLTK doesn't. If it's for the test scripts, then should it be part of GIT-BUILD-OPTIONS?

Show 6 quoted lines
> +if test -n "$NO_PERL"
> +then
> +	test_expect_success 'skipping git-svn tests, NO_PERL defined' :
> +	test_done
> +	exit
> +fi

This probably got copied from an older example, but I think the recommended way to skip tests these days is to use 'say' instead of test_expect_success (since we have statistics on passing/failing tests now).

Also, it may make sense to integrate this with Johannes Sixt's test_have_prereq work (which is still in next), but I haven't looked too closely at that.

> -test_expect_success \
> +[ -z "$NO_PERL" ] && test_expect_success \

I think it is nicer to actually say "skipping test" as the other spots do instead of just not running it.

-Peff
Previous: Robin H. JohnsonNext: Johannes Schindelin
Message 2 of 30 in “NO_PERL support”
  1. NO_PERL supportRobin H. Johnson, Apr 3, 2009
  2. Jeff KingApr 3, 2009
  3. Johannes SchindelinApr 3, 2009
  4. Jeff KingApr 3, 2009
  5. Johannes SchindelinApr 3, 2009
  6. Miklos VajnaApr 3, 2009
  7. Jeff KingApr 3, 2009
  8. Johannes SixtApr 3, 2009
  9. Jeff KingApr 3, 2009
  10. Jeff KingApr 3, 2009
  11. Robin H. JohnsonApr 3, 2009
  12. Jeff KingApr 3, 2009
  13. Junio C HamanoApr 3, 2009
  14. Jeff KingApr 3, 2009
  15. Junio C HamanoApr 3, 2009
  16. Jeff KingApr 3, 2009
  17. 0/4 NO_PERL supportJeff King, Apr 3, 2009
  18. 1/4 commit: abort commit if interactive add failedJeff King, Apr 3, 2009
  19. 2/4 tests: remove exit after test_done callJeff King, Apr 3, 2009
  20. 3/4 Makefile: allow building without perlJeff King, Apr 3, 2009
  21. Robin H. JohnsonApr 4, 2009
  22. Jeff KingApr 4, 2009
  23. Robin H. JohnsonApr 4, 2009
  24. Jeff KingApr 4, 2009
  25. Robin H. JohnsonApr 5, 2009
  26. Jeff KingApr 7, 2009
  27. 4/4 tests: skip perl tests if NO_PERL is definedJeff King, Apr 3, 2009
  28. Robin H. JohnsonApr 4, 2009
  29. Jeff KingApr 4, 2009
  30. Jeff KingApr 7, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.