GNU bug report logs - #69590
30.0.50; Build scripts break due to DOS-style line endings

Previous Next

Package: emacs;

Reported by: "Divvy Cr." <divvycr <at> gmail.com>

Date: Wed, 6 Mar 2024 18:42:01 UTC

Severity: normal

Tags: notabug

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69590 in the body.
You can then email your comments to 69590 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#69590; Package emacs. (Wed, 06 Mar 2024 18:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Divvy Cr." <divvycr <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 06 Mar 2024 18:42:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Divvy Cr." <divvycr <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Build scripts break due to DOS-style line endings
Date: Wed, 6 Mar 2024 18:27:41 +0000
Currently, cloning the latest Emacs branches (namely, master and
emacs-29) fails to build via `./autogen.sh` with the following error:

zsh: ./autogen.sh: bad interpreter: /bin/sh^M: no such file or directory

Using Vim's `:set fileformat=unix` on autogen.sh, it still fails to
build with the following errors:

Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
Checking for autoconf (need at least version 2.65) ... ok
Your system has the required tools.
Building aclocal.m4 ...
Running 'autoreconf -fi -I m4' ...
: not found
sh: 2: Syntax error: word unexpected (expecting "do")
configure.ac:7373: error: expected source file, required through
AC_LIBSOURCES, not found
./lib/autoconf/general.m4:2437: AC_FATAL is expanded from...
m4/gnulib-comp.m4:222: gl_INIT is expanded from...
configure.ac:7373: the top level
autom4te: error: /usr/bin/m4 failed with exit status: 1
autoreconf: error: /usr/bin/autoconf failed with exit status: 1

Now, the line ': not found' again hints at problems with DOS-vs-Unix
style formatting. I have managed to successfully build latest Emacs
after running the following on the repository:

git ls-files -z | xargs -0 dos2unix
git ls-files -z '*.bat' | xargs -0 unix2dos

Is this a bug in Emacs' build scripts, autoreconf, or just an
inconvenience of using the latest builds? Notably, my previous Emacs
30.0.50 build from December 2023 did not have these issues.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69590; Package emacs. (Wed, 06 Mar 2024 19:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 69590 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Divvy Cr." <divvycr <at> gmail.com>
Cc: 69590 <at> debbugs.gnu.org
Subject: Re: bug#69590: 30.0.50;
 Build scripts break due to DOS-style line endings
Date: Wed, 06 Mar 2024 21:36:05 +0200
tags 69590 notabug
thanks

> From: "Divvy Cr." <divvycr <at> gmail.com>
> Date: Wed, 6 Mar 2024 18:27:41 +0000
> 
> Currently, cloning the latest Emacs branches (namely, master and
> emacs-29) fails to build via `./autogen.sh` with the following error:
> 
> zsh: ./autogen.sh: bad interpreter: /bin/sh^M: no such file or directory
> 
> Using Vim's `:set fileformat=unix` on autogen.sh, it still fails to
> build with the following errors:
> 
> Checking whether you have the necessary tools...
> (Read INSTALL.REPO for more details on building Emacs)
> Checking for autoconf (need at least version 2.65) ... ok
> Your system has the required tools.
> Building aclocal.m4 ...
> Running 'autoreconf -fi -I m4' ...
> : not found
> sh: 2: Syntax error: word unexpected (expecting "do")
> configure.ac:7373: error: expected source file, required through
> AC_LIBSOURCES, not found
> ./lib/autoconf/general.m4:2437: AC_FATAL is expanded from...
> m4/gnulib-comp.m4:222: gl_INIT is expanded from...
> configure.ac:7373: the top level
> autom4te: error: /usr/bin/m4 failed with exit status: 1
> autoreconf: error: /usr/bin/autoconf failed with exit status: 1
> 
> Now, the line ': not found' again hints at problems with DOS-vs-Unix
> style formatting. I have managed to successfully build latest Emacs
> after running the following on the repository:
> 
> git ls-files -z | xargs -0 dos2unix
> git ls-files -z '*.bat' | xargs -0 unix2dos

This "cure" is not recommended: no one can guarantee that no files in
the Emacs repository except *.bat should have DOS EOL format.  IOW,
the above might be a lossy conversion, and could silently corrupt some
files.  Don't do that.

> Is this a bug in Emacs' build scripts, autoreconf, or just an
> inconvenience of using the latest builds? Notably, my previous Emacs
> 30.0.50 build from December 2023 did not have these issues.

This is likely due to how you configured Git on your Windows system.
It should be configured not to perform any conversions of the
end-of-line format, neither when checking out files nor when checking
them in.  This can be either determined when you install Git for
Windows (the installation program asks you about that), or it can be
set up later with the following Git command

  git config --global core.autocrlf false

Since you already have this problem, the best alternative for you is
delete the entire Emacs repository, then run the above command, and
then clone the repository anew, which will now be free from this
breakage.

(I don't know why it worked for you previously.  Maybe you migrated to
another machine and installed Git anew, or maybe you upgraded Git and
the upgrade somehow changed this setting.  Or something else to that
effect.)

This is not a bug in Emacs.




Added tag(s) notabug. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 06 Mar 2024 19:37:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69590; Package emacs. (Thu, 07 Mar 2024 06:35:02 GMT) Full text and rfc822 format available.

Message #13 received at 69590 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Divvy Cr." <divvycr <at> gmail.com>
Cc: 69590 <at> debbugs.gnu.org
Subject: Re: bug#69590: 30.0.50;
 Build scripts break due to DOS-style line endings
Date: Thu, 07 Mar 2024 08:33:27 +0200
[Please use Reply All to reply to keep the bug tracker CC'ed.]

> From: "Divvy Cr." <divvycr <at> gmail.com>
> Date: Wed, 6 Mar 2024 20:25:09 +0000
> 
> Hmmm, I'm running Emacs on WSL2, and this is the first and only time I've had this issue, which is what baffled
> me.
> 
> Sorry for the confusion, and thanks for the reply!

You are building a GNU/Linux build of Emacs on WSL2?  To update the
repository from upstream, are you running Git on Windows or on
GNU/Linux?




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Sat, 05 Oct 2024 01:20:02 GMT) Full text and rfc822 format available.

Notification sent to "Divvy Cr." <divvycr <at> gmail.com>:
bug acknowledged by developer. (Sat, 05 Oct 2024 01:20:02 GMT) Full text and rfc822 format available.

Message #18 received at 69590-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69590-done <at> debbugs.gnu.org, "Divvy Cr." <divvycr <at> gmail.com>
Subject: Re: bug#69590: 30.0.50;
 Build scripts break due to DOS-style line endings
Date: Fri, 4 Oct 2024 18:18:38 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> [Please use Reply All to reply to keep the bug tracker CC'ed.]
>
>> From: "Divvy Cr." <divvycr <at> gmail.com>
>> Date: Wed, 6 Mar 2024 20:25:09 +0000
>>
>> Hmmm, I'm running Emacs on WSL2, and this is the first and only time I've had this issue, which is what baffled
>> me.
>>
>> Sorry for the confusion, and thanks for the reply!
>
> You are building a GNU/Linux build of Emacs on WSL2?  To update the
> repository from upstream, are you running Git on Windows or on
> GNU/Linux?

More information was requested, but none was given within 6 months, so
I'm closing this bug.  If this is still an issue, please reply to this
email (use "Reply to all" in your email client) and we can reopen the
bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 Nov 2024 11:24:17 GMT) Full text and rfc822 format available.

This bug report was last modified 106 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.