Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mailutils fails to build on master #27475

Closed
fadenb opened this issue Jul 18, 2017 · 9 comments
Closed

mailutils fails to build on master #27475

fadenb opened this issue Jul 18, 2017 · 9 comments
Milestone

Comments

@fadenb
Copy link
Contributor

fadenb commented Jul 18, 2017

Issue description

The package mailutils fails to build on master for some time now: https://hydra.nixos.org/build/56249845
I was able to reproduce the error on my machine. Git bisect lead me to commit d07f30f as first bad one but I do not know why it would cause the failure.

ping @ryantrinkle (author of suspected commit), @vrthra (maintainer of mailutils)

Steps to reproduce

With current nixpkgs master:
nix-build '<nixpkgs>' --option build-use-chroot true --option build-use-sandbox true --keep-going -A mailutils

Technical details

https://nix-cache.s3.amazonaws.com/log/sxc52lb5c1gd9idldqq0drz3nln65xap-mailutils-2.2.drv

  • Nix version: 1.11.11
@mbrock
Copy link
Contributor

mbrock commented Jul 19, 2017

I believe I have traced this to a syntax error generated by pkgs/build-support/cc-wrapper/utils.sh when running ./configure.

This error is visible in config.log of mailutils. It causes the configure script to believe that all kinds of things are not present when in fact they are.

Maybe it's because there's no explicit bash shebang in the shell script, and with recent changes it uses bash-only syntaxes.

I've added the shebang locally, but this seems to cause a massive rebuild.

@mbrock
Copy link
Contributor

mbrock commented Jul 19, 2017

It seems that the utils.sh thing (expandResponseParams) only sometimes fails...

configure:25297: gcc -o conftest -g -O2   conftest.c  >&5
configure:25301: $? = 0
configure:25307: ./conftest
configure:25311: $? = 0
configure:25329: result: yes
configure:25337: checking for working GNU getopt function
configure:25420: gcc -o conftest -g -O2   conftest.c  >&5
/nix/store/wwmqxwrcn2sd65l7y8kzck4gk4cir4mn-gcc-wrapper-5.4.0/nix-support/utils.sh: line 32: syntax error near unexpected token `<'
configure:25424: $? = 2
configure: program exited with status 2

@pbogdan
Copy link
Member

pbogdan commented Jul 19, 2017

It looks like something somewhere is setting POSIXLY_CORRECT env variable which affects bash behaviour gist
EDIT seems that's coming from the configure script of mailutils

@pbogdan
Copy link
Member

pbogdan commented Jul 19, 2017

$ cat pkgs/tools/networking/mailutils/cc-wrapper.sh                                                                                                                                        ~/nixpkgs
unset POSIXLY_CORRECT
cc=$1
shift
"$cc" "$@"
$ git diff
diff --git a/pkgs/tools/networking/mailutils/default.nix b/pkgs/tools/networking/mailutils/default.nix               
index f83ea004db..7b4fa483ab 100644                 
--- a/pkgs/tools/networking/mailutils/default.nix        
+++ b/pkgs/tools/networking/mailutils/default.nix      
@@ -20,6 +20,10 @@ stdenv.mkDerivation rec {                                                                                                                                                                      
       */Makefile{,.in,.am}                         
   '';                                                                                                                                                                                                            
                                                                                                      
+  preConfigure = ''                                                                            
+    CC="${stdenv.shell} ${./cc-wrapper.sh} ${stdenv.cc}/bin/${stdenv.cc.cc.CC}"                                                                                                                                  
+  '';                                                                                             
+                                                                                                                                                                                                                 
   configureFlags = [                              
     "--with-gsasl"
     "--with-gssapi=${gss}"

To be clear - I'm not proposing this as a solution, this was merely to test the hypothesis.. It does make the build succeed though 😆

@fadenb
Copy link
Contributor Author

fadenb commented Jul 22, 2017

I did some further testing and the commit breaking seems to be 2bc7b4e (@orivej). With 2bc7b4e reverted I was able to build mailutils.

@orivej
Copy link
Contributor

orivej commented Jul 22, 2017

The issue is that mailutils configure exports POSIXLY_CORRECT=1 which disables Bash features relied upon by our wrappers. We can patch configure (or patch m4/getopt.m4 and run autoconf), or add set +o posix to all the wrappers, or wrap bash that interprets wrappers with a script that sets set +o posix

@orivej
Copy link
Contributor

orivej commented Jul 22, 2017

The problematic code was deleted in subsequent releases of mailutils. I'll try to update it to the latest version 3.2.

@orivej orivej mentioned this issue Jul 23, 2017
8 tasks
@orivej
Copy link
Contributor

orivej commented Jul 23, 2017

If you use mailutils, please test #27580

@ckauhaus
Copy link
Contributor

Tested #27595 on a real mail server and found no problems. Thanks for the fix. 👍

@globin globin closed this as completed Jul 31, 2017
@globin globin added this to the 17.09 milestone Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants