[PATCH] RFC s3: drop build_env

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] RFC s3: drop build_env

Samba - samba-technical mailing list
for enabling reproducible builds, without the added complexity of
https://lists.samba.org/archive/samba-technical/2017-June/121302.html

I left most of wscript alone for now, since I do not understand it

Signed-off-by: Bernhard M. Wiedemann <[hidden email]>
---
 buildtools/wafsamba/samba_patterns.py | 14 -------------
 source3/script/build_env.sh           | 38 +----------------------------------
 source3/wscript_build                 |  6 +-----
 3 files changed, 2 insertions(+), 56 deletions(-)

diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index 1baa6019065..e809f26a095 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -51,7 +51,6 @@ def write_build_options_header(fp):
     fp.write("*/\n")
     fp.write("\n")
     fp.write("#include \"includes.h\"\n")
-    fp.write("#include \"build_env.h\"\n")
     fp.write("#include \"dynconfig/dynconfig.h\"\n")
     fp.write("#include \"lib/cluster_support.h\"\n")
 
@@ -92,19 +91,6 @@ def write_build_options_header(fp):
     fp.write("              return;\n")
     fp.write("       }\n")
     fp.write("\n")
-    fp.write("#ifdef _BUILD_ENV_H\n")
-    fp.write("       /* Output information about the build environment */\n")
-    fp.write("       output(screen,\"Build environment:\\n\");\n")
-    fp.write("       output(screen,\"   Built by:    %s@%s\\n\",BUILD_ENV_USER,BUILD_ENV_HOST);\n")
-    fp.write("       output(screen,\"   Built on:    %s\\n\",BUILD_ENV_DATE);\n")
-    fp.write("\n")
-    fp.write("       output(screen,\"   Built using: %s\\n\",BUILD_ENV_COMPILER);\n")
-    fp.write("       output(screen,\"   Build host:  %s\\n\",BUILD_ENV_UNAME);\n")
-    fp.write("       output(screen,\"   SRCDIR:      %s\\n\",BUILD_ENV_SRCDIR);\n")
-    fp.write("       output(screen,\"   BUILDDIR:    %s\\n\",BUILD_ENV_BUILDDIR);\n")
-    fp.write("\n")
-    fp.write("\n")
-    fp.write("#endif\n")
     fp.write("\n")
     fp.write("       /* Output various paths to files and directories */\n")
     fp.write("       output(screen,\"\\nPaths:\\n\");\n")
diff --git a/source3/script/build_env.sh b/source3/script/build_env.sh
index eb54f37aeda..64dec376f10 100755
--- a/source3/script/build_env.sh
+++ b/source3/script/build_env.sh
@@ -1,41 +1,5 @@
 #!/bin/sh
-
-if [ $# -lt 3 ]
-then
-    echo "Usage: $0 srcdir builddir compiler"
-    exit 1
-fi
-
-uname=`uname -a`
-date=`date`
-srcdir=$1
-builddir=$2
-compiler=$3
-
-if [ ! "x$USER" = "x" ]; then
-    whoami=$USER
-else
-    if [ ! "x$LOGNAME" = "x" ]; then
- whoami=$LOGNAME
-    else
- whoami=`whoami || id -un`
-    fi
-fi
-
-host=`hostname`
-
 cat <<EOF
 /* This file is automatically generated with "make include/build_env.h". DO NOT EDIT */
-
-#ifndef _BUILD_ENV_H
-#define _BUILD_ENV_H
-
-#define BUILD_ENV_UNAME "${uname}"
-#define BUILD_ENV_DATE "${date}"
-#define BUILD_ENV_SRCDIR "${srcdir}"
-#define BUILD_ENV_BUILDDIR "${builddir}"
-#define BUILD_ENV_USER "${whoami}"
-#define BUILD_ENV_HOST "${host}"
-#define BUILD_ENV_COMPILER "${compiler}"
-#endif /* _BUILD_ENV_H */
+/* leftover stub - not used anymore */
 EOF
diff --git a/source3/wscript_build b/source3/wscript_build
index 2cc74e0f4ec..c709246e215 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -12,11 +12,7 @@ bld.SAMBA_BLDOPTIONS('smbd/build_options.c')
 t = bld.SAMBA_GENERATOR('build_env.h',
                         source='script/build_env.sh',
                         target='include/build_env.h',
-                        rule='${SRC} ${SRCDIR} ${BUILDDIR} ${CC} > ${TGT}')
-# todo: work out what is really wanted here
-t.env.SRCDIR = bld.path.abspath()
-t.env.BUILDDIR = bld.path.abspath()
-
+                        rule='${SRC} > ${TGT}')
 bld.SETUP_BUILD_GROUPS()
 
 ######################## SUBSYSTEMS #################################
--
2.12.3


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] RFC s3: drop build_env

Samba - samba-technical mailing list
Hi Bernhard,

On Tue, 27 Jun 2017 12:38:22 +0200, Bernhard M. Wiedemann via samba-technical wrote:

> for enabling reproducible builds, without the added complexity of
> https://lists.samba.org/archive/samba-technical/2017-June/121302.html
>
> I left most of wscript alone for now, since I do not understand it

Thanks for the follow-up. I'm happy with this change, but would like to
see the final remnants of build_env removed - see the attached patch, to
be squashed in with yours.

Cheers, David

0001-SQUASH-drop-build_env.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] s3: drop build_env

Samba - samba-technical mailing list
for enabling reproducible builds, without the added complexity of
https://lists.samba.org/archive/samba-technical/2017-June/121302.html

Signed-off-by: Bernhard M. Wiedemann <[hidden email]>
Reviewed-by: David Disseldorp <[hidden email]>
---
 buildtools/wafsamba/samba_patterns.py | 14 ------------
 source3/script/build_env.sh           | 41 -----------------------------------
 source3/wscript_build                 |  8 -------
 3 files changed, 63 deletions(-)
 delete mode 100755 source3/script/build_env.sh

diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index 1baa6019065..e809f26a095 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -51,7 +51,6 @@ def write_build_options_header(fp):
     fp.write("*/\n")
     fp.write("\n")
     fp.write("#include \"includes.h\"\n")
-    fp.write("#include \"build_env.h\"\n")
     fp.write("#include \"dynconfig/dynconfig.h\"\n")
     fp.write("#include \"lib/cluster_support.h\"\n")
 
@@ -92,19 +91,6 @@ def write_build_options_header(fp):
     fp.write("              return;\n")
     fp.write("       }\n")
     fp.write("\n")
-    fp.write("#ifdef _BUILD_ENV_H\n")
-    fp.write("       /* Output information about the build environment */\n")
-    fp.write("       output(screen,\"Build environment:\\n\");\n")
-    fp.write("       output(screen,\"   Built by:    %s@%s\\n\",BUILD_ENV_USER,BUILD_ENV_HOST);\n")
-    fp.write("       output(screen,\"   Built on:    %s\\n\",BUILD_ENV_DATE);\n")
-    fp.write("\n")
-    fp.write("       output(screen,\"   Built using: %s\\n\",BUILD_ENV_COMPILER);\n")
-    fp.write("       output(screen,\"   Build host:  %s\\n\",BUILD_ENV_UNAME);\n")
-    fp.write("       output(screen,\"   SRCDIR:      %s\\n\",BUILD_ENV_SRCDIR);\n")
-    fp.write("       output(screen,\"   BUILDDIR:    %s\\n\",BUILD_ENV_BUILDDIR);\n")
-    fp.write("\n")
-    fp.write("\n")
-    fp.write("#endif\n")
     fp.write("\n")
     fp.write("       /* Output various paths to files and directories */\n")
     fp.write("       output(screen,\"\\nPaths:\\n\");\n")
diff --git a/source3/script/build_env.sh b/source3/script/build_env.sh
deleted file mode 100755
index eb54f37aeda..00000000000
--- a/source3/script/build_env.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-if [ $# -lt 3 ]
-then
-    echo "Usage: $0 srcdir builddir compiler"
-    exit 1
-fi
-
-uname=`uname -a`
-date=`date`
-srcdir=$1
-builddir=$2
-compiler=$3
-
-if [ ! "x$USER" = "x" ]; then
-    whoami=$USER
-else
-    if [ ! "x$LOGNAME" = "x" ]; then
- whoami=$LOGNAME
-    else
- whoami=`whoami || id -un`
-    fi
-fi
-
-host=`hostname`
-
-cat <<EOF
-/* This file is automatically generated with "make include/build_env.h". DO NOT EDIT */
-
-#ifndef _BUILD_ENV_H
-#define _BUILD_ENV_H
-
-#define BUILD_ENV_UNAME "${uname}"
-#define BUILD_ENV_DATE "${date}"
-#define BUILD_ENV_SRCDIR "${srcdir}"
-#define BUILD_ENV_BUILDDIR "${builddir}"
-#define BUILD_ENV_USER "${whoami}"
-#define BUILD_ENV_HOST "${host}"
-#define BUILD_ENV_COMPILER "${compiler}"
-#endif /* _BUILD_ENV_H */
-EOF
diff --git a/source3/wscript_build b/source3/wscript_build
index a030b8ad177..1c5e4c80c0f 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -9,14 +9,6 @@ config_h = "../include/config.h"
 
 bld.SAMBA_BLDOPTIONS('smbd/build_options.c')
 
-t = bld.SAMBA_GENERATOR('build_env.h',
-                        source='script/build_env.sh',
-                        target='include/build_env.h',
-                        rule='${SRC} ${SRCDIR} ${BUILDDIR} ${CC} > ${TGT}')
-# todo: work out what is really wanted here
-t.env.SRCDIR = bld.path.abspath()
-t.env.BUILDDIR = bld.path.abspath()
-
 bld.SETUP_BUILD_GROUPS()
 
 ######################## SUBSYSTEMS #################################
--
2.12.3


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Drop compiler, build host, user and build time from smbd -b (was: Re: [PATCH] s3: drop build_env)

Samba - samba-technical mailing list
On Mon, 2017-07-10 at 18:29 +0200, Bernhard M. Wiedemann via samba-
technical wrote:
> for enabling reproducible builds, without the added complexity of
> https://lists.samba.org/archive/samba-technical/2017-June/121302.html
>
> Signed-off-by: Bernhard M. Wiedemann <[hidden email]>
> Reviewed-by: David Disseldorp <[hidden email]>

Reviewed-by: Andrew Bartlett <[hidden email]>

I've not heard any objections to this, I suggest give is a few days and
  as ddiss to autobuild it.  If you want it in 4.7, justify it as a bug
and add a BUG URL for possible backport.

BUG: https://bugzilla.samba.org/....

Thanks!

Andrew Bartlett

--
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Drop compiler, build host, user and build time from smbd -b (was: Re: [PATCH] s3: drop build_env)

Samba - samba-technical mailing list
On Tue, 2017-07-11 at 08:09 +1200, Andrew Bartlett via samba-technical
wrote:

> On Mon, 2017-07-10 at 18:29 +0200, Bernhard M. Wiedemann via samba-
> technical wrote:
> > for enabling reproducible builds, without the added complexity of
> > https://lists.samba.org/archive/samba-technical/2017-June/121302.html
> >
> > Signed-off-by: Bernhard M. Wiedemann <[hidden email]>
> > Reviewed-by: David Disseldorp <[hidden email]>
>
> Reviewed-by: Andrew Bartlett <[hidden email]>
>
> I've not heard any objections to this, I suggest give is a few days and
>   as ddiss to autobuild it.  If you want it in 4.7, justify it as a bug
> and add a BUG URL for possible backport.
>
> BUG: https://bugzilla.samba.org/....

David,

Can you push this to autobuild when you get a chance, with a bug
number?

Thanks,

Andrew Bartlett

--
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Drop compiler, build host, user and build time from smbd -b

Samba - samba-technical mailing list
On 2017-07-14 07:43, Andrew Bartlett wrote:

> On Tue, 2017-07-11 at 08:09 +1200, Andrew Bartlett via samba-technical
> wrote:
>> On Mon, 2017-07-10 at 18:29 +0200, Bernhard M. Wiedemann via samba-
>> technical wrote:
>>> for enabling reproducible builds, without the added complexity of
>>> https://lists.samba.org/archive/samba-technical/2017-June/121302.html
>>>
>>> Signed-off-by: Bernhard M. Wiedemann <[hidden email]>
>>> Reviewed-by: David Disseldorp <[hidden email]>
>>
>> Reviewed-by: Andrew Bartlett <[hidden email]>
>>
>> I've not heard any objections to this, I suggest give is a few days and
>>   as ddiss to autobuild it.  If you want it in 4.7, justify it as a bug
>> and add a BUG URL for possible backport.
>>
>> BUG: https://bugzilla.samba.org/....
>
> David,
>
> Can you push this to autobuild when you get a chance, with a bug
> number?

FYI: I had built openSUSE samba packages with that patch applied and was
able to get identical results from 2 builds.
Though that does not mean everything will be working as expected ;-)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Drop compiler, build host, user and build time from smbd -b (was: Re: [PATCH] s3: drop build_env)

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Fri, 14 Jul 2017 17:43:37 +1200, Andrew Bartlett wrote:

> Can you push this to autobuild when you get a chance, with a bug
> number?

Will do today - thanks Andrew.

Cheers, David

Loading...