pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


nfstest_gcc_build.ksh93
Posted by Anonymous on Thu 29th Feb 2024 12:50
raw | new post
view followups (newest first): nfstest_gcc_build.ksh93 by Anonymous
modification of post by Anonymous (view diff)

  1. #!/usr/bin/ksh93
  2.  
  3. #
  4. # nfstest_gcc_build.ksh93
  5. #
  6. # Simple NFSv4 torture test by building gcc in parallel
  7. # on a NFS filesystem
  8. #
  9. set -o xtrace
  10. set -o errexit
  11. set -o nounset
  12.  
  13. #
  14. # build config
  15. #
  16. typeset config_cp_p_function_not_implemented_workaround=false
  17. typeset config_use_posix_ksh93_builtins=true
  18.  
  19. #
  20. # source checkout
  21. #
  22.  
  23. #time git -c checkout.workers=16 clone -b 'releases/gcc-13.2.0' --single-branch git://gcc.gnu.org/git/gcc.git
  24. #time git -c checkout.workers=16 clone -b 'releases/gcc-13.2.0' --single-branch https://github.com/gcc-mirror/gcc.git
  25.  
  26. if [[ -f '../gcc.bundle' ]] ; then
  27.         # Use local bundle as cache
  28.         # The bundle was created like this:
  29.         # ---- snip ----
  30.         # git clone git://repo.or.cz/gcc.git
  31.         # cd gcc
  32.         # git bundle create '../gcc.bundle' --all
  33.         # cd ..
  34.         # rm -Rf gcc
  35.         # ---- snip ----
  36.         time git -c checkout.workers=16 clone -b 'releases/gcc-13.2.0' --single-branch '../gcc.bundle'
  37. else
  38.         time git -c checkout.workers=16 clone -b 'releases/gcc-13.2.0' --single-branch git://repo.or.cz/gcc.git
  39. fi
  40.  
  41. cd "$PWD/gcc/"
  42.  
  43. if $config_use_posix_ksh93_builtins ; then
  44.         PATH="/usr/ast/bin:/opt/ast/bin:$PATH"
  45. fi
  46.  
  47. #
  48. # patch sources and configure build
  49. #
  50.  
  51. # Cygwin: workaround for configure using cp -p where ln -s should be used
  52. # (this is an automake/autoconf issue, they should trust Cygwin and not use
  53. # ancient workarounds for issues which no longer exists)
  54. (set -o xtrace ; sed -i "s/as_ln_s='cp -pR'/as_ln_s='ln -s'/g" $(find . -name 'configure') )
  55.  
  56. if $config_use_posix_ksh93_builtins ; then
  57.         (set -o xtrace ; sed -i "s/\/bin\/sh/\/bin\/ksh93/g" $(find . -name 'configure') )
  58. fi
  59.  
  60. if $config_use_posix_ksh93_builtins ; then
  61.         ksh93 ./configure
  62. else
  63.         bash ./configure
  64. fi
  65.  
  66. if $config_cp_p_function_not_implemented_workaround ; then
  67.         # workaround for $ cp -p # failing with "Function not
  68.         # implemented" in older versions of ms-nfs41-client
  69.         if $config_use_posix_ksh93_builtins ; then
  70.                 (
  71.                         set -o xtrace
  72.                         sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\1\2 -A pt /g' \
  73.                                 $(find . -name 'Makefile' -o -name 'Makefile.in')
  74.                 )
  75.         else
  76.                 (
  77.                         set -o xtrace ; sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\1\2--no-preserve=ownership /g' \
  78.                                 $(find . -name 'Makefile' -o -name 'Makefile.in')
  79.                 )
  80.         fi
  81. fi
  82.  
  83. if $config_use_posix_ksh93_builtins ; then
  84.         # replace /bin/sh with /bin/ksh93 for speed
  85.         (set -o xtrace ; sed -i -r 's/\/bin\/sh/\/bin\/ksh93/g' \
  86.                 $(find . -name 'Makefile' -o -name 'Makefile.in') )
  87. fi
  88.  
  89. #
  90. # build gcc
  91. #
  92. ksh93 -c 'export SHELL=/bin/ksh93 ; (yes | make -j4 all)'
  93. echo $?
  94.  
  95. echo "#Done."

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at