unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
@ 2020-10-25 11:06 Andrew Whatson
  2020-10-25 13:16 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Andrew Whatson @ 2020-10-25 11:06 UTC (permalink / raw)
  To: 44209

The latest merge from master included commit 30305b54, which causes
NATIVE_FULL_AOT builds to fail with the following error:

progmodes/js.el:4550:11: Error: Symbol’s function definition is void:
cc-bytecomp-is-compiling





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 11:06 bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el Andrew Whatson
@ 2020-10-25 13:16 ` Lars Ingebrigtsen
  2020-10-25 13:52   ` Andrew Whatson
  0 siblings, 1 reply; 17+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-25 13:16 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: 44209

Andrew Whatson <whatson@gmail.com> writes:

> The latest merge from master included commit 30305b54, which causes
> NATIVE_FULL_AOT builds to fail with the following error:
>
> progmodes/js.el:4550:11: Error: Symbol’s function definition is void:
> cc-bytecomp-is-compiling

I'm unable to reproduce this bug.  Have you tried a "make bootstrap" (or
perhaps just deleting lisp/progmodes/js.elc)?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 13:16 ` Lars Ingebrigtsen
@ 2020-10-25 13:52   ` Andrew Whatson
  2020-10-25 14:25     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Andrew Whatson @ 2020-10-25 13:52 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 44209

Lars Ingebrigtsen <larsi@gnus.org> wrote:

> I'm unable to reproduce this bug.  Have you tried a "make bootstrap" (or
> perhaps just deleting lisp/progmodes/js.elc)?

I see this error with Guix builds
(https://github.com/flatwhatson/guix-channel) and AUR builds
(https://aur.archlinux.org/packages/emacs-native-comp-git/), both of
which are completely clean.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 13:52   ` Andrew Whatson
@ 2020-10-25 14:25     ` Lars Ingebrigtsen
  2020-10-25 14:42       ` Andrew Whatson
  0 siblings, 1 reply; 17+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-25 14:25 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: 44209

Andrew Whatson <whatson@gmail.com> writes:

> Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>> I'm unable to reproduce this bug.  Have you tried a "make bootstrap" (or
>> perhaps just deleting lisp/progmodes/js.elc)?
>
> I see this error with Guix builds
> (https://github.com/flatwhatson/guix-channel) and AUR builds
> (https://aur.archlinux.org/packages/emacs-native-comp-git/), both of
> which are completely clean.

Oh, you're compiling the archlinux package, not from Emacs git?

There are no errors when saying "make bootstrap" from the Emacs git
native-comp branch, so I guess you should take this up with the archlinux
people?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 14:25     ` Lars Ingebrigtsen
@ 2020-10-25 14:42       ` Andrew Whatson
  2020-10-25 14:55         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-25 15:02         ` Lars Ingebrigtsen
  0 siblings, 2 replies; 17+ messages in thread
From: Andrew Whatson @ 2020-10-25 14:42 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 44209

Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Oh, you're compiling the archlinux package, not from Emacs git?
>
> There are no errors when saying "make bootstrap" from the Emacs git
> native-comp branch, so I guess you should take this up with the archlinux
> people?

I maintain both of these packages.  Are you sure you're testing with
"make NATIVE_FULL_AOT=1"?  The error does not occur with the minimal
bootstrap build, because that doesn't attempt to native-compile js.el
during the build.  I guess this error must occur at runtime with
deferred compilation for non-AOT builds.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 14:42       ` Andrew Whatson
@ 2020-10-25 14:55         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-25 15:11           ` Andrew Whatson
  2020-10-25 15:02         ` Lars Ingebrigtsen
  1 sibling, 1 reply; 17+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-25 14:55 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: Lars Ingebrigtsen, 44209

Andrew Whatson <whatson@gmail.com> writes:

> Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>> Oh, you're compiling the archlinux package, not from Emacs git?
>>
>> There are no errors when saying "make bootstrap" from the Emacs git
>> native-comp branch, so I guess you should take this up with the archlinux
>> people?
>
> I maintain both of these packages.  Are you sure you're testing with
> "make NATIVE_FULL_AOT=1"?  The error does not occur with the minimal
> bootstrap build, because that doesn't attempt to native-compile js.el
> during the build.  I guess this error must occur at runtime with
> deferred compilation for non-AOT builds.

Hi Andrew,

just got the same error here with NATIVE_FULL_AOT=1.  Do you know if
it's reliably reproducible or just happens from time to time?

Thanks

  Andrea





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 14:42       ` Andrew Whatson
  2020-10-25 14:55         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-25 15:02         ` Lars Ingebrigtsen
  2020-10-25 15:30           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 17+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-25 15:02 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: 44209, Andrea Corallo

Andrew Whatson <whatson@gmail.com> writes:

> I maintain both of these packages.  Are you sure you're testing with
> "make NATIVE_FULL_AOT=1"?  The error does not occur with the minimal
> bootstrap build, because that doesn't attempt to native-compile js.el
> during the build.  I guess this error must occur at runtime with
> deferred compilation for non-AOT builds.

Oh, sorry, I assumed that

 ELC+ELN   progmodes/js.elc

meant that it was doing full ahead-of-time .eln generation...  but it's
not?  Andrea, perhaps the compilation output here should be tweaked,
then?

Anyway, with

$ make -j16 NATIVE_FULL_AOT=1 bootstrap

I do get the same error you're seeing:

 ELC+ELN   progmodes/js.elc
Symbol's function definition is void: cc-bytecomp-is-compiling
make[3]: *** [Makefile:314: progmodes/js.elc] Error 255
make[3]: Leaving directory '/home/larsi/src/emacs/native-compile/lisp'
make[2]: *** [Makefile:348: compile-main] Error 2
make[2]: Leaving directory '/home/larsi/src/emacs/native-compile/lisp'
make[1]: *** [Makefile:420: lisp] Error 2
make[1]: Leaving directory '/home/larsi/src/emacs/native-compile'
make: *** [Makefile:1143: bootstrap] Error 2


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 14:55         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-25 15:11           ` Andrew Whatson
  2020-10-25 15:21             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 17+ messages in thread
From: Andrew Whatson @ 2020-10-25 15:11 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Lars Ingebrigtsen, 44209

Andrea Corallo <akrl@sdf.org> wrote:

> just got the same error here with NATIVE_FULL_AOT=1.  Do you know if
> it's reliably reproducible or just happens from time to time?

Hi Andrea, this error occurs consistently for me when performing an
AOT build.  Reverting 30305b54 allows the build to complete, and that
commit introduced the explicit ordering between js and cc modes which
uncovers this bug.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 15:11           ` Andrew Whatson
@ 2020-10-25 15:21             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 17+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-25 15:21 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: Lars Ingebrigtsen, 44209

Andrew Whatson <whatson@gmail.com> writes:

> Andrea Corallo <akrl@sdf.org> wrote:
>
>> just got the same error here with NATIVE_FULL_AOT=1.  Do you know if
>> it's reliably reproducible or just happens from time to time?
>
> Hi Andrea, this error occurs consistently for me when performing an
> AOT build.  Reverting 30305b54 allows the build to complete, and that
> commit introduced the explicit ordering between js and cc modes which
> uncovers this bug.

Nice, I'll have look.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 15:02         ` Lars Ingebrigtsen
@ 2020-10-25 15:30           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-25 15:57             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 17+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-25 15:30 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Andrew Whatson, 44209

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Andrew Whatson <whatson@gmail.com> writes:
>
>> I maintain both of these packages.  Are you sure you're testing with
>> "make NATIVE_FULL_AOT=1"?  The error does not occur with the minimal
>> bootstrap build, because that doesn't attempt to native-compile js.el
>> during the build.  I guess this error must occur at runtime with
>> deferred compilation for non-AOT builds.
>
> Oh, sorry, I assumed that
>
>  ELC+ELN   progmodes/js.elc
>
> meant that it was doing full ahead-of-time .eln generation...  but it's
> not?  Andrea, perhaps the compilation output here should be tweaked,
> then?

Correct we are printing ELC+ELN even when we are native compiling only
the files involved in the image creation + few others (the default
setting).

I agree would be nice to have it tweaked for when we are not doing a
full AoT compilation.

I'll have a look into.

  Andrea





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 15:30           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-25 15:57             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-25 16:13               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-25 15:57 UTC (permalink / raw)
  To: 44209; +Cc: whatson, larsi

Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Andrew Whatson <whatson@gmail.com> writes:
>>
>>> I maintain both of these packages.  Are you sure you're testing with
>>> "make NATIVE_FULL_AOT=1"?  The error does not occur with the minimal
>>> bootstrap build, because that doesn't attempt to native-compile js.el
>>> during the build.  I guess this error must occur at runtime with
>>> deferred compilation for non-AOT builds.
>>
>> Oh, sorry, I assumed that
>>
>>  ELC+ELN   progmodes/js.elc
>>
>> meant that it was doing full ahead-of-time .eln generation...  but it's
>> not?  Andrea, perhaps the compilation output here should be tweaked,
>> then?
>
> Correct we are printing ELC+ELN even when we are native compiling only
> the files involved in the image creation + few others (the default
> setting).
>
> I agree would be nice to have it tweaked for when we are not doing a
> full AoT compilation.
>
> I'll have a look into.

I pushed 868d3ff9b8, should do the job.

  Andrea





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 15:57             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-25 16:13               ` Lars Ingebrigtsen
  2020-10-25 21:43                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 17+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-25 16:13 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Andrew Whatson, 44209

Andrea Corallo <akrl@sdf.org> writes:

>> I agree would be nice to have it tweaked for when we are not doing a
>> full AoT compilation.
>>
>> I'll have a look into.
>
> I pushed 868d3ff9b8, should do the job.

Thanks, looks good now.  And it looks like this is erroring out not when
compiling js.el, but when cc-mode has been natively compiled?

$ make
....
make[2]: Entering directory '/home/larsi/src/emacs/native-compile/lisp'
  ELC      progmodes/js.elc

In toplevel form:
progmodes/js.el:4550:11: Error: Symbol’s function definition is void: cc-bytecomp-is-compiling
make[2]: *** [Makefile:318: progmodes/js.elc] Error 1
make[2]: Leaving directory '/home/larsi/src/emacs/native-compile/lisp'
make[1]: *** [Makefile:352: compile-main] Error 2
make[1]: Leaving directory '/home/larsi/src/emacs/native-compile/lisp'
make: *** [Makefile:420: lisp] Error 2

cc-bytecomp-is-compiling is a defsubst, if that's any clue.  The
following patch fixes the problem, but I'm not sure...  why...

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index f3cfbbb948..563bf88e6a 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -48,6 +48,7 @@
 (require 'cc-mode)
 (eval-when-compile
   (require 'cc-langs)
+  (require 'cc-bytecomp)
   (require 'cc-fonts))
 (require 'newcomment)
 (require 'imenu)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 16:13               ` Lars Ingebrigtsen
@ 2020-10-25 21:43                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-25 23:06                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 17+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-25 21:43 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Andrew Whatson, 44209

Okay I think I see what is going on:

We fail to inline `cc-bytecomp-is-compiling' inside cc-defs.el because
`cc-bytecomp-is-compiling' is native compiled even if it should not.
We do not native compile defsubsts so they can be disassebled by the
bytecompiler to have the inlining performed effectively.

Prove of this is that adding (declare (speed -1)) to
`cc-bytecomp-is-compiling' to prevent native compialtion fix the
issue.

Now why defsubst is failing to do the same automatically is another
question I have to look into.  I suspect this issue is also the cause
of some of the warnings we see during the native build.

  Andrea





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 21:43                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-25 23:06                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-25 23:44                     ` Lars Ingebrigtsen
  2020-10-26  1:08                     ` Andrew Whatson
  0 siblings, 2 replies; 17+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-25 23:06 UTC (permalink / raw)
  To: 44209; +Cc: whatson, larsi

Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Okay I think I see what is going on:
>
> We fail to inline `cc-bytecomp-is-compiling' inside cc-defs.el because
> `cc-bytecomp-is-compiling' is native compiled even if it should not.
> We do not native compile defsubsts so they can be disassebled by the
> bytecompiler to have the inlining performed effectively.
>
> Prove of this is that adding (declare (speed -1)) to
> `cc-bytecomp-is-compiling' to prevent native compialtion fix the
> issue.
>
> Now why defsubst is failing to do the same automatically is another
> question I have to look into.  I suspect this issue is also the cause
> of some of the warnings we see during the native build.

All right 5edc7aa019 fix the issue for me.  I've also added a testcase
so hopefully we have it under control for the future.

  Andrea






^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 23:06                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-25 23:44                     ` Lars Ingebrigtsen
  2020-10-26  1:08                     ` Andrew Whatson
  1 sibling, 0 replies; 17+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-25 23:44 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Andrew Whatson, 44209

Andrea Corallo <akrl@sdf.org> writes:

> All right 5edc7aa019 fix the issue for me.  I've also added a testcase
> so hopefully we have it under control for the future.

Yup; fixes it here, too (with a "make -j8 NATIVE_FULL_AOT=1 bootstrap").

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-25 23:06                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-25 23:44                     ` Lars Ingebrigtsen
@ 2020-10-26  1:08                     ` Andrew Whatson
  2020-10-26  7:37                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 17+ messages in thread
From: Andrew Whatson @ 2020-10-26  1:08 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Lars Ingebrigtsen, 44209

Andrea Corallo <akrl@sdf.org> wrote:

> All right 5edc7aa019 fix the issue for me.

Thanks Andrea, this is working for me.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el
  2020-10-26  1:08                     ` Andrew Whatson
@ 2020-10-26  7:37                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 17+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-26  7:37 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Andrew Whatson; +Cc: 44209-done

Super, thanks both for testing.

Closing it

  Andrea





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-10-26  7:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-25 11:06 bug#44209: 28.0.50; [feature/native-comp] Compilation failure in progmodes/js.el Andrew Whatson
2020-10-25 13:16 ` Lars Ingebrigtsen
2020-10-25 13:52   ` Andrew Whatson
2020-10-25 14:25     ` Lars Ingebrigtsen
2020-10-25 14:42       ` Andrew Whatson
2020-10-25 14:55         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-25 15:11           ` Andrew Whatson
2020-10-25 15:21             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-25 15:02         ` Lars Ingebrigtsen
2020-10-25 15:30           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-25 15:57             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-25 16:13               ` Lars Ingebrigtsen
2020-10-25 21:43                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-25 23:06                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-25 23:44                     ` Lars Ingebrigtsen
2020-10-26  1:08                     ` Andrew Whatson
2020-10-26  7:37                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).