unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Avoid duplicate emacs.exe / emacs-$version.exe
@ 2020-03-29 17:01 Angelo Graziosi
  2020-03-29 17:22 ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Angelo Graziosi @ 2020-03-29 17:01 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii wrote:

> I've just fixed that on master;

Now my build on Windows via MSYS2 creates an hardlink instead then s symlink. Notice that MSYS2 by default does not enable symlink so the using 'ln -s ...' really copies the file. So I enabled Windows native symlink with  

rem To activate windows native symlinks uncomment next line
set MSYS=winsymlinks:nativestrict

in /msys2_shell.cmd

(maybe W10 needs also the developpers mode). In this way my builds had 

  1 mar 13.55 emacs-27.0.90.exe
  1 mar 14.01 emacs.exe -> emacs-27.0.90.exe


What do I have to do to get back to the way I used to be? I don't want to delete the hardlink and add the symlink manually.

BTW, why Emacs, on Windows, has 3 executable?

  runemacs.exe
  emacs-27.0.90.exe
  emacs.exe (hardlink, now)

Yes, runemacs.exe to remove the DOS window (if I remember): why this cannot be done with a single EXE? On Windows there ar a lot of apps (IDE, Editore, Browser etc) which have only one EXE to be started with (no DOS window etc). WHY not Emacs? This could be another simplification in the spirit of this discussion...

Ciao,
  Angelo.



^ permalink raw reply	[flat|nested] 27+ messages in thread
* Avoid duplicate emacs.exe / emacs-$version.exe
@ 2020-03-28 16:53 Juan José García-Ripoll
  2020-03-28 18:19 ` Eli Zaretskii
  2020-03-28 18:19 ` Eli Zaretskii
  0 siblings, 2 replies; 27+ messages in thread
From: Juan José García-Ripoll @ 2020-03-28 16:53 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1923 bytes --]

Right now in my hard disk I have two copies of statically linked Emacs.
~/emacs-27/bin/emacs.exe
~/emacs-27/bin/emacs-27.0.90.exe (let me call it emacs-$version.exe)

Each of them is 128Mb large and waste space. I understand the latter is
only meant to be used when the version is required. runemacs.exe and
tools actually seem to rely on emacs.exe, because if I delete
emacs-$version.exe it still works fine.  Same goes for earlier releases.

I would suggest one of these options

a) Remove emacs-$version.exe during installation.

b) Same as a), but install a script emacs-$version.cmd containing just two
lines
    @echo off
    %~dp0\emacs.exe %*

c) Instead, remove emacs.exe and leave only emacs-$version.exe Make emacs.cmd a
script
    @echo off
    %~dp0\emacs-$version.exe %*
where $version is replaced with the current version. We also have to change
runemacs.exe to look for emacs-$version.exe

Option a) only invokes a change in Makefile.in. Option b) includes that change,
plus the creation of the script. This is in a patch attached to this
message. Option c) would be the most intrusive. I personally do not like it
because it binds a general utility, runemacs.exe, to a particular version.

