Created
June 30, 2017 20:36
-
-
Save robinp/222cf3a39cc19178ec8691522056d7fe to your computer and use it in GitHub Desktop.
Indexing GHC source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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 https://github.com/google/haskell-indexer | |
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" | |
fi | |
# use serve.sh from https://github.com/google/haskell-indexer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make | tee make.log | |
cat make.log | grep '^"/opt/ghc/bin/ghc"' | grep -v '\\$' | grep -v ' -c ' | sed 's/"\/opt\/ghc\/bin\/ghc"/.\/ghc_wrapper.sh/' > index.sh | |
sh index.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment