unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Clashes between "version" files and C++ keyword
@ 2020-10-28  8:11 Ralph Seichter
  2020-10-28 13:52 ` Tomi Ollila
  2020-10-28 14:44 ` [PATCH] Rename version to version.txt ralph
  0 siblings, 2 replies; 4+ messages in thread
From: Ralph Seichter @ 2020-10-28  8:11 UTC (permalink / raw)
  To: notmuch

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

Building Notmuch on macOS is known to cause problems because the Notmuch
distribution archive contains two files named "version". These clash
with the <version> keyword as defined in C++20 [1] and will likely
become obvious on other platforms as well once Compilers adopt the new
standard.

The two affected files in the Notmuch Git tree are

  /bindings/python-cffi/version
  /version

I suggest to rename them both to version.txt. The attached patch can
then be applied to make the necessary build file changes.

-Ralph

[1] https://en.cppreference.com/w/cpp/20#New_headers


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

diff --git Makefile.global Makefile.global
index cd489ef2..8477468d 100644
--- Makefile.global
+++ Makefile.global
@@ -17,7 +17,7 @@ else
 DATE:=$(shell date +%F)
 endif
 
-VERSION:=$(shell cat ${srcdir}/version)
+VERSION:=$(shell cat ${srcdir}/version.txt)
 ELPA_VERSION:=$(subst ~,_,$(VERSION))
 ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
 ifeq ($(IS_GIT),yes)
diff --git Makefile.local Makefile.local
index c65cee7c..dde7981b 100644
--- Makefile.local
+++ Makefile.local
@@ -19,7 +19,7 @@ endif
 
 # Depend (also) on the file 'version'. In case of ifeq ($(IS_GIT),yes)
 # this file may already have been updated.
-version.stamp: $(srcdir)/version
+version.stamp: $(srcdir)/version.txt
 	echo $(VERSION) > $@
 
 $(TAR_FILE):
diff --git bindings/python-cffi/setup.py bindings/python-cffi/setup.py
index b0060835..cda52338 100644
--- bindings/python-cffi/setup.py
+++ bindings/python-cffi/setup.py
@@ -1,6 +1,6 @@
 import setuptools
 
-with open('version') as fp:
+with open('version.txt') as fp:
     VERSION = fp.read().strip()
 
 setuptools.setup(
diff --git doc/conf.py doc/conf.py
index 94e266af..11bed51d 100644
--- doc/conf.py
+++ doc/conf.py
@@ -19,7 +19,7 @@ copyright = u'2009-2020, Carl Worth and many others'
 location = os.path.dirname(__file__)
 
 for pathdir in ['.', '..']:
-    version_file = os.path.join(location,pathdir,'version')
+    version_file = os.path.join(location,pathdir,'version.txt')
     if os.path.exists(version_file):
         with open(version_file,'r') as infile:
             version=infile.read().replace('\n','')

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



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

* Re: Clashes between "version" files and C++ keyword
  2020-10-28  8:11 Clashes between "version" files and C++ keyword Ralph Seichter
@ 2020-10-28 13:52 ` Tomi Ollila
  2020-10-28 14:44 ` [PATCH] Rename version to version.txt ralph
  1 sibling, 0 replies; 4+ messages in thread
From: Tomi Ollila @ 2020-10-28 13:52 UTC (permalink / raw)
  To: Ralph Seichter, notmuch

On Wed, Oct 28 2020, Ralph Seichter wrote:

> Building Notmuch on macOS is known to cause problems because the Notmuch
> distribution archive contains two files named "version". These clash
> with the <version> keyword as defined in C++20 [1] and will likely
> become obvious on other platforms as well once Compilers adopt the new
> standard.
>
> The two affected files in the Notmuch Git tree are
>
>   /bindings/python-cffi/version
>   /version
>
> I suggest to rename them both to version.txt. The attached patch can
> then be applied to make the necessary build file changes.

good stuff!

Could you send git am -able patch to the mailing list ?

Tomi

>
> -Ralph
>
> [1] https://en.cppreference.com/w/cpp/20#New_headers
>
> diff --git Makefile.global Makefile.global
> index cd489ef2..8477468d 100644
> --- Makefile.global
> +++ Makefile.global
> @@ -17,7 +17,7 @@ else
>  DATE:=$(shell date +%F)
>  endif
>  
> -VERSION:=$(shell cat ${srcdir}/version)
> +VERSION:=$(shell cat ${srcdir}/version.txt)
>  ELPA_VERSION:=$(subst ~,_,$(VERSION))
>  ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
>  ifeq ($(IS_GIT),yes)
> diff --git Makefile.local Makefile.local
> index c65cee7c..dde7981b 100644
> --- Makefile.local
> +++ Makefile.local
> @@ -19,7 +19,7 @@ endif
>  
>  # Depend (also) on the file 'version'. In case of ifeq ($(IS_GIT),yes)
>  # this file may already have been updated.
> -version.stamp: $(srcdir)/version
> +version.stamp: $(srcdir)/version.txt
>  	echo $(VERSION) > $@
>  
>  $(TAR_FILE):
> diff --git bindings/python-cffi/setup.py bindings/python-cffi/setup.py
> index b0060835..cda52338 100644
> --- bindings/python-cffi/setup.py
> +++ bindings/python-cffi/setup.py
> @@ -1,6 +1,6 @@
>  import setuptools
>  
> -with open('version') as fp:
> +with open('version.txt') as fp:
>      VERSION = fp.read().strip()
>  
>  setuptools.setup(
> diff --git doc/conf.py doc/conf.py
> index 94e266af..11bed51d 100644
> --- doc/conf.py
> +++ doc/conf.py
> @@ -19,7 +19,7 @@ copyright = u'2009-2020, Carl Worth and many others'
>  location = os.path.dirname(__file__)
>  
>  for pathdir in ['.', '..']:
> -    version_file = os.path.join(location,pathdir,'version')
> +    version_file = os.path.join(location,pathdir,'version.txt')
>      if os.path.exists(version_file):
>          with open(version_file,'r') as infile:
>              version=infile.read().replace('\n','')
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

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

* [PATCH] Rename version to version.txt
  2020-10-28  8:11 Clashes between "version" files and C++ keyword Ralph Seichter
  2020-10-28 13:52 ` Tomi Ollila
@ 2020-10-28 14:44 ` ralph
  2020-10-30 19:21   ` David Bremner
  1 sibling, 1 reply; 4+ messages in thread
From: ralph @ 2020-10-28 14:44 UTC (permalink / raw)
  To: notmuch; +Cc: Ralph Seichter

From: Ralph Seichter <github@seichter.de>

Building Notmuch on macOS is known to cause problems because the Notmuch
distribution archive contains two files named "version". These names
clash with the <version> keyword as defined in C++20. Therefore, the
existing naming will likely become a problem on other platforms as well,
once compilers adopt the new standard.

Signed-off-by: Ralph Seichter <github@seichter.de>
---
 Makefile.global                               | 2 +-
 Makefile.local                                | 2 +-
 bindings/python-cffi/setup.py                 | 2 +-
 bindings/python-cffi/{version => version.txt} | 0
 doc/conf.py                                   | 2 +-
 version => version.txt                        | 0
 6 files changed, 4 insertions(+), 4 deletions(-)
 rename bindings/python-cffi/{version => version.txt} (100%)
 rename version => version.txt (100%)

diff --git a/Makefile.global b/Makefile.global
index cd489ef2..8477468d 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -17,7 +17,7 @@ else
 DATE:=$(shell date +%F)
 endif
 
-VERSION:=$(shell cat ${srcdir}/version)
+VERSION:=$(shell cat ${srcdir}/version.txt)
 ELPA_VERSION:=$(subst ~,_,$(VERSION))
 ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
 ifeq ($(IS_GIT),yes)
diff --git a/Makefile.local b/Makefile.local
index c65cee7c..dde7981b 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -19,7 +19,7 @@ endif
 
 # Depend (also) on the file 'version'. In case of ifeq ($(IS_GIT),yes)
 # this file may already have been updated.
-version.stamp: $(srcdir)/version
+version.stamp: $(srcdir)/version.txt
 	echo $(VERSION) > $@
 
 $(TAR_FILE):
diff --git a/bindings/python-cffi/setup.py b/bindings/python-cffi/setup.py
index b0060835..cda52338 100644
--- a/bindings/python-cffi/setup.py
+++ b/bindings/python-cffi/setup.py
@@ -1,6 +1,6 @@
 import setuptools
 
-with open('version') as fp:
+with open('version.txt') as fp:
     VERSION = fp.read().strip()
 
 setuptools.setup(
diff --git a/bindings/python-cffi/version b/bindings/python-cffi/version.txt
similarity index 100%
rename from bindings/python-cffi/version
rename to bindings/python-cffi/version.txt
diff --git a/doc/conf.py b/doc/conf.py
index 94e266af..11bed51d 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -19,7 +19,7 @@ copyright = u'2009-2020, Carl Worth and many others'
 location = os.path.dirname(__file__)
 
 for pathdir in ['.', '..']:
-    version_file = os.path.join(location,pathdir,'version')
+    version_file = os.path.join(location,pathdir,'version.txt')
     if os.path.exists(version_file):
         with open(version_file,'r') as infile:
             version=infile.read().replace('\n','')
diff --git a/version b/version.txt
similarity index 100%
rename from version
rename to version.txt
-- 
2.24.3 (Apple Git-128)

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

* Re: [PATCH] Rename version to version.txt
  2020-10-28 14:44 ` [PATCH] Rename version to version.txt ralph
@ 2020-10-30 19:21   ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2020-10-30 19:21 UTC (permalink / raw)
  To: ralph, notmuch; +Cc: Ralph Seichter

ralph@ml.seichter.de writes:

> From: Ralph Seichter <github@seichter.de>
>
> Building Notmuch on macOS is known to cause problems because the Notmuch
> distribution archive contains two files named "version". These names
> clash with the <version> keyword as defined in C++20. Therefore, the
> existing naming will likely become a problem on other platforms as well,
> once compilers adopt the new standard.
>

pushed to master with the hopefully inoffensive change of calling
<version> a header rather than a keyword.

I've also merged master to release to start thinking about a point
release.  I'd like to add the other recently discussed fix for OpenBSD.

d

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

end of thread, other threads:[~2020-10-30 19:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28  8:11 Clashes between "version" files and C++ keyword Ralph Seichter
2020-10-28 13:52 ` Tomi Ollila
2020-10-28 14:44 ` [PATCH] Rename version to version.txt ralph
2020-10-30 19:21   ` David Bremner

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

	https://yhetil.org/notmuch.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).