unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Divvy Cr." <divvycr@gmail.com>
Cc: 69590@debbugs.gnu.org
Subject: bug#69590: 30.0.50; Build scripts break due to DOS-style line endings
Date: Wed, 06 Mar 2024 21:36:05 +0200	[thread overview]
Message-ID: <86ttljjgpm.fsf@gnu.org> (raw)
In-Reply-To: <CADmOxiLhjkm2NR1-xGYtq+E=gGD+uVCM8KD0oWAmmiDCHm5Kbg@mail.gmail.com> (divvycr@gmail.com)

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.





  reply	other threads:[~2024-03-06 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [not found]   ` <CADmOxiKZUg-aEV35xcuvduuSecLcttR20=C8B3puVrFRbQGf9Q@mail.gmail.com>
2024-03-07  6:33     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ttljjgpm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=69590@debbugs.gnu.org \
    --cc=divvycr@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).