pyston / pyston_v1

The previous version of Pyston, a faster implementation of the Python programming language. Please use this link for the new repository:
https://github.com/pyston/pyston/
4.89k stars 289 forks source link

Pull LLVM and Clang into Pyston as git submodules for version tracking #241

Closed dagar closed 9 years ago

dagar commented 9 years ago

Instructions for adding LLVM and Clang to Pyston as git submodules. This simplifies the installation and removes the need for everyone to run llvm_up.

Fork llvm-mirrors under the Dropbox github organization Fork llvm https://github.com/llvm-mirror/llvm Fork clang https://github.com/llvm-mirror/clang

Add them to Pyston as submodules

cd ~/pyston
git submodule add https://github.com/Dropbox/llvm
git submodule add https://github.com/Dropbox/clang

Apply Pyston patches

python ./tools/git_svn_gotorev.py ./llvm `cat llvm_revision.txt` ./llvm_patches
python ./tools/git_svn_gotorev.py ./clang `cat llvm_revision.txt` ./clang_patches

Push the cur branches back to github

cd ~/pyston/llvm && git push origin cur
cd ~/pyston/clang && git push origin cur

Push the Pyston commit adding llvm and clang

cd ~/pyston
git add .
git commit -m "add LLVM and Clang git submodules"
git push

I'll update cmake so that 'git submodule update --init' will run automatically. The llvm_up target can still be used to apply new patches.

Now the entire Ubuntu 14.04 instructions looks like this

sudo apt-get install -yq git cmake ninja-build ccache libncurses5-dev liblzma-dev libreadline-dev libgmp3-dev autoconf libtool python-dev texlive-extra-utils clang-3.5

git clone --recursive https://github.com/dropbox/pyston.git ~/pyston

mkdir ~/pyston-build && cd ~/pyston-build
CC='clang' CXX='clang++' cmake -GNinja ~/pyston

ninja check-pyston
dagar commented 9 years ago

After a closer look at git_svn_gotorev.py I don't think it currently works quite right with llvm and clang in detached head mode (ie git submodules). I'll figure out how to keep them updated if we go this route.

kmod commented 9 years ago

I think this is a little bit trickier than just mirroring the code on github; we probably have to do something like use tags to make sure that things don't get git GC'd. We'd probably also want to verify that we can go back and forth across the migration commit, and that we can do LLVM bisections.

Anyway, I still think this is a good idea, but I'm not super psyched about implementing it so we'll see when it happens :P

dagar commented 9 years ago

I didn't consider how this might break bisection. I think we can do it without forking llvm and clang. See PR #276.