Re: Proposal: 7.2b2 today - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Proposal: 7.2b2 today
Date
Msg-id Pine.LNX.4.30.0111070031590.3607-100000@peter.localdomain
Whole thread Raw
In response to Re: Proposal: 7.2b2 today  (darcy@druid.net (D'Arcy J.M. Cain))
Responses Re: Proposal: 7.2b2 today
List pgsql-hackers
D'Arcy J.M. Cain writes:

> I have a change I would like to discuss.  It doesn't change the code
> base, only the build system.  The patches I would like to commit follow
> this text.  The only thing it does is create a config option to bytecode
> compile the Python modules.

We've seen such a patch before, but I'm still not convinced it works.
According to my knowledge, the pre-compiled bytecode files need to be
created after the source files have been installed in their final
location, because the file name and timestamp is encoded in the compiled
file (it's sort of used as a cache file).  While this can be accomplished
with a different patch, it wouldn't really work when DESTDIR is used
because you'd create a "dead" cache file.  In a sense, this operation is
like running ldconfig -- it's outside the scope of the build system.
Package managers typically put it in the "post install" section.

> +# If python is enabled (above), then optionally byte-compile the modules.
> +AC_MSG_CHECKING([whether to byte-compile Python modules])
> +if test "$with_python" = yes; then
> +  PGAC_ARG_BOOL(with, python_compile, no,
> +    [  --with-python-compile   byte-compile modules if Python is enabled])

--enable

> +else
> +  with_python_compile=no
> +fi
> +AC_MSG_RESULT([$with_python_compile])
> +AC_SUBST([with_python_compile])

> +%.pyc: %.py
> +    python -c "import py_compile; py_compile.compile(\"$<\")"
> +
> +%.pyo: %.py
> +    python -O -c "import py_compile; py_compile.compile(\"$<\")"
> +

$(PYTHON)

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: RelationFlushRelation() or RelationClearRelation()
Next
From: Bruce Momjian
Date:
Subject: Re: CREATE TABLE AS / WITHOUT OIDs?