After the patch:
juanj@DESKTOP-3A8AAJ0 MINGW64 ~/emacs-build/build/juanjo
$ du -smc ~/emacs-27/*
135     /c/Users/juanj/emacs-27/bin
1       /c/Users/juanj/emacs-27/include
1       /c/Users/juanj/emacs-27/lib
17      /c/Users/juanj/emacs-27/libexec
98      /c/Users/juanj/emacs-27/share
249     total

Before the patch:
juanj@DESKTOP-3A8AAJ0 MINGW64 ~/emacs-build/build/juanjo
$ du -smc ~/emacs-27/*
252     /c/Users/juanj/emacs-27/bin
1       /c/Users/juanj/emacs-27/include
1       /c/Users/juanj/emacs-27/lib
17      /c/Users/juanj/emacs-27/libexec
98      /c/Users/juanj/emacs-27/share
366     total

A 32% reduction in size.

--
Juan José García Ripoll
http://juanjose.garciaripoll.com
http://quinfog.hbar.es

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: emacs-cmd.diff --]
[-- Type: text/x-patch, Size: 1644 bytes --]

diff --git a/Makefile.in b/Makefile.in
index 67e15cf..67c14f2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -499,10 +499,13 @@ install-arch-dep:
 endif
 	-chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifndef NO_BIN_LINK
+ifeq ($(NTDIR),nt)
+	cd "$(DESTDIR)${bindir}" && mv "$(EMACSFULL)" "$(EMACS)"
+else
 	rm -f "$(DESTDIR)${bindir}/$(EMACS)"
 	cd "$(DESTDIR)${bindir}" && $(LN_S_FILEONLY) "$(EMACSFULL)" "$(EMACS)"
 endif
-else
+endif
 	subdir=${ns_appresdir}/site-lisp && ${write_subdir}
 	rm -rf ${ns_appresdir}/share
 endif
diff --git a/nt/Makefile.in b/nt/Makefile.in
index 6bdf824..7af6e78 100644
--- a/nt/Makefile.in
+++ b/nt/Makefile.in
@@ -167,7 +167,7 @@ LINK_CFLAGS =
 ## Unused.
 CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
 
-all: ${EXE_FILES}
+all: ${EXE_FILES} emacs-$(version).cmd
 
 .PHONY: all
 
@@ -194,6 +194,7 @@ install:
 	for file in ${INSTALLABLES} ; do \
 	  $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
 	done
+	$(INSTALL_PROGRAM) emacs-$(version).cmd "$(DESTDIR)${bindir}"
 	${MKDIR_P} "$(DESTDIR)${datadir}/emacs/$(version)"
 	$(INSTALL_DATA) ${srcdir}/README.W32 "$(DESTDIR)${datadir}/emacs/$(version)"
 
@@ -251,6 +252,10 @@ cmdproxy${EXEEXT}:
 runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
 	$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $^ -mwindows -o $@
 
+emacs-$(version).cmd:
+	echo '@echo off' > $@
+	echo '%~dp0\emacs.exe %*' >> $@
+
 ## Also used in ../src/Makefile.
 emacs.res ../src/emacs.res: emacs.rc ${srcdir}/icons/emacs.ico \
   ${srcdir}/icons/hand.cur ${srcdir}/$(EMACS_MANIFEST)

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

end of thread, other threads:[~2020-03-29 20:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-29 17:01 Avoid duplicate emacs.exe / emacs-$version.exe Angelo Graziosi
2020-03-29 17:22 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2020-03-28 16:53 Juan José García-Ripoll
2020-03-28 18:19 ` Eli Zaretskii
2020-03-28 20:41   ` Juan José García-Ripoll
2020-03-28 22:45     ` Phillip Lord
2020-03-29  2:31     ` Eli Zaretskii
2020-03-29  9:38       ` Juan José García-Ripoll
2020-03-29 13:08         ` Phillip Lord
2020-03-29 14:10         ` Eli Zaretskii
2020-03-28 18:19 ` Eli Zaretskii
2020-03-28 20:13   ` Phillip Lord
2020-03-28 20:48     ` Juan José García-Ripoll
2020-03-28 22:22       ` Phillip Lord
2020-03-28 23:36         ` Juan José García-Ripoll
2020-03-29 12:55           ` Phillip Lord
2020-03-29  2:27     ` Eli Zaretskii
2020-03-29 12:52       ` Phillip Lord
2020-03-29 13:56         ` Eli Zaretskii
2020-03-29 17:25           ` Phillip Lord
2020-03-28 23:36   ` Juan José García-Ripoll
2020-03-29  2:36     ` Eli Zaretskii
2020-03-29 12:59       ` Phillip Lord
2020-03-29 13:59         ` Eli Zaretskii
2020-03-29 18:18           ` Phillip Lord
2020-03-29 18:34             ` Eli Zaretskii
2020-03-29 20:49               ` Phillip Lord

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