Code Monkey home page Code Monkey logo

Comments (5)

charles2910 avatar charles2910 commented on June 7, 2024 2

Sorry guys, maybe I didn't give the correct context. What triggers the unreproducibility is recording the CFLAGS used at build time in neomutt's binary. This is done in auto.def:

###############################################################################
# Generate conststrings.c
set conststrings "\
  unsigned char cc_cflags\[\] = {[text2c [expr {
    [get-define want-include-path-in-cflags]
    ? [get-define CFLAGS]
    : [lkill [get-define CFLAGS] {{x} {string equal -length 2 $x {-I}}}]
  }]]};\n\
  unsigned char configure_options\[\] = {[text2c $conf_options]};\n"
if {[catch {set fd [open conststrings.c w]
            puts $fd $conststrings
            close $fd} msg]} {
  user-error "Cannot write conststrings.c: $msg"
}

###############################################################################

And used in version.c:

rstrip_in_place((char *) configure_options);
fprintf(fp, "\n\n%sConfigure options:%s %s\n", col_bold, col_end, (char *) configure_options);

rstrip_in_place((char *) cc_cflags);
fprintf(fp, "\n%sCompilation CFLAGS:%s %s\n", col_bold, col_end, (char *) cc_cflags);

fprintf(fp, "\n%s%s%s\n", col_bold, _("Compile options:"), col_end);
print_compile_options(CompOpts, fp);

Since we use -ffile-prefix-map to allow builds to be reproducible, it is recorded in the binary together with other CFLAGS, but since it can be a bit arbitrary (depending on the build path used) it makes the binary unreproducible.

The proposal here is to only remove -ffile-prefix-map=<some-path> from the CFLAGS recorded in the binary, not at all changing the CFLAGS itself during build time.

There is already something like this in auto.def:

# Misc
  include-path-in-cflags=1  => "Remove include paths from CFLAGS in the output of neomutt -v"

So the proposal would be something like:

include-ffile-prefix-map-in-cflags=1  => "Remove -ffile-prefix-map from CFLAGS in the output of neomutt -v"

from neomutt.

ossilator avatar ossilator commented on June 7, 2024 1

he isn't. these are very much part of the build configuration.

from neomutt.

gahr avatar gahr commented on June 7, 2024

We don't set that cflag ourselves, but we honour whatever cflags the host environment sets. So I guess if you want a reproducible build, you want to make sure that cflags isn't set. I don't think we should try to outsmart whoever builds neomutt by removing cflags.

from neomutt.

ossilator avatar ossilator commented on June 7, 2024

given the purpose of -ffile-prefix-map, i'd be a tad surprised if it caused the build to be non-reproducible. if anything, the specified files are incomplete.

from neomutt.

gahr avatar gahr commented on June 7, 2024

@charles2910 I guess you're also concerned about paths in the configure options section of -v?

Configure options: CC=clang17 CXX=clang++17 --disable-nls --pgp --disable-idn2 --fmemopen --gpgme --lmdb --ssl --pcre2 --with-ssl=/usr/local --with-ncurses=/usr 

from neomutt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.