Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Indexing GHC source
# GHC wrapper for indexing Haskell packages.
# Note that variables INDEXER_OUTPUT_DIR and REALGHC are set outside this script.
log() {
echo "$1" >> "$INDEXER_OUTPUT_DIR/$PKG.log"
log "GHC $*"
PKG=ghc # TODO fine-grain maybe, also differentiate binaries
# Use standard procedure to produce ghc_kythe_wrapper, see
if ! ghc_kythe_wrapper \
--prepend_path_prefix "$PKG/" \
-- \
"$@" >> "$INDEXER_OUTPUT_DIR/$PKG.entries" 2>> "$INDEXER_OUTPUT_DIR/$PKG.stderr"; then
echo "$PKG had error" >> "$INDEXER_OUTPUT_DIR/errors"
# use from
make | tee make.log
cat make.log | grep '^"/opt/ghc/bin/ghc"' | grep -v '\\$' | grep -v ' -c ' | sed 's/"\/opt\/ghc\/bin\/ghc"/.\/' >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.