unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69590: 30.0.50; Build scripts break due to DOS-style line endings
@ 2024-03-06 18:27 Divvy Cr.
  2024-03-06 19:36 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Divvy Cr. @ 2024-03-06 18:27 UTC (permalink / raw)
  To: 69590

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.





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

* bug#69590: 30.0.50; Build scripts break due to DOS-style line endings
  2024-03-06 18:27 bug#69590: 30.0.50; Build scripts break due to DOS-style line endings Divvy Cr.
@ 2024-03-06 19:36 ` Eli Zaretskii
       [not found]   ` <CADmOxiKZUg-aEV35xcuvduuSecLcttR20=C8B3puVrFRbQGf9Q@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2024-03-06 19:36 UTC (permalink / raw)
  To: Divvy Cr.; +Cc: 69590

tags 69590 notabug
thanks

> From: "Divvy Cr." <divvycr@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.





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

* bug#69590: 30.0.50; Build scripts break due to DOS-style line endings
       [not found]   ` <CADmOxiKZUg-aEV35xcuvduuSecLcttR20=C8B3puVrFRbQGf9Q@mail.gmail.com>
@ 2024-03-07  6:33     ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2024-03-07  6:33 UTC (permalink / raw)
  To: Divvy Cr.; +Cc: 69590

[Please use Reply All to reply to keep the bug tracker CC'ed.]

> From: "Divvy Cr." <divvycr@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?





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

end of thread, other threads:[~2024-03-07  6:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06 18:27 bug#69590: 30.0.50; Build scripts break due to DOS-style line endings Divvy Cr.
2024-03-06 19:36 ` Eli Zaretskii
     [not found]   ` <CADmOxiKZUg-aEV35xcuvduuSecLcttR20=C8B3puVrFRbQGf9Q@mail.gmail.com>
2024-03-07  6:33     ` Eli Zaretskii

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).