Re: [PATCH util/macros 1/2] Create CHANGELOG/INSTALL_CMD .tmp files in builddir

2017-01-30 Thread Peter Hutterer
On Mon, Jan 30, 2017 at 07:09:32PM +, Emil Velikov wrote:
> Related questions:
> Do you know of a script/semi-automated way to create a modfile to feed
> into release.sh ?
> I'm likely blind, but it seems that build.sh does not have an option
> to only pull/clone the repos, without building, does it ? I would be
> nice to do so and use release.sh which already does enough build/etc.
> checking/testing.
> 
> Looking at build.sh I ended up adding 90 missing repos with fonts,
> uitils, docs, others still to check/add. Not sure if/how much are
> supposed to be legacy/deprecated but we shall see - if the newly added
> ones start failing I'll just pull them out.

build.sh -L should list all repos but yeah, there is no option to just clone
all of them short of adding a return in process(). I'd happily merge a patch
for that though because by sheer coincidence I needed it last week ;)

I'd say any modules missing from build.sh should be either abandoned or
added to build.sh, depending on the repository state.

Cheers,
   Peter
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util/macros 1/2] Create CHANGELOG/INSTALL_CMD .tmp files in builddir

2017-01-30 Thread Emil Velikov
Hi Gaetan,

Thanks for the extensive answer. I hope with my replies below things
should be much clearer.

On 30 January 2017 at 15:18, Gaetan Nadon  wrote:

> I no longer have a development environment so I cannot try anything.
>
> Maybe I missed the core idea of the patches. The srcdir is read only,
> correct?
>
s/is read-only/is read-only outside of the initial make dist/

To elaborate a bit - afaict make distcheck does the following
 - initial make dist
 - extract tarball, and run make all, make check, make dist (I'll
refer to this secondary one) et al.

> Unless I remember it incorrectly, the INSTALL and ChangeLog files are
> generated in the srcdir as they would normally be checked-in in git.
> Automake expects them to be there. It is the Xorg project who decided to
> generate them, not Automake. This situation is not "normal" to begin with.
>
Agreed.

> I assume you tried to build a git repo (AKA module) with the source code
> sitting on a read-only filesystem. Correct?
>
Not quite - I've reworked (simplified?) release.sh which pointed out
the (ab)use here.

> What are the reported failures?  Did the build stop because an O/S error? Or
> was it just that both files did not get generated.
>
In a gist "make distcheck failed" - upon the second `make dist' there
was an IO error.


Note: the INSTALL case is extra picky, so let's assume that all cases
below are dealing with ChangeLog.

> Currently: the INSTALL_CMD copies the INSTALL file from the datadir to
> top_srcdir/.INSTALL.tmp which is RO. That should fail on a RO filesystem,
> correct? IS that the problem you are trying to solve?
>
Precisely.

> Proposed patch: the INSTALL_CMD copies the INSTALL file from the datadir to
> top_builddir/.INSTALL.tmp/ which is RW.  That should work. A .INSTALL.tmp
> file now sits among the object code created by the compiler.
>
Correct.

> Next the top_builddir/.INSTALL.tmp is moved to the top_srcdir/INSTALL on a
> filesystem which is RO. That should equally fail, correct?
>
> I am assuming that if one cannot copy a file onto a RO filesystem, then one
> cannot move a file in there as well. Correct?
>
This part will succeed during the initial "make dist". The secondary
one has srcdir as RO so we'll end up in the "else" statement - rm
.FOO.tmp; touch FOO.

Note that if we reach the "else", we're
a) RO/RW file system and the file is present - touch is a
no-op/succeeds, respectively or
b) RW file system and the file is missing (building from a tarball and
manually removed the file) - touch will create a dummy one.

> On another topic, any change in the macros affect all modules (or git repos)
> in the X project. Extensive testing is required. The fix must also be
> backwards compatible with existing tarballs floating in the field.To get
> started quickly, try a few modules that have generated code and
> documentation. These are good test cases. As I remember it, all modules
> listed in build.sh built successfully with make dist.
>
I might be overly confident, but barring crazy hacks elsewhere things
should work across the board.
Then again, I was expecting xorg-macros to be missing blatant bugs so
I'm updating the script and pulling $world just in case.

Related questions:
Do you know of a script/semi-automated way to create a modfile to feed
into release.sh ?
I'm likely blind, but it seems that build.sh does not have an option
to only pull/clone the repos, without building, does it ? I would be
nice to do so and use release.sh which already does enough build/etc.
checking/testing.

Looking at build.sh I ended up adding 90 missing repos with fonts,
uitils, docs, others still to check/add. Not sure if/how much are
supposed to be legacy/deprecated but we shall see - if the newly added
ones start failing I'll just pull them out.

> A more general question, would a module generating source using lex and yacc
> would build on a RO filesystem?
>
> The requirement here is that the generated code requires lex and yacc
> programs to generate some C code when the repo is "configured" (autogen.sh).
> That generated code is then shipped in a tarball where the tarball builder
> only compiles the C generated code without the need to have the lex and yacc
> programs installed. A tarball builder may not run autogen.sh as this is a
> module configuration step and not a build step.
>
IMHO [definitely _not_ an expert wrt generated files] these ought to
be handled like INSTALL/ChangeLog - generate once at initial [non RO]
make dist, etc. Such that building from tarball is OK, even if one
does make clean.

Tl;Dr; Fully agree.


IIRC in mesa we generate those files in builddir and think that we
purge them in make clean stage.
It's been on my list of things to check/fix but other distractions
keep on coming up ;-)


> If your organization has a build strategy to use shared shared RO
> filesystems, this may not work for some modules. I had never seen this tried
> before. The INSTALL and ChangeLog files are not the only 

Re: [PATCH util/macros 1/2] Create CHANGELOG/INSTALL_CMD .tmp files in builddir

2017-01-30 Thread Emil Velikov
On 30 January 2017 at 00:28, Peter Hutterer  wrote:
> On Fri, Jan 27, 2017 at 02:32:48PM +, Emil Velikov wrote:
>> On 27 January 2017 at 04:53, Peter Hutterer  wrote:
>> > On Thu, Jan 26, 2017 at 05:53:19PM +, Emil Velikov wrote:
>> >> From: Emil Velikov 
>> >>
>> >> Under normal build rules one should consider srcdir as RO, thus creating
>> >> files in srcdir is going to fail.
>> >>
>> >> This was flagged with a recent work in release.sh
>> >>
>> >> Cc: Peter Hutterer 
>> >> Cc: Gaetan Nadon 
>> >> Signed-off-by: Emil Velikov 
>> >> ---
>> >>  xorg-macros.m4.in | 6 +++---
>> >>  xorgversion.m4| 6 +++---
>> >>  2 files changed, 6 insertions(+), 6 deletions(-)
>> >>
>> >> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
>> >> index 2ed7837..675d07d 100644
>> >> --- a/xorg-macros.m4.in
>> >> +++ b/xorg-macros.m4.in
>> >> @@ -1837,9 +1837,9 @@ m4_ifdef([AM_SILENT_RULES], 
>> >> [AM_SILENT_RULES([yes])],
>> >>  AC_DEFUN([XORG_INSTALL], [
>> >>  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
>> >>  macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir 
>> >> xorg-macros`
>> >> -INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" 
>> >> \$(top_srcdir)/.INSTALL.tmp && \
>> >> -mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
>> >> -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
>> >> +INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" 
>> >> \$(top_builddir)/.INSTALL.tmp && \
>> >> +mv \$(top_builddir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
>> >
>> > aren't you still trying to create files in srcdir here? or is there
>> > something outside the context that makes it sufficient to have 
>> > .INSTALL.tmp?
>> >
>> There's a, small, subtle difference in the rules:
>> INSTALL_CMD has an initial condition/command meaning "do we have
>> xorg-macros on the system" while the changelog one "is git around + is
>> foo/.git a git repo".
>
> the only time we care about generating install or changelog is during make
> dist, and that's done in the worktree now and should assume a RO srcdir,
> right?
>
>> For the latter one can reasonably say - yes the command will succeed
>> _only_ on the first iteration of make dist, with any consecutive
>> iterations/build commands (remember it's a .PHONY thus it gets called
>> everytime we do make) will fall-back to the "else" statement.
>
> it's a dependency of dist-hook though, at least in the server. so it'll only
> get called on make dist.
>
>> While the part "mv builddir/foo.tmp srcdir/foo" seems a bit abusive
>> it's the most elegant solution that I can think of. Note the "touch"
>> in the else case is a no-op since the file should already be there.
>> Admittedly we can omit it and error out in the [extremely unlikely]
>> case that file is missing.
>
> I think you're reading too much into this. all I'm suggesting is a
> s/top_srcdir/top_builddir/ here :) which possibly maybe theoretically should
> just work :)
>
It didn't last time I've checked. File will be created in builddir
thus make clean will have to nuke it.
Since the file(s) are meant to be purged only with make
maintainer-clean (as per the Makefile) thus distcheck bails out with
"remaining file..."

It's perfectly possible that I've butchered something, so please give
it a try on your end.

Thanks
Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util/macros 1/2] Create CHANGELOG/INSTALL_CMD .tmp files in builddir

2017-01-30 Thread Emil Velikov
[adding back the xorg-devel ML]

On 28 January 2017 at 18:35, Gaetan Nadon  wrote:
> On 01/27/2017 09:32 AM, Emil Velikov wrote:
>
> aren't you still trying to create files in srcdir here? or is there
> something outside the context that makes it sufficient to have .INSTALL.tmp?
>
> I failed to understand your response to Peter's question.
In that case, I might not have understood his question I'm afraid. Can
anyone elaborate please ?

> Somehow both the
> INSTALL and the ChangeLog files will be missing from the generated tarball.
> Those files were missing or never up-to-date in git, that is why they are
> generated at build time. They are non of the less "source" files which
> always introduce complications in the build process.
>
Fully agree that the files should always be inside the tarball and
they are a bit picky at times.
I think you're getting confused by the icky looking diff - things work
as expected and files are created as applicable.
I've used the recently updated release.sh [1], which does ./autogen.sh
&& make distcheck.

[1] 
https://cgit.freedesktop.org/xorg/util/modular/commit/?id=b5cffea256d8e2832c683a7231b92de126e99158

> It looks like the patch will work business as usual on RW srcdir, but not on
> RO srcdir. I don't recall anyone ever trying this scenario so this is new
> territory.
>
> In any case, from memory, here are some of the scenarios you should test to
> ensure no regressions:
>
> Extract source from a git repository to an empty directory
>
> run autogen.sh
> make all
> make INSTALL before and after removing it
> make CHANGELOG before and after removing it
> make dist
> The tarball should be complete with INSTALL and ChangeLog
>
Regardless of the above (distcheck) I've done the following:

git clone ...libXi && libXi
./autogen.sh && make all - both install and changelog are OK
make INSTALL - file is OK
rm -f INSTALL && make INSTALL - file is OK
make ChangeLog - file is OK
rm -f ChangeLog && make ChangeLog - file is OK
make dist && tar -xaf libXi...gz  - both files are inside and
correctly generated.

> Same as above but with an "out of source dir"
>
git clean -fxd && rm -rf ../bb && mkdir ../bb && cd ../bb

Then I've repeated the above steps. Barring the
s|./autogen.sh|../autogen.sh| everything was identical - from commands
to results.

> Extract the tarball generated above (assuming the content is complete).
> Preferably run from a terminal with no access to git.
>
> do not run autogen (hopefully the autogen.sh file is absent)
> make all
> make dist
> Inspect the generated tarball after make dist.  The initial tarball contains
> all the source so it can generate a new tarball.
> make INSTALL before and after removing it
> make CHANGELOG before and after removing it
>
> All these scenarios represent real life usage. They are very useful to find
> bugs even if they are not related to the scenario itself.
>
Similarly - things still work as expected (used mv git{,-foo} just in case).
Admittedly the error messages are somewhat misleading so [re]wording
suggestions are appreciated.

Note: It's possible that I coffee hasn't kicked in so please point out
if I'm missing something obvious.

> Note: I am no longer on any X list.
Ack, Thanks for taking a look and your previous work in the area.

-Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util/macros 1/2] Create CHANGELOG/INSTALL_CMD .tmp files in builddir

2017-01-29 Thread Peter Hutterer
On Fri, Jan 27, 2017 at 02:32:48PM +, Emil Velikov wrote:
> On 27 January 2017 at 04:53, Peter Hutterer  wrote:
> > On Thu, Jan 26, 2017 at 05:53:19PM +, Emil Velikov wrote:
> >> From: Emil Velikov 
> >>
> >> Under normal build rules one should consider srcdir as RO, thus creating
> >> files in srcdir is going to fail.
> >>
> >> This was flagged with a recent work in release.sh
> >>
> >> Cc: Peter Hutterer 
> >> Cc: Gaetan Nadon 
> >> Signed-off-by: Emil Velikov 
> >> ---
> >>  xorg-macros.m4.in | 6 +++---
> >>  xorgversion.m4| 6 +++---
> >>  2 files changed, 6 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> >> index 2ed7837..675d07d 100644
> >> --- a/xorg-macros.m4.in
> >> +++ b/xorg-macros.m4.in
> >> @@ -1837,9 +1837,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
> >>  AC_DEFUN([XORG_INSTALL], [
> >>  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
> >>  macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir 
> >> xorg-macros`
> >> -INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp 
> >> && \
> >> -mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
> >> -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
> >> +INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" 
> >> \$(top_builddir)/.INSTALL.tmp && \
> >> +mv \$(top_builddir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
> >
> > aren't you still trying to create files in srcdir here? or is there
> > something outside the context that makes it sufficient to have .INSTALL.tmp?
> >
> There's a, small, subtle difference in the rules:
> INSTALL_CMD has an initial condition/command meaning "do we have
> xorg-macros on the system" while the changelog one "is git around + is
> foo/.git a git repo".

the only time we care about generating install or changelog is during make
dist, and that's done in the worktree now and should assume a RO srcdir,
right? 

> For the latter one can reasonably say - yes the command will succeed
> _only_ on the first iteration of make dist, with any consecutive
> iterations/build commands (remember it's a .PHONY thus it gets called
> everytime we do make) will fall-back to the "else" statement.

it's a dependency of dist-hook though, at least in the server. so it'll only
get called on make dist.

> While the part "mv builddir/foo.tmp srcdir/foo" seems a bit abusive
> it's the most elegant solution that I can think of. Note the "touch"
> in the else case is a no-op since the file should already be there.
> Admittedly we can omit it and error out in the [extremely unlikely]
> case that file is missing.

I think you're reading too much into this. all I'm suggesting is a
s/top_srcdir/top_builddir/ here :) which possibly maybe theoretically should
just work :)

Cheers,
   Peter

> 
> In the former (INSTALL) case, one _cannot_ expect builders to remove
> xorg-macros.pc. Thus we end up overwriting the file (as seen in 2/2) a
> bit too often. An alternative solution is something like the
> following:
> 
>  - create builddir/FOO.tmp file
>  - diff srcdir/FOO and builddir/FOO.tmp -> rm builddir/FOO.tmp if the
> same, mv otherwise.
>  - failed to create FOO.tmp -> rm builddir/FOO.tmp; touch srcdir/FOO
> (we could consider the above comment, dropping touch and adding the
> extra pedantic error if the file is missing)
> 
> The above logic can be applied for the ChangeLog rule as well...
> albeit it won't make much difference in the end result.
> 
> I realise that things are a bit convoluted/confusing, it took me a few
> runs to consider the possibilities and come with something that' not
> too hacky.
> I'd really appreciate if people can let me know how much/which of the
> above/similar information would be appreciated - be that in commit
> summary/inline comments/etc.
> 
> Thanks
> Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util/macros 1/2] Create CHANGELOG/INSTALL_CMD .tmp files in builddir

2017-01-27 Thread Emil Velikov
On 27 January 2017 at 04:53, Peter Hutterer  wrote:
> On Thu, Jan 26, 2017 at 05:53:19PM +, Emil Velikov wrote:
>> From: Emil Velikov 
>>
>> Under normal build rules one should consider srcdir as RO, thus creating
>> files in srcdir is going to fail.
>>
>> This was flagged with a recent work in release.sh
>>
>> Cc: Peter Hutterer 
>> Cc: Gaetan Nadon 
>> Signed-off-by: Emil Velikov 
>> ---
>>  xorg-macros.m4.in | 6 +++---
>>  xorgversion.m4| 6 +++---
>>  2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
>> index 2ed7837..675d07d 100644
>> --- a/xorg-macros.m4.in
>> +++ b/xorg-macros.m4.in
>> @@ -1837,9 +1837,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
>>  AC_DEFUN([XORG_INSTALL], [
>>  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
>>  macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir 
>> xorg-macros`
>> -INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp 
>> && \
>> -mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
>> -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
>> +INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_builddir)/.INSTALL.tmp 
>> && \
>> +mv \$(top_builddir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
>
> aren't you still trying to create files in srcdir here? or is there
> something outside the context that makes it sufficient to have .INSTALL.tmp?
>
There's a, small, subtle difference in the rules:
INSTALL_CMD has an initial condition/command meaning "do we have
xorg-macros on the system" while the changelog one "is git around + is
foo/.git a git repo".

For the latter one can reasonably say - yes the command will succeed
_only_ on the first iteration of make dist, with any consecutive
iterations/build commands (remember it's a .PHONY thus it gets called
everytime we do make) will fall-back to the "else" statement.

While the part "mv builddir/foo.tmp srcdir/foo" seems a bit abusive
it's the most elegant solution that I can think of. Note the "touch"
in the else case is a no-op since the file should already be there.
Admittedly we can omit it and error out in the [extremely unlikely]
case that file is missing.

In the former (INSTALL) case, one _cannot_ expect builders to remove
xorg-macros.pc. Thus we end up overwriting the file (as seen in 2/2) a
bit too often. An alternative solution is something like the
following:

 - create builddir/FOO.tmp file
 - diff srcdir/FOO and builddir/FOO.tmp -> rm builddir/FOO.tmp if the
same, mv otherwise.
 - failed to create FOO.tmp -> rm builddir/FOO.tmp; touch srcdir/FOO
(we could consider the above comment, dropping touch and adding the
extra pedantic error if the file is missing)

The above logic can be applied for the ChangeLog rule as well...
albeit it won't make much difference in the end result.

I realise that things are a bit convoluted/confusing, it took me a few
runs to consider the possibilities and come with something that' not
too hacky.
I'd really appreciate if people can let me know how much/which of the
above/similar information would be appreciated - be that in commit
summary/inline comments/etc.

Thanks
Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util/macros 1/2] Create CHANGELOG/INSTALL_CMD .tmp files in builddir

2017-01-26 Thread Peter Hutterer
On Thu, Jan 26, 2017 at 05:53:19PM +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> Under normal build rules one should consider srcdir as RO, thus creating
> files in srcdir is going to fail.
> 
> This was flagged with a recent work in release.sh
> 
> Cc: Peter Hutterer 
> Cc: Gaetan Nadon 
> Signed-off-by: Emil Velikov 
> ---
>  xorg-macros.m4.in | 6 +++---
>  xorgversion.m4| 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> index 2ed7837..675d07d 100644
> --- a/xorg-macros.m4.in
> +++ b/xorg-macros.m4.in
> @@ -1837,9 +1837,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
>  AC_DEFUN([XORG_INSTALL], [
>  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
>  macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
> -INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && 
> \
> -mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
> -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
> +INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_builddir)/.INSTALL.tmp 
> && \
> +mv \$(top_builddir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \

aren't you still trying to create files in srcdir here? or is there
something outside the context that makes it sufficient to have .INSTALL.tmp?

same below and in the next hunk

Cheers,
   Peter

> +|| (rm -f \$(top_builddir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
>  echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing 
> possibly empty INSTALL.' >&2)"
>  AC_SUBST([INSTALL_CMD])
>  ]) # XORG_INSTALL
> diff --git a/xorgversion.m4 b/xorgversion.m4
> index 19f2ffd..b037cb3 100644
> --- a/xorgversion.m4
> +++ b/xorgversion.m4
> @@ -56,9 +56,9 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
>  #
>  #
>  AC_DEFUN([XORG_CHANGELOG], [
> -CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > 
> \$(top_srcdir)/.changelog.tmp && \
> -mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
> -|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
> +CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > 
> \$(top_builddir)/.changelog.tmp && \
> +mv \$(top_builddir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
> +|| (rm -f \$(top_builddir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
>  echo 'git directory not found: installing possibly empty changelog.' >&2)"
>  AC_SUBST([CHANGELOG_CMD])
>  ]) # XORG_CHANGELOG
> -- 
> 2.11.0
> 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH util/macros 1/2] Create CHANGELOG/INSTALL_CMD .tmp files in builddir

2017-01-26 Thread Emil Velikov
From: Emil Velikov 

Under normal build rules one should consider srcdir as RO, thus creating
files in srcdir is going to fail.

This was flagged with a recent work in release.sh

Cc: Peter Hutterer 
Cc: Gaetan Nadon 
Signed-off-by: Emil Velikov 
---
 xorg-macros.m4.in | 6 +++---
 xorgversion.m4| 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index 2ed7837..675d07d 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -1837,9 +1837,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
 AC_DEFUN([XORG_INSTALL], [
 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
-INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
-mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
-|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_builddir)/.INSTALL.tmp && 
\
+mv \$(top_builddir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_builddir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing 
possibly empty INSTALL.' >&2)"
 AC_SUBST([INSTALL_CMD])
 ]) # XORG_INSTALL
diff --git a/xorgversion.m4 b/xorgversion.m4
index 19f2ffd..b037cb3 100644
--- a/xorgversion.m4
+++ b/xorgversion.m4
@@ -56,9 +56,9 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
 #
 #
 AC_DEFUN([XORG_CHANGELOG], [
-CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > 
\$(top_srcdir)/.changelog.tmp && \
-mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
-|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > 
\$(top_builddir)/.changelog.tmp && \
+mv \$(top_builddir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_builddir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
 echo 'git directory not found: installing possibly empty changelog.' >&2)"
 AC_SUBST([CHANGELOG_CMD])
 ]) # XORG_CHANGELOG
-- 
2.11.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel