check linker, other script fixups #1673

Merged
merged 1 commit into from Feb 7, 2014

Projects

None yet

2 participants

@geoff-codes

As requested in #1672. Since I'm at it, a few other minor fixups:

  • add clang, cc fallbacks if $CC is unset and gcc is not found
  • replace backticks with POSIX-style (nestable) $() expansions
  • remove unnecessary escaped newlines over logical operator ||.
  • use /usr/bin/env sh shebang so a better sh in path will override /bin/sh
  • fix to wrap columns 80
@23Skidoo 23Skidoo commented on the diff Feb 7, 2014
cabal-install/bootstrap.sh
-LD=${LD:-ld}
-GHC=${GHC:-ghc}
-GHC_PKG=${GHC_PKG:-ghc-pkg}
-WGET=${WGET:-wget}
-CURL=${CURL:-curl}
-FETCH=${FETCH:-fetch}
-TAR=${TAR:-tar}
-GUNZIP=${GUNZIP:-gunzip}
+GHC="${GHC:-ghc}"
+GHC_PKG="${GHC_PKG:-ghc-pkg}"
+GHC_VER="$(${GHC} --numeric-version)"
+WGET="${WGET:-wget}"
+CURL="${CURL:-curl}"
+FETCH="${FETCH:-fetch}"
+TAR="${TAR:-tar}"
+GZIP="${GUNZIP:-gzip}"
@23Skidoo
23Skidoo Feb 7, 2014 Haskell member

Shouldn't this line be "${GZIP:-gzip}"?

@23Skidoo 23Skidoo commented on the diff Feb 7, 2014
cabal-install/bootstrap.sh
}
unpack_pkg () {
PKG=$1
VER=$2
- rm -rf "${PKG}-${VER}.tar" "${PKG}-${VER}"/
- ${GUNZIP} -f "${PKG}-${VER}.tar.gz" \
- || die "Failed to gunzip ${PKG}-${VER}.tar.gz"
- ${TAR} -xf "${PKG}-${VER}.tar" \
- || die "Failed to untar ${PKG}-${VER}.tar.gz"
- [ -d "${PKG}-${VER}" ] \
- || die "Unpacking ${PKG}-${VER}.tar.gz did not create ${PKG}-${VER}/"
+ rm -rf "${PKG}-${VER}.tar" "${PKG}-${VER}"
+ gzip -d < "${PKG}-${VER}.tar.gz" | ${TAR} -x -
@23Skidoo
23Skidoo Feb 7, 2014 Haskell member

Shouldn't you be using $GZIP here?

@23Skidoo
Member
23Skidoo commented Feb 7, 2014

LGTM modulo minor comments.

@23Skidoo 23Skidoo merged commit 368a736 into haskell:master Feb 7, 2014

1 check passed

Details default The Travis CI build passed
@23Skidoo
Member
23Skidoo commented Feb 7, 2014

Merged, thanks!

@geoff-codes

No problem! Sorry about the typo, forgot that one .

@23Skidoo
Member
23Skidoo commented Mar 2, 2014

@g-nix
Apparently your linker detection code doesn't work on Mavericks (#1710). Can you look into that?

@geoff-codes

Yeah I'm on it. Its not actually a problem with Mavericks per se... In fact, I wrote it on Mavericks, but its the fact that the directory matches /.*/.*ld, and I failed to account for that in the regex. Should have a patch for you in a couple hours.

@23Skidoo
Member
23Skidoo commented Mar 2, 2014

Great, thanks!

@geoff-codes

@23Skidoo For review: #1710 (comment)

The issue, specifically, seems to be that if $TMPDIR is unset, on some Mac OS X systems it defaults to /var/folders/[something].

Rather that make the regex more complicated trying to detect and account for that sort of thing, I've just told it to mktemp -d /tmp/cabal-[timestamp]-[random char] if $TMPDIR is unset or matches ld.

Seem ok?

There's also a small patch to workaround a missing which, as can happen (though rare),
since its not a standard util.

@23Skidoo
Member
23Skidoo commented Mar 2, 2014

@g-nix Can you please do a pull request?

@geoff-codes

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment