* Mopre fun with vcswitness
@ 2014-01-12 20:07 Eric S. Raymond
2014-01-12 20:14 ` Andreas Schwab
2014-01-12 20:18 ` David Kastrup
0 siblings, 2 replies; 20+ messages in thread
From: Eric S. Raymond @ 2014-01-12 20:07 UTC (permalink / raw)
To: emacs-devel
This as meant to be a reply to Eli's last, but I dropped that mail somehow.
With current trunk (115999) and one line of instrumebtation added,
this is what I see doing an in-place build:
dirstate='.bzr/checkout/dirstate'; \
vcswitness='$(srcdir)/../'$dirstate; \
[ -r "./$dirstate" ] || vcswitness=''; \
cd src || exit; \
boot=bootstrap-emacs; \
[ ! -x "$boot" ] || boot=''; \
echo "VCSWITNESS: $vcswitness";\
make all \
CC='gcc -std=gnu99' CFLAGS='-g3 -O2' CPPFLAGS='' \
LDFLAGS='' MAKE='make' BOOTSTRAPEMACS="$boot" \
VCSWITNESS="$vcswitness"
VCSWITNESS: $(srcdir)/../.bzr/checkout/dirstate
While this is nonempty, it's not going to work either.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
"The state calls its own violence `law', but that of the individual `crime'"
-- Max Stirner
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Mopre fun with vcswitness
2014-01-12 20:07 Mopre fun with vcswitness Eric S. Raymond
@ 2014-01-12 20:14 ` Andreas Schwab
2014-01-12 21:08 ` Eli Zaretskii
2014-01-12 20:18 ` David Kastrup
1 sibling, 1 reply; 20+ messages in thread
From: Andreas Schwab @ 2014-01-12 20:14 UTC (permalink / raw)
To: Eric S. Raymond; +Cc: emacs-devel
esr@thyrsus.com (Eric S. Raymond) writes:
> VCSWITNESS: $(srcdir)/../.bzr/checkout/dirstate
>
> While this is nonempty, it's not going to work either.
It will work once you feed it through make. Look up `recursively
expanded variables' in the make manual.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Mopre fun with vcswitness
2014-01-12 20:14 ` Andreas Schwab
@ 2014-01-12 21:08 ` Eli Zaretskii
0 siblings, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2014-01-12 21:08 UTC (permalink / raw)
To: Andreas Schwab; +Cc: esr, emacs-devel
> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Sun, 12 Jan 2014 21:14:44 +0100
> Cc: emacs-devel@gnu.org
>
> esr@thyrsus.com (Eric S. Raymond) writes:
>
> > VCSWITNESS: $(srcdir)/../.bzr/checkout/dirstate
> >
> > While this is nonempty, it's not going to work either.
>
> It will work once you feed it through make.
Indeed. srcdir is expanded by Make when it processes src/Makefile,
which is the reason for the ".." part.
Eric, you need to show the value inside src/Makefile, where it is used
as a dependency.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Mopre fun with vcswitness
2014-01-12 20:07 Mopre fun with vcswitness Eric S. Raymond
2014-01-12 20:14 ` Andreas Schwab
@ 2014-01-12 20:18 ` David Kastrup
2014-01-12 20:31 ` Eric S. Raymond
2014-01-12 21:12 ` Eli Zaretskii
1 sibling, 2 replies; 20+ messages in thread
From: David Kastrup @ 2014-01-12 20:18 UTC (permalink / raw)
To: emacs-devel
esr@thyrsus.com (Eric S. Raymond) writes:
> This as meant to be a reply to Eli's last, but I dropped that mail somehow.
>
> With current trunk (115999) and one line of instrumebtation added,
> this is what I see doing an in-place build:
>
> dirstate='.bzr/checkout/dirstate'; \
> vcswitness='$(srcdir)/../'$dirstate; \
> [ -r "./$dirstate" ] || vcswitness=''; \
> cd src || exit; \
> boot=bootstrap-emacs; \
> [ ! -x "$boot" ] || boot=''; \
> echo "VCSWITNESS: $vcswitness";\
> make all \
> CC='gcc -std=gnu99' CFLAGS='-g3 -O2' CPPFLAGS='' \
> LDFLAGS='' MAKE='make' BOOTSTRAPEMACS="$boot" \
> VCSWITNESS="$vcswitness"
> VCSWITNESS: $(srcdir)/../.bzr/checkout/dirstate
>
> While this is nonempty, it's not going to work either.
I don't see that. For an in-place build, srcdir will be '.', so after
cd src, VCSWITNESS will be correct.
The overall look is highly suspicious for srcdir being different from
. but for . itself it would seem like it would work.
No idea whether it is by accident more than by design: that would have
to be seen by taking a look at the results for a non-in-place build.
--
David Kastrup
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Mopre fun with vcswitness
2014-01-12 20:18 ` David Kastrup
@ 2014-01-12 20:31 ` Eric S. Raymond
2014-01-12 20:46 ` David Kastrup
2014-01-12 21:12 ` Eli Zaretskii
1 sibling, 1 reply; 20+ messages in thread
From: Eric S. Raymond @ 2014-01-12 20:31 UTC (permalink / raw)
To: David Kastrup; +Cc: emacs-devel
David Kastrup <dak@gnu.org>:
> > VCSWITNESS: $(srcdir)/../.bzr/checkout/dirstate
> >
> > While this is nonempty, it's not going to work either.
>
> I don't see that.
I believe you. Which just increases my distrust of this code.
You and I and Eli are running in environments we think ought not to be
significantly different (in-place builds) and yet we get at least two
and possibly three different behaviors (Eli hasn't reported his
exactly enough for me to be sure).
To add to the fun, I think this is different behavior than I was
previously seeing from putatively identical code. There's got to be
some hidden state we're all missing.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Mopre fun with vcswitness
2014-01-12 20:31 ` Eric S. Raymond
@ 2014-01-12 20:46 ` David Kastrup
2014-01-12 21:02 ` Eric S. Raymond
0 siblings, 1 reply; 20+ messages in thread
From: David Kastrup @ 2014-01-12 20:46 UTC (permalink / raw)
To: emacs-devel
"Eric S. Raymond" <esr@thyrsus.com> writes:
> David Kastrup <dak@gnu.org>:
>> > VCSWITNESS: $(srcdir)/../.bzr/checkout/dirstate
>> >
>> > While this is nonempty, it's not going to work either.
>>
>> I don't see that.
>
> I believe you. Which just increases my distrust of this code.
>
> You and I and Eli are running in environments we think ought not to be
> significantly different (in-place builds) and yet we get at least two
> and possibly three different behaviors (Eli hasn't reported his
> exactly enough for me to be sure).
"I don't see that" does not mean that I see a particular behavior when
running the code (I did not do so), but it rather means that I don't
agree with your conclusion.
> To add to the fun, I think this is different behavior than I was
> previously seeing from putatively identical code.
Where "putatively" means what _you_ remember being identical. I already
opined that I consider it most likely you forgot a \ in your added code,
leading to different shell instances defining and printing vcswitness.
Quite a common Makefile fallacy. An ugly design decision in my opinion,
but then it's been around for more than 30 years I think, so it's not
really likely to change.
> There's got to be some hidden state we're all missing.
Because you cannot reproduce what you think you saw before? That's a
mystery nobody but yourself has a chance of addressing.
--
David Kastrup
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Mopre fun with vcswitness
2014-01-12 20:46 ` David Kastrup
@ 2014-01-12 21:02 ` Eric S. Raymond
0 siblings, 0 replies; 20+ messages in thread
From: Eric S. Raymond @ 2014-01-12 21:02 UTC (permalink / raw)
To: David Kastrup; +Cc: emacs-devel
David Kastrup <dak@gnu.org>:
> Where "putatively" means what _you_ remember being identical. I already
> opined that I consider it most likely you forgot a \ in your added code,
> leading to different shell instances defining and printing vcswitness.
No, whatever other mistakes I may have made, that wasn't one of them. The
aligned column of backslashes off to the right is helpful that way. I've
been *very* aware of them the whole time.
It would probably be a good idea for somebody tp put a permanent line
of instrumentation in there so we all know we're seeing the sane report.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Mopre fun with vcswitness
2014-01-12 20:18 ` David Kastrup
2014-01-12 20:31 ` Eric S. Raymond
@ 2014-01-12 21:12 ` Eli Zaretskii
2014-01-12 21:30 ` David Kastrup
2014-01-12 22:19 ` More " Jan Djärv
1 sibling, 2 replies; 20+ messages in thread
From: Eli Zaretskii @ 2014-01-12 21:12 UTC (permalink / raw)
To: David Kastrup; +Cc: emacs-devel
> From: David Kastrup <dak@gnu.org>
> Date: Sun, 12 Jan 2014 21:18:20 +0100
>
> The overall look is highly suspicious for srcdir being different
> from .
srcdir should always be a relative file name, like ../foo, never
absolute.
Does it still look suspicious under that assumption?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Mopre fun with vcswitness
2014-01-12 21:12 ` Eli Zaretskii
@ 2014-01-12 21:30 ` David Kastrup
2014-01-12 22:19 ` More " Jan Djärv
1 sibling, 0 replies; 20+ messages in thread
From: David Kastrup @ 2014-01-12 21:30 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> From: David Kastrup <dak@gnu.org>
>> Date: Sun, 12 Jan 2014 21:18:20 +0100
>>
>> The overall look is highly suspicious for srcdir being different
>> from .
>
> srcdir should always be a relative file name, like ../foo, never
> absolute.
>
> Does it still look suspicious under that assumption?
Yes. I am not saying "guilty", I am saying "suspicious". While the
U.S. justice system makes it very expensive to get differentiation
between "guilty" and "suspicious", it's still a valid distinction.
But it looks filthy enough to be viewed as within three hops of a
genuine bug.
At any rate, even with relative paths I'd not expect to see
VCSWITNESS: $(srcdir)/../.bzr/checkout/dirstate
but rather
VCSWITNESS: ../$(srcdir)/.bzr/checkout/dirstate
since it is hard to imagine that the former would work for _anything_
but srcdir=. here.
The same holds for the current
vcswitness='$$(srcdir)/../'$$dirstate; \
which would seem, used from within the src subdirectory, to have to
rather be
vcswitness='../$$(srcdir)/'$$dirstate; \
It would seem that srcdir=. is the _only_ value for which this would
work. Which is also likely the most common value, namely the one for
in-place builds.
--
David Kastrup
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-12 21:12 ` Eli Zaretskii
2014-01-12 21:30 ` David Kastrup
@ 2014-01-12 22:19 ` Jan Djärv
2014-01-13 2:46 ` Glenn Morris
1 sibling, 1 reply; 20+ messages in thread
From: Jan Djärv @ 2014-01-12 22:19 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: David Kastrup, emacs-devel
Hello.
12 jan 2014 kl. 22:12 skrev Eli Zaretskii <eliz@gnu.org>:
> srcdir should always be a relative file name, like ../foo, never
> absolute.
Is this the srcdir used when compiling in a separate directory?
Then there is a problem. See bug 15795 (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15795#11) where this was said:
4 nov 2013 kl. 09:10 skrev Glenn Morris <rgm@gnu.org>:
>
> PS try configuring your out-of-tree build using an absolute path to the
> srcdir.
So srcdir is recommended to be absolute in this case. Not that I've seen anywhere stating that separate build directory should use relative paths.
Of course if compile mode was smarter this could go away.
Ignore if you are talking about another srcdir.
Jan D.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-12 22:19 ` More " Jan Djärv
@ 2014-01-13 2:46 ` Glenn Morris
2014-01-13 3:50 ` Eli Zaretskii
0 siblings, 1 reply; 20+ messages in thread
From: Glenn Morris @ 2014-01-13 2:46 UTC (permalink / raw)
To: Jan Djärv; +Cc: Eli Zaretskii, emacs-devel
Jan Djärv wrote:
> 12 jan 2014 kl. 22:12 skrev Eli Zaretskii <eliz@gnu.org>:
>
>> srcdir should always be a relative file name, like ../foo, never
>> absolute.
>
> Is this the srcdir used when compiling in a separate directory?
Yes, you are right, it may or may not be absolute.
Personally I don't see a problem, since '$srcdir' is single quoted, so
that it gets expanded only in src/Makefile, as Andreas said.
But there are too many emails of supposition, and AFAICS still no clear
bug report, so I dunno.
And none of this affects Emacs releases anyway, so it has zero relevance
to 24.4 and is not worth spending time on now.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-13 2:46 ` Glenn Morris
@ 2014-01-13 3:50 ` Eli Zaretskii
2014-01-13 4:19 ` Stefan Monnier
2014-01-13 19:03 ` Glenn Morris
0 siblings, 2 replies; 20+ messages in thread
From: Eli Zaretskii @ 2014-01-13 3:50 UTC (permalink / raw)
To: Glenn Morris; +Cc: jan.h.d, emacs-devel
> From: Glenn Morris <rgm@gnu.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>
> Date: Sun, 12 Jan 2014 21:46:41 -0500
>
> Jan Djärv wrote:
>
> > 12 jan 2014 kl. 22:12 skrev Eli Zaretskii <eliz@gnu.org>:
> >
> >> srcdir should always be a relative file name, like ../foo, never
> >> absolute.
> >
> > Is this the srcdir used when compiling in a separate directory?
>
> Yes, you are right, it may or may not be absolute.
>
> Personally I don't see a problem, since '$srcdir' is single quoted, so
> that it gets expanded only in src/Makefile, as Andreas said.
Perhaps using abs_srcdir will allow to use the same string everywhere,
avoiding the need to sometimes use ".." and sometimes quote.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-13 3:50 ` Eli Zaretskii
@ 2014-01-13 4:19 ` Stefan Monnier
2014-01-13 10:12 ` Andreas Schwab
2014-01-13 19:03 ` Glenn Morris
1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-01-13 4:19 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: jan.h.d, emacs-devel
> Perhaps using abs_srcdir will allow to use the same string everywhere,
> avoiding the need to sometimes use ".." and sometimes quote.
In any case "$(srcdir)/../.bzr" doesn't make as much sense as
"../$(srcdir)/.bzr".
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-13 4:19 ` Stefan Monnier
@ 2014-01-13 10:12 ` Andreas Schwab
2014-01-13 11:12 ` David Kastrup
2014-01-13 14:30 ` Stefan Monnier
0 siblings, 2 replies; 20+ messages in thread
From: Andreas Schwab @ 2014-01-13 10:12 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Eli Zaretskii, jan.h.d, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> In any case "$(srcdir)/../.bzr" doesn't make as much sense as
> "../$(srcdir)/.bzr".
??? The latter makes absolutely no sense, especially if $(srcdir) is an
absolute name. What you really want is $(top_srcdir).
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-13 10:12 ` Andreas Schwab
@ 2014-01-13 11:12 ` David Kastrup
2014-01-13 11:30 ` Andreas Schwab
2014-01-13 14:30 ` Stefan Monnier
1 sibling, 1 reply; 20+ messages in thread
From: David Kastrup @ 2014-01-13 11:12 UTC (permalink / raw)
To: emacs-devel
Andreas Schwab <schwab@linux-m68k.org> writes:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> In any case "$(srcdir)/../.bzr" doesn't make as much sense as
>> "../$(srcdir)/.bzr".
>
> ??? The latter makes absolutely no sense, especially if $(srcdir) is an
> absolute name. What you really want is $(top_srcdir).
So srcdir is different in every directory?
--
David Kastrup
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-13 11:12 ` David Kastrup
@ 2014-01-13 11:30 ` Andreas Schwab
0 siblings, 0 replies; 20+ messages in thread
From: Andreas Schwab @ 2014-01-13 11:30 UTC (permalink / raw)
To: David Kastrup; +Cc: emacs-devel
David Kastrup <dak@gnu.org> writes:
> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>
>>> In any case "$(srcdir)/../.bzr" doesn't make as much sense as
>>> "../$(srcdir)/.bzr".
>>
>> ??? The latter makes absolutely no sense, especially if $(srcdir) is an
>> absolute name. What you really want is $(top_srcdir).
>
> So srcdir is different in every directory?
It points to the directory containing the sources being compiled.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-13 10:12 ` Andreas Schwab
2014-01-13 11:12 ` David Kastrup
@ 2014-01-13 14:30 ` Stefan Monnier
2014-01-13 17:37 ` Glenn Morris
1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-01-13 14:30 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Eli Zaretskii, jan.h.d, emacs-devel
>> In any case "$(srcdir)/../.bzr" doesn't make as much sense as
>> "../$(srcdir)/.bzr".
> ??? The latter makes absolutely no sense, especially if $(srcdir) is an
> absolute name. What you really want is $(top_srcdir).
Right, I was thinking of $(srcdir) as the root of the checkout:
../$(srcdir)/.bzr wouldn't make sense for an absolute (srcdir),
but $(srcdir)/../.bzr makes even less sense if $(srcdir) as the root of
the checkout.
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-13 14:30 ` Stefan Monnier
@ 2014-01-13 17:37 ` Glenn Morris
0 siblings, 0 replies; 20+ messages in thread
From: Glenn Morris @ 2014-01-13 17:37 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Eli Zaretskii, jan.h.d, Andreas Schwab, emacs-devel
Stefan Monnier wrote:
> Right, I was thinking of $(srcdir) as the root of the checkout:
> ../$(srcdir)/.bzr wouldn't make sense for an absolute (srcdir),
> but $(srcdir)/../.bzr makes even less sense if $(srcdir) as the root of
> the checkout.
srcdir is not the root of the checkout. top_srcdir is.
srcdir is "directory containing the sources associated with the Makefile
that expands it". In many cases it will be "." everywhere: in Makefile,
src/Makefile, etc. In another case it might be ../emacs in Makefile,
../../emacs/src in src/Makefile, etc.
$(top_srcdir)/.bzr is equivalent to what you have now, but AFAICS
there's no _need_ to change it, except maybe clarity.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: More fun with vcswitness
2014-01-13 3:50 ` Eli Zaretskii
2014-01-13 4:19 ` Stefan Monnier
@ 2014-01-13 19:03 ` Glenn Morris
2014-01-13 19:13 ` Eli Zaretskii
1 sibling, 1 reply; 20+ messages in thread
From: Glenn Morris @ 2014-01-13 19:03 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: jan.h.d, emacs-devel
Eli Zaretskii wrote:
> Perhaps using abs_srcdir will allow to use the same string everywhere,
> avoiding the need to sometimes use ".." and sometimes quote.
abs_srcdir may contain whitespace, which is a problem for Make.
(srcdir is guaranteed not to, by configure.)
The current code seems fine to me.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2014-01-13 19:13 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-12 20:07 Mopre fun with vcswitness Eric S. Raymond
2014-01-12 20:14 ` Andreas Schwab
2014-01-12 21:08 ` Eli Zaretskii
2014-01-12 20:18 ` David Kastrup
2014-01-12 20:31 ` Eric S. Raymond
2014-01-12 20:46 ` David Kastrup
2014-01-12 21:02 ` Eric S. Raymond
2014-01-12 21:12 ` Eli Zaretskii
2014-01-12 21:30 ` David Kastrup
2014-01-12 22:19 ` More " Jan Djärv
2014-01-13 2:46 ` Glenn Morris
2014-01-13 3:50 ` Eli Zaretskii
2014-01-13 4:19 ` Stefan Monnier
2014-01-13 10:12 ` Andreas Schwab
2014-01-13 11:12 ` David Kastrup
2014-01-13 11:30 ` Andreas Schwab
2014-01-13 14:30 ` Stefan Monnier
2014-01-13 17:37 ` Glenn Morris
2014-01-13 19:03 ` Glenn Morris
2014-01-13 19:13 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.