Bug#700290: pbuilder: clang support

2013-04-04 Thread Junichi Uekawa


At Fri, 8 Mar 2013 14:38:24 +0900,
Hideki Yamane wrote:
 
 

by the way, 

asn1c)

asn1c is a compiler for ASN.1 which probably won't compile any C program, is 
that a joke or did you actually find a use for it?

-- 
dancer@{netfort.gr.jp,debian.org}


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-04-04 Thread Hideki Yamane
On Fri, 05 Apr 2013 07:23:58 +0900
Junichi Uekawa dan...@netfort.gr.jp wrote:
 by the way, 
 
   asn1c)
 
 asn1c is a compiler for ASN.1 which probably won't compile any C program, is 
 that a joke or did you actually find a use for it?

 Just a sample to add it, probably no one use it as you say...

-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-03-10 Thread Hideki Yamane
Hi,

On Sat, 09 Mar 2013 13:33:31 +0100
Sylvestre Ledru sylves...@debian.org wrote:
 Could you push it somewhere ? I would like to do some modifications on it :)
 
 (or fork the pbuilder repository before asking for a merge)

 prepare temporary repo: g...@github.com:henrich/pbuilder.git


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-03-09 Thread Sylvestre Ledru
On 08/03/2013 06:38, Hideki Yamane wrote:
 On Fri, 8 Mar 2013 05:16:26 +0900
 Hideki Yamane henr...@debian.or.jp wrote:
  update it, please use attached one.
 
  Update it again ;)
 
Could you push it somewhere ? I would like to do some modifications on it :)

(or fork the pbuilder repository before asking for a merge)

Thanks,
Sylvestre


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-03-07 Thread Hideki Yamane
Hi,

On Sun, 3 Mar 2013 15:43:10 + (UTC)
Thorsten Glaser t...@mirbsd.de wrote:
 This would allow switching to any gcc version, tcc and clang;
 adding pcc, TenDRA and other compilers is surely possible,
 and this hook script is controlled by $PBUILDER_COMPILER which
 you can just export before calling pbuilder/cowbuilder.

 Sounds great and can choose more compilers are so good.
 I'm happy when I get interesting idea from smart people :)

 I've chatted with Junichi via twitter and he encouraged hook or 
 pentium-builder package approach to me, so I thought to make
 clang-builder (or something) and use it with --extrapackage option,
 but your approach is more appropriate than mine, so I'll update
 and test your script and post it to BTS later.

 Thanks!

-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-03-07 Thread Sylvestre Ledru
On 07/03/2013 19:24, Hideki Yamane wrote:
 Hi,
 
 On Sun, 3 Mar 2013 15:43:10 + (UTC)
 Thorsten Glaser t...@mirbsd.de wrote:
 This would allow switching to any gcc version, tcc and clang;
 adding pcc, TenDRA and other compilers is surely possible,
 and this hook script is controlled by $PBUILDER_COMPILER which
 you can just export before calling pbuilder/cowbuilder.
 
  Sounds great and can choose more compilers are so good.
  I'm happy when I get interesting idea from smart people :)
 
  I've chatted with Junichi via twitter and he encouraged hook or 
  pentium-builder package approach to me, so I thought to make
  clang-builder (or something) and use it with --extrapackage option,
  but your approach is more appropriate than mine, so I'll update
  and test your script and post it to BTS later.
Excellent!
I am available to test anything!

Sylvestre


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-03-07 Thread Hideki Yamane
Hi,

On Thu, 07 Mar 2013 19:27:27 +0100
Sylvestre Ledru sylves...@debian.org wrote:
   but your approach is more appropriate than mine, so I'll update
   and test your script and post it to BTS later.

 file attached, tested gcc-4.6 and clang works (in my environment, at least).
 tcc failed since it refused some gcc option.


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


D65various-complier-support
Description: Binary data


Bug#700290: pbuilder: clang support

2013-03-07 Thread Hideki Yamane
On Fri, 8 Mar 2013 04:52:51 +0900
Hideki Yamane henr...@debian.or.jp wrote:
  file attached, tested gcc-4.6 and clang works (in my environment, at least).
  tcc failed since it refused some gcc option.

 update it, please use attached one.
 Thanks.


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


D65various-complier-support
Description: Binary data


Bug#700290: pbuilder: clang support

2013-03-07 Thread Hideki Yamane
On Fri, 8 Mar 2013 05:16:26 +0900
Hideki Yamane henr...@debian.or.jp wrote:
  update it, please use attached one.

 Update it again ;)

-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


D65various-complier-support
Description: Binary data


Bug#700290: pbuilder: clang support

2013-03-03 Thread Thorsten Glaser
Hideki Yamane dixit:

 Hookdir cannot satisfy its purpose - build with gcc, then check with clang,
 back to gcc, and use clang again... - if we choose using hookdir, we should
 add script to hookdir then remove it every time, it's not handy and doesn't
 encourage maintainers to check with clang.

It can…

I’m thinking of something like this (untested):

(cat hookdir/D60clang; chmod +x hookdir/D60compiler) 'EOF'
#!/bin/sh
set +e

# check whether we are asked to change the compiler
case $PBUILDER_COMPILER in
(clang|tcc)
replace_gcc=1
;;
(gcc-*)
replace_gcc=0
;;
(*)
exit 0
;;
esac

apt-get -y --force-yes --purge install $PBUILDER_COMPILER || {
echo 2 E: Installing the compiler '$PBUILDER_COMPILER' failed
exit 1
}
test -x /usr/bin/$PBUILDER_COMPILER || {
echo 2 E: Package '$PBUILDER_COMPILER' does not contain compiler 
driver?
exit 1
}

newcc=/usr/bin/$PBUILDER_COMPILER
case $PBUILDER_COMPILER in
(clang)
newcxx=/usr/bin/clang++
;;
(tcc)
newcxx=/bin/false
;;
(gcc-*)
newcxx=/usr/bin/g++${PBUILDER_COMPILER#gcc}
;;
(*)
# cannot happen
exit 255
esac

if test 1 = $replace_gcc; then
e=0
oldcc=$(readlink /usr/bin/gcc) || e=1
oldcxx=$(readlink /usr/bin/g++) || e=1
case $oldcc in
(/usr/bin/gcc-*)
oldcc=${oldcc#/usr/bin/}
;;
(gcc-*)
;;
(*)
e=1
;
esac
case $oldcxx in
(/usr/bin/g++-*)
oldcxx=${oldcxx#/usr/bin/}
;;
(gcc-*)
;;
(*)
e=1
;
esac
if test 1 = $e; then
echo 2 E: Old compilers ('$oldcc', '$oldcxx') do not match 
gcc-defaults
exit 1
fi
rm -f /usr/bin/$oldcc /usr/bin/$oldcxx
ln -s $newcc /usr/bin/$oldcc
ln -s $newcxx /usr/bin/$oldcxx
fi

rm -f /usr/bin/gcc /usr/bin/g++
ln -s $newcc /usr/bin/gcc
ln -s $newcxx /usr/bin/g++
rm -f /usr/bin/cc /usr/bin/++
ln -s $newcc /usr/bin/cc
ln -s $newcxx /usr/bin/c++

exit 0
EOF

This would allow switching to any gcc version, tcc and clang;
adding pcc, TenDRA and other compilers is surely possible,
and this hook script is controlled by $PBUILDER_COMPILER which
you can just export before calling pbuilder/cowbuilder.

bye,
//mirabilos
-- 
mirabilos│ untested
Natureshadow │ tut natürlich
Natureshadow │ was auch sonst ...
mirabilos│ fijn ☺


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-03-02 Thread Junichi Uekawa
At Thu, 28 Feb 2013 12:05:32 +0900,
Hideki Yamane wrote:
 
 Hi,
 
 On Thu, 28 Feb 2013 07:02:54 +0900
 Junichi Uekawa dan...@netfort.gr.jp wrote:
  I like the way this is very compact patch, but I dislike that it
  requires adding a config parameter to pbuilder (because it will need
  to be propagated to cowbuilder etc.  I wonder if it could just be
  implemented in a hook and configuration.
 
  I thought it as you, but hook is not handy for check with switching 
  between gcc and clang for testing, then take the way to add parameter.

Sorry, no please use a hookdir, it's there to be used. I don't like to
add too many options to pbuilder.

 
 
  wait, there's no A10clang hook file.
 
  Yes, it's wrong, so removed in the newer patch.
 
 -- 
 Regards,
 
  Hideki Yamane henrich @ debian.or.jp/org
  http://wiki.debian.org/HidekiYamane
 


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-03-02 Thread Hideki Yamane
On Sat, 02 Mar 2013 16:59:35 +0900
Junichi Uekawa dan...@netfort.gr.jp wrote:
 Sorry, no please use a hookdir, it's there to be used. I don't like to
 add too many options to pbuilder.

 I understand you don't like too many options, but also you don't consider
 the situations for usage of my proposal, as switching compiler.

 Hookdir cannot satisfy its purpose - build with gcc, then check with clang,
 back to gcc, and use clang again... - if we choose using hookdir, we should
 add script to hookdir then remove it every time, it's not handy and doesn't
 encourage maintainers to check with clang.


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-03-02 Thread Hideki Yamane
On Thu, 28 Feb 2013 07:24:47 +0900
Junichi Uekawa dan...@netfort.gr.jp wrote:
 I'm attaching a proposed hook script. Will this work for you?

 I missed this, now I've checked and it works.
 


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-02-27 Thread Junichi Uekawa
Hi,


Thanks for the patch.

I have a question.

At Mon, 11 Feb 2013 17:01:29 +0900,
Hideki Yamane wrote:
 
 diff -Nru pbuilder-0.213/bash_completion.d/pbuilder 
 pbuilder-0.213+nmu1/bash_completion.d/pbuilder
 --- pbuilder-0.213/bash_completion.d/pbuilder 2012-03-25 14:53:45.0 
 +0900
 +++ pbuilder-0.213+nmu1/bash_completion.d/pbuilder2013-02-11 
 14:21:58.0 +0900
 @@ -60,7 +60,7 @@
  --aptconfdir --timeout --override-config  --binary-arch \
  --preserve-buildplace --bindmounts --debug --twice 
 --autocleanaptcache \
  --compressprog --debootstrapopts --save-after-login 
 --save-after-exec \
 ---debootstrap' \
 +--debootstrap --with-clang' \
  -- $cur ) )
  if [[ $prev = @(--aptcache|--hookdir) ]]; then
  # Optionally provide a directory
 diff -Nru pbuilder-0.213/debian/changelog pbuilder-0.213+nmu1/debian/changelog
 --- pbuilder-0.213/debian/changelog   2012-10-08 08:30:05.0 +0900
 +++ pbuilder-0.213+nmu1/debian/changelog  2013-02-11 15:01:07.0 
 +0900
 @@ -1,3 +1,13 @@
 +pbuilder (0.213+nmu1) UNRELEASED; urgency=low
 +
 +  [ Hideki Yamane ]
 +  * Non-maintainer upload.
 +  * add --with-clang option to build your package with clang.
 +It would replace GCC-4.7 by default, you can specify it any version
 +with GCC_VERSION environment variable
 +
 + -- Hideki Yamane henr...@debian.org  Mon, 11 Feb 2013 14:22:38 +0900
 +
  pbuilder (0.213) unstable; urgency=low
  
[ Beatrice Torracca ]
 diff -Nru pbuilder-0.213/pbuilder-buildpackage 
 pbuilder-0.213+nmu1/pbuilder-buildpackage
 --- pbuilder-0.213/pbuilder-buildpackage  2012-03-13 17:25:15.0 
 +0900
 +++ pbuilder-0.213+nmu1/pbuilder-buildpackage 2013-02-11 15:18:41.0 
 +0900
 @@ -97,6 +97,9 @@
  executehooks D
  trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup sigpipe
  checkbuilddep $PACKAGENAME
 +if [ $CLANG = yes ]; then
 +setup_clang
 +fi
  save_aptcache
  trap umountproc_cleanbuildplace_trap exit sighup sigpipe
  
 diff -Nru pbuilder-0.213/pbuilder-buildpackage-funcs 
 pbuilder-0.213+nmu1/pbuilder-buildpackage-funcs
 --- pbuilder-0.213/pbuilder-buildpackage-funcs2012-03-31 
 13:51:11.0 +0900
 +++ pbuilder-0.213+nmu1/pbuilder-buildpackage-funcs   2013-02-11 
 16:44:51.0 +0900
 @@ -112,3 +112,22 @@
  export CCACHE_DIR=$CCACHEDIR
  fi
  }
 +

I like the way this is very compact patch, but I dislike that it
requires adding a config parameter to pbuilder (because it will need
to be propagated to cowbuilder etc.  I wonder if it could just be
implemented in a hook and configuration.

 +function setup_clang() {
 +# set appropriate GCC version.
 +if [ -z $GCC_VERSION ]; then
 + GCC_VERSION=4.7
 +fi
 +
 +$CHROOTEXEC usr/bin/apt-get -y ${APTGETOPT[@]} install clang
 +
 +echo -e \e[33mReplace gcc, g++  cpp by clang\e[m
 +for compiler in gcc-$GCC_VERSION cpp-$GCC_VERSION g++-$GCC_VERSION
 +do
 + $CHROOTEXEC rm /usr/bin/$compiler 
 + $CHROOTEXEC ln -s /usr/bin/clang /usr/bin/$compiler 
 +done
 +
 +echo -e \e[33mCheck if gcc, g++  cpp are actually clang\e[m
 +$CHROOTEXEC usr/bin/gcc --version| grep clang  /dev/null || exit 1
 +}
 diff -Nru pbuilder-0.213/pbuilder-checkparams 
 pbuilder-0.213+nmu1/pbuilder-checkparams
 --- pbuilder-0.213/pbuilder-checkparams   2012-03-09 07:54:41.0 
 +0900
 +++ pbuilder-0.213+nmu1/pbuilder-checkparams  2013-02-11 14:20:54.0 
 +0900
 @@ -260,6 +260,10 @@
   TWICE=yes
   shift;
   ;;
 + --with-clang)
 + CLANG=yes
 + shift;
 + ;;
   --) # end of processing for this
   shift;
   break;
 diff -Nru pbuilder-0.213/pbuilder-modules pbuilder-0.213+nmu1/pbuilder-modules
 --- pbuilder-0.213/pbuilder-modules   2012-03-31 13:50:46.0 +0900
 +++ pbuilder-0.213+nmu1/pbuilder-modules  2013-02-11 14:51:33.0 
 +0900
 @@ -79,6 +79,7 @@
   --debootstrapopts [debootstrap options]
   --save-after-login/--save-after-exec
   --debootstrap [debootstrap|cdebootstrap]
 + --with-clang
  
  pdebuild-specific pbuilder-options:
   --pbuilderroot [command to obtain root privilege for pbuilder] 
 diff -Nru pbuilder-0.213/pbuilder.8 pbuilder-0.213+nmu1/pbuilder.8
 --- pbuilder-0.213/pbuilder.8 2012-03-09 07:54:41.0 +0900
 +++ pbuilder-0.213+nmu1/pbuilder.82013-02-11 14:35:27.0 +0900
 @@ -534,6 +534,11 @@
  properly.  The resulting packages are the ones from the second build.
  
  .TP
 +.BI \-\-with\-clang
 +Build the package with clang, instead of gcc.
 +Also you should use A10clang hook file in example.

wait, there's no A10clang hook file.


 +
 +.TP
  .BI \-\-preserve\-buildplace
  Do not clean the
  .B \-\-buildplace


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact 

Bug#700290: pbuilder: clang support

2013-02-27 Thread Junichi Uekawa
I'm attaching a proposed hook script. Will this work for you?

#!/bin/bash
# Force use of clang instead of GCC.
function setup_clang() {
local GCC_VERSION=$(readlink /usr/bin/gcc | sed 's/^gcc\-//')

apt-get -y ${APTGETOPT[@]} install clang

echo -e \e[33mReplace gcc, g++  cpp by clang\e[m
for compiler in gcc-$GCC_VERSION cpp-$GCC_VERSION g++-$GCC_VERSION; do
rm /usr/bin/$compiler 
ln -s /usr/bin/clang /usr/bin/$compiler 
done

echo -e \e[33mCheck if gcc, g++  cpp are actually clang\e[m
usr/bin/gcc --version| grep clang  /dev/null || exit 1
}

setup_clang

At Sat, 23 Feb 2013 22:39:04 +0900,
Hideki Yamane wrote:
 
 diff -Nru pbuilder-0.213/bash_completion.d/pbuilder 
 pbuilder-0.213+nmu1/bash_completion.d/pbuilder
 --- pbuilder-0.213/bash_completion.d/pbuilder 2012-03-25 14:53:45.0 
 +0900
 +++ pbuilder-0.213+nmu1/bash_completion.d/pbuilder2013-02-11 
 14:21:58.0 +0900
 @@ -60,7 +60,7 @@
  --aptconfdir --timeout --override-config  --binary-arch \
  --preserve-buildplace --bindmounts --debug --twice 
 --autocleanaptcache \
  --compressprog --debootstrapopts --save-after-login 
 --save-after-exec \
 ---debootstrap' \
 +--debootstrap --with-clang' \
  -- $cur ) )
  if [[ $prev = @(--aptcache|--hookdir) ]]; then
  # Optionally provide a directory
 diff -Nru pbuilder-0.213/debian/changelog pbuilder-0.213+nmu1/debian/changelog
 --- pbuilder-0.213/debian/changelog   2012-10-08 08:30:05.0 +0900
 +++ pbuilder-0.213+nmu1/debian/changelog  2013-02-11 15:01:07.0 
 +0900
 @@ -1,3 +1,13 @@
 +pbuilder (0.213+nmu1) UNRELEASED; urgency=low
 +
 +  [ Hideki Yamane ]
 +  * Non-maintainer upload.
 +  * add --with-clang option to build your package with clang.
 +It would replace GCC by default(Thanks Luca Falavigna 
 dktrkr...@debian.org),
 +also you can specify it any version with GCC_VERSION environment 
 variable.
 +
 + -- Hideki Yamane henr...@debian.org  Mon, 11 Feb 2013 14:22:38 +0900
 +
  pbuilder (0.213) unstable; urgency=low
  
[ Beatrice Torracca ]
 diff -Nru pbuilder-0.213/pbuilder-buildpackage 
 pbuilder-0.213+nmu1/pbuilder-buildpackage
 --- pbuilder-0.213/pbuilder-buildpackage  2012-03-13 17:25:15.0 
 +0900
 +++ pbuilder-0.213+nmu1/pbuilder-buildpackage 2013-02-11 15:18:41.0 
 +0900
 @@ -97,6 +97,9 @@
  executehooks D
  trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup sigpipe
  checkbuilddep $PACKAGENAME
 +if [ $CLANG = yes ]; then
 +setup_clang
 +fi
  save_aptcache
  trap umountproc_cleanbuildplace_trap exit sighup sigpipe
  
 diff -Nru pbuilder-0.213/pbuilder-buildpackage-funcs 
 pbuilder-0.213+nmu1/pbuilder-buildpackage-funcs
 --- pbuilder-0.213/pbuilder-buildpackage-funcs2012-03-31 
 13:51:11.0 +0900
 +++ pbuilder-0.213+nmu1/pbuilder-buildpackage-funcs   2013-02-11 
 16:44:51.0 +0900
 @@ -112,3 +112,22 @@
  export CCACHE_DIR=$CCACHEDIR
  fi
  }
 +
 +function setup_clang() {
 +# set appropriate GCC version.
 +if [ -z $GCC_VERSION ]; then
 + GCC_VERSION=$(readlink /usr/bin/gcc | sed 's/^gcc\-//')
 +fi
 +
 +$CHROOTEXEC usr/bin/apt-get -y ${APTGETOPT[@]} install clang
 +
 +echo -e \e[33mReplace gcc, g++  cpp by clang\e[m
 +for compiler in gcc-$GCC_VERSION cpp-$GCC_VERSION g++-$GCC_VERSION
 +do
 + $CHROOTEXEC rm /usr/bin/$compiler 
 + $CHROOTEXEC ln -s /usr/bin/clang /usr/bin/$compiler 
 +done
 +
 +echo -e \e[33mCheck if gcc, g++  cpp are actually clang\e[m
 +$CHROOTEXEC usr/bin/gcc --version| grep clang  /dev/null || exit 1
 +}
 diff -Nru pbuilder-0.213/pbuilder-checkparams 
 pbuilder-0.213+nmu1/pbuilder-checkparams
 --- pbuilder-0.213/pbuilder-checkparams   2012-03-09 07:54:41.0 
 +0900
 +++ pbuilder-0.213+nmu1/pbuilder-checkparams  2013-02-11 14:20:54.0 
 +0900
 @@ -260,6 +260,10 @@
   TWICE=yes
   shift;
   ;;
 + --with-clang)
 + CLANG=yes
 + shift;
 + ;;
   --) # end of processing for this
   shift;
   break;
 diff -Nru pbuilder-0.213/pbuilder-modules pbuilder-0.213+nmu1/pbuilder-modules
 --- pbuilder-0.213/pbuilder-modules   2012-03-31 13:50:46.0 +0900
 +++ pbuilder-0.213+nmu1/pbuilder-modules  2013-02-11 14:51:33.0 
 +0900
 @@ -79,6 +79,7 @@
   --debootstrapopts [debootstrap options]
   --save-after-login/--save-after-exec
   --debootstrap [debootstrap|cdebootstrap]
 + --with-clang
  
  pdebuild-specific pbuilder-options:
   --pbuilderroot [command to obtain root privilege for pbuilder] 
 diff -Nru pbuilder-0.213/pbuilder.8 pbuilder-0.213+nmu1/pbuilder.8
 --- pbuilder-0.213/pbuilder.8 2012-03-09 07:54:41.0 +0900
 +++ pbuilder-0.213+nmu1/pbuilder.82013-02-11 14:35:27.0 +0900
 @@ -534,6 +534,10 @@
  properly.  The resulting packages 

Bug#700290: pbuilder: clang support

2013-02-27 Thread Thorsten Glaser
Junichi Uekawa dixit:

to be propagated to cowbuilder etc.  I wonder if it could just be
implemented in a hook and configuration.

This looks like simply a (one) hook can do it, yeah.

I’d suggest a D hook, so a package can still Build-Conflicts
on clang if needed.

bye,
//mirabilos
-- 
„nein: BerliOS und Sourceforge sind Plattformen für Projekte, github ist
eine Plattform für Einzelkämpfer“
-- dieses Zitat ist ein Beweis dafür, daß auch ein blindes Huhn
   mal ein Korn findet, bzw. – in diesem Fall – Recht haben kann


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-02-27 Thread Hideki Yamane
Hi,

On Thu, 28 Feb 2013 07:02:54 +0900
Junichi Uekawa dan...@netfort.gr.jp wrote:
 I like the way this is very compact patch, but I dislike that it
 requires adding a config parameter to pbuilder (because it will need
 to be propagated to cowbuilder etc.  I wonder if it could just be
 implemented in a hook and configuration.

 I thought it as you, but hook is not handy for check with switching 
 between gcc and clang for testing, then take the way to add parameter.


 wait, there's no A10clang hook file.

 Yes, it's wrong, so removed in the newer patch.

-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-02-23 Thread Hideki Yamane
Hi,

On Tue, 19 Feb 2013 07:10:26 +0100
Luca Falavigna dktrkr...@debian.org wrote:
 Instead of hardcoding GCC version (which can vary across different
 architectures), you can use something similar to the following:
 GCC_VERSION=$(readlink /usr/bin/gcc | sed 's/gcc-//')

 Thanks Luca, that's really good than mine, so revised patch attached.


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane
diff -Nru pbuilder-0.213/bash_completion.d/pbuilder pbuilder-0.213+nmu1/bash_completion.d/pbuilder
--- pbuilder-0.213/bash_completion.d/pbuilder	2012-03-25 14:53:45.0 +0900
+++ pbuilder-0.213+nmu1/bash_completion.d/pbuilder	2013-02-11 14:21:58.0 +0900
@@ -60,7 +60,7 @@
 --aptconfdir --timeout --override-config  --binary-arch \
 --preserve-buildplace --bindmounts --debug --twice --autocleanaptcache \
 --compressprog --debootstrapopts --save-after-login --save-after-exec \
---debootstrap' \
+--debootstrap --with-clang' \
 -- $cur ) )
 if [[ $prev = @(--aptcache|--hookdir) ]]; then
 # Optionally provide a directory
diff -Nru pbuilder-0.213/debian/changelog pbuilder-0.213+nmu1/debian/changelog
--- pbuilder-0.213/debian/changelog	2012-10-08 08:30:05.0 +0900
+++ pbuilder-0.213+nmu1/debian/changelog	2013-02-11 15:01:07.0 +0900
@@ -1,3 +1,13 @@
+pbuilder (0.213+nmu1) UNRELEASED; urgency=low
+
+  [ Hideki Yamane ]
+  * Non-maintainer upload.
+  * add --with-clang option to build your package with clang.
+It would replace GCC by default(Thanks Luca Falavigna dktrkr...@debian.org),
+also you can specify it any version with GCC_VERSION environment variable.
+
+ -- Hideki Yamane henr...@debian.org  Mon, 11 Feb 2013 14:22:38 +0900
+
 pbuilder (0.213) unstable; urgency=low
 
   [ Beatrice Torracca ]
diff -Nru pbuilder-0.213/pbuilder-buildpackage pbuilder-0.213+nmu1/pbuilder-buildpackage
--- pbuilder-0.213/pbuilder-buildpackage	2012-03-13 17:25:15.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder-buildpackage	2013-02-11 15:18:41.0 +0900
@@ -97,6 +97,9 @@
 executehooks D
 trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup sigpipe
 checkbuilddep $PACKAGENAME
+if [ $CLANG = yes ]; then
+setup_clang
+fi
 save_aptcache
 trap umountproc_cleanbuildplace_trap exit sighup sigpipe
 
diff -Nru pbuilder-0.213/pbuilder-buildpackage-funcs pbuilder-0.213+nmu1/pbuilder-buildpackage-funcs
--- pbuilder-0.213/pbuilder-buildpackage-funcs	2012-03-31 13:51:11.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder-buildpackage-funcs	2013-02-11 16:44:51.0 +0900
@@ -112,3 +112,22 @@
 export CCACHE_DIR=$CCACHEDIR
 fi
 }
+
+function setup_clang() {
+# set appropriate GCC version.
+if [ -z $GCC_VERSION ]; then
+	GCC_VERSION=$(readlink /usr/bin/gcc | sed 's/^gcc\-//')
+fi
+
+$CHROOTEXEC usr/bin/apt-get -y ${APTGETOPT[@]} install clang
+
+echo -e \e[33mReplace gcc, g++  cpp by clang\e[m
+for compiler in gcc-$GCC_VERSION cpp-$GCC_VERSION g++-$GCC_VERSION
+do
+	$CHROOTEXEC rm /usr/bin/$compiler 
+	$CHROOTEXEC ln -s /usr/bin/clang /usr/bin/$compiler 
+done
+
+echo -e \e[33mCheck if gcc, g++  cpp are actually clang\e[m
+$CHROOTEXEC usr/bin/gcc --version| grep clang  /dev/null || exit 1
+}
diff -Nru pbuilder-0.213/pbuilder-checkparams pbuilder-0.213+nmu1/pbuilder-checkparams
--- pbuilder-0.213/pbuilder-checkparams	2012-03-09 07:54:41.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder-checkparams	2013-02-11 14:20:54.0 +0900
@@ -260,6 +260,10 @@
 	TWICE=yes
 	shift;
 	;;
+	--with-clang)
+	CLANG=yes
+	shift;
+	;;
 	--) # end of processing for this
 	shift;
 	break;
diff -Nru pbuilder-0.213/pbuilder-modules pbuilder-0.213+nmu1/pbuilder-modules
--- pbuilder-0.213/pbuilder-modules	2012-03-31 13:50:46.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder-modules	2013-02-11 14:51:33.0 +0900
@@ -79,6 +79,7 @@
  --debootstrapopts [debootstrap options]
  --save-after-login/--save-after-exec
  --debootstrap [debootstrap|cdebootstrap]
+ --with-clang
 
 pdebuild-specific pbuilder-options:
  --pbuilderroot [command to obtain root privilege for pbuilder] 
diff -Nru pbuilder-0.213/pbuilder.8 pbuilder-0.213+nmu1/pbuilder.8
--- pbuilder-0.213/pbuilder.8	2012-03-09 07:54:41.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder.8	2013-02-11 14:35:27.0 +0900
@@ -534,6 +534,10 @@
 properly.  The resulting packages are the ones from the second build.
 
 .TP
+.BI \-\-with\-clang
+Build the package with clang, instead of gcc.
+
+.TP
 .BI \-\-preserve\-buildplace
 Do not clean the
 .B \-\-buildplace


Bug#700290: pbuilder: clang support

2013-02-21 Thread Nobuhiro Iwamatsu
Hi,

 Hi,

  I've made a tiny patch for clang support in pbuilder, it runs with
  --with-clang option. It would make build check in clang easier,
  and encourage maintainers to do that.

  Could you check and apply it, please?

You need to update cowbuilder too.
Because cowbuilder and pbuilder share options.
I attached a tiny patch.

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6


cowbuilder.patch
Description: Binary data


Bug#700290: pbuilder: clang support

2013-02-18 Thread Luca Falavigna
Instead of hardcoding GCC version (which can vary across different
architectures), you can use something similar to the following:
GCC_VERSION=$(readlink /usr/bin/gcc | sed 's/gcc-//')


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#700290: pbuilder: clang support

2013-02-11 Thread Hideki Yamane
Package: pbuilder
Severity: wishlist
Tags: patch
X-Debbugs-CC: sylves...@debian.org

Hi,

 I've made a tiny patch for clang support in pbuilder, it runs with
 --with-clang option. It would make build check in clang easier,
 and encourage maintainers to do that.

 Could you check and apply it, please?


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane
diff -Nru pbuilder-0.213/bash_completion.d/pbuilder pbuilder-0.213+nmu1/bash_completion.d/pbuilder
--- pbuilder-0.213/bash_completion.d/pbuilder	2012-03-25 14:53:45.0 +0900
+++ pbuilder-0.213+nmu1/bash_completion.d/pbuilder	2013-02-11 14:21:58.0 +0900
@@ -60,7 +60,7 @@
 --aptconfdir --timeout --override-config  --binary-arch \
 --preserve-buildplace --bindmounts --debug --twice --autocleanaptcache \
 --compressprog --debootstrapopts --save-after-login --save-after-exec \
---debootstrap' \
+--debootstrap --with-clang' \
 -- $cur ) )
 if [[ $prev = @(--aptcache|--hookdir) ]]; then
 # Optionally provide a directory
diff -Nru pbuilder-0.213/debian/changelog pbuilder-0.213+nmu1/debian/changelog
--- pbuilder-0.213/debian/changelog	2012-10-08 08:30:05.0 +0900
+++ pbuilder-0.213+nmu1/debian/changelog	2013-02-11 15:01:07.0 +0900
@@ -1,3 +1,13 @@
+pbuilder (0.213+nmu1) UNRELEASED; urgency=low
+
+  [ Hideki Yamane ]
+  * Non-maintainer upload.
+  * add --with-clang option to build your package with clang.
+It would replace GCC-4.7 by default, you can specify it any version
+with GCC_VERSION environment variable
+
+ -- Hideki Yamane henr...@debian.org  Mon, 11 Feb 2013 14:22:38 +0900
+
 pbuilder (0.213) unstable; urgency=low
 
   [ Beatrice Torracca ]
diff -Nru pbuilder-0.213/pbuilder-buildpackage pbuilder-0.213+nmu1/pbuilder-buildpackage
--- pbuilder-0.213/pbuilder-buildpackage	2012-03-13 17:25:15.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder-buildpackage	2013-02-11 15:18:41.0 +0900
@@ -97,6 +97,9 @@
 executehooks D
 trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup sigpipe
 checkbuilddep $PACKAGENAME
+if [ $CLANG = yes ]; then
+setup_clang
+fi
 save_aptcache
 trap umountproc_cleanbuildplace_trap exit sighup sigpipe
 
diff -Nru pbuilder-0.213/pbuilder-buildpackage-funcs pbuilder-0.213+nmu1/pbuilder-buildpackage-funcs
--- pbuilder-0.213/pbuilder-buildpackage-funcs	2012-03-31 13:51:11.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder-buildpackage-funcs	2013-02-11 16:44:51.0 +0900
@@ -112,3 +112,22 @@
 export CCACHE_DIR=$CCACHEDIR
 fi
 }
+
+function setup_clang() {
+# set appropriate GCC version.
+if [ -z $GCC_VERSION ]; then
+	GCC_VERSION=4.7
+fi
+
+$CHROOTEXEC usr/bin/apt-get -y ${APTGETOPT[@]} install clang
+
+echo -e \e[33mReplace gcc, g++  cpp by clang\e[m
+for compiler in gcc-$GCC_VERSION cpp-$GCC_VERSION g++-$GCC_VERSION
+do
+	$CHROOTEXEC rm /usr/bin/$compiler 
+	$CHROOTEXEC ln -s /usr/bin/clang /usr/bin/$compiler 
+done
+
+echo -e \e[33mCheck if gcc, g++  cpp are actually clang\e[m
+$CHROOTEXEC usr/bin/gcc --version| grep clang  /dev/null || exit 1
+}
diff -Nru pbuilder-0.213/pbuilder-checkparams pbuilder-0.213+nmu1/pbuilder-checkparams
--- pbuilder-0.213/pbuilder-checkparams	2012-03-09 07:54:41.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder-checkparams	2013-02-11 14:20:54.0 +0900
@@ -260,6 +260,10 @@
 	TWICE=yes
 	shift;
 	;;
+	--with-clang)
+	CLANG=yes
+	shift;
+	;;
 	--) # end of processing for this
 	shift;
 	break;
diff -Nru pbuilder-0.213/pbuilder-modules pbuilder-0.213+nmu1/pbuilder-modules
--- pbuilder-0.213/pbuilder-modules	2012-03-31 13:50:46.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder-modules	2013-02-11 14:51:33.0 +0900
@@ -79,6 +79,7 @@
  --debootstrapopts [debootstrap options]
  --save-after-login/--save-after-exec
  --debootstrap [debootstrap|cdebootstrap]
+ --with-clang
 
 pdebuild-specific pbuilder-options:
  --pbuilderroot [command to obtain root privilege for pbuilder] 
diff -Nru pbuilder-0.213/pbuilder.8 pbuilder-0.213+nmu1/pbuilder.8
--- pbuilder-0.213/pbuilder.8	2012-03-09 07:54:41.0 +0900
+++ pbuilder-0.213+nmu1/pbuilder.8	2013-02-11 14:35:27.0 +0900
@@ -534,6 +534,11 @@
 properly.  The resulting packages are the ones from the second build.
 
 .TP
+.BI \-\-with\-clang
+Build the package with clang, instead of gcc.
+Also you should use A10clang hook file in example.
+
+.TP
 .BI \-\-preserve\-buildplace
 Do not clean the
 .B \-\-buildplace


Bug#700290: pbuilder: clang support

2013-02-11 Thread Sylvestre Ledru
On 11/02/2013 09:01, Hideki Yamane wrote:
 Package: pbuilder
 Severity: wishlist
 Tags: patch
 X-Debbugs-CC: sylves...@debian.org
 
 Hi,
 
  I've made a tiny patch for clang support in pbuilder, it runs with
  --with-clang option. It would make build check in clang easier,
  and encourage maintainers to do that.
 
  Could you check and apply it, please?
 
 
That is an excellent initiative. Many thanks for proposing and
implementing it! :)

Sylvestre


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org