Advise on Git mirror for llvm-lit

Hi,

I find the llvm-lit tool incredibly useful for other to setup a git
mirror that mirrors only stuff in utils/lit which I could then use as
a git submodule in other projects I work on. The rationale for doing
this is that that cloning the llvm git repository is wasteful if I
only want llvm-lit.

I had a quick go at this...

$ git svn clone -r81190:HEAD
http://llvm.org/svn/llvm-project/llvm/trunk/utils/lit llvm-lit

The result was fairly satisfactory except that commit author email
addresses were screwed up, e.g.

commit 5ce8d8244224431e2b4d88c5d9b0045f8c8ba388
Author: alexfh <alexfh@91177308-0d34-0410-b5e6-96231b3b80d8>

    Remove empty directories.

    git-svn-id:
http://llvm.org/svn/llvm-project/llvm/trunk/utils/lit@199983
91177308-0d34-0410-b5e6-96231b3b80d8

It seems that the solution is to provide an authors file
(--authors-file=) or an authors program (--authors-prog=) to get the
e-mail addresses correct.

The LLVM git mirrors [1] don't have this issue so the problem must
have already been solved. So I'd like to know what solution was used
which I could also use. Alternatively would the LLVM admins be willing
to host a git mirror that mirrors the ``utils/lit``?

[1] http://llvm.org/git/llvm.git

Thanks,
Dan.

Are you sure you really need git, or you just want to install last stable
version? If the latter, run `pip install lit` to install it system-wide.

https://pypi.python.org/pypi/lit/0.2.0

Hi Konstantin,

I find the llvm-lit tool incredibly useful for other to setup a git
mirror that mirrors only stuff in utils/lit which I could then use as
a git submodule in other projects I work on. The rationale for doing
this is that that cloning the llvm git repository is wasteful if I
only want llvm-lit.

Oops. There was a typo there. That should of said.

"I find the llvm-lit tool incredibly useful for other non-LLVM
projects. I'd like to setup a git mirror that only mirrors stuff in
utils/lit which I could then use as a git submodule in other
projects".

Are you sure you really need git, or you just want to install last stable
version? If the latter, run `pip install lit` to install it system-wide.

https://pypi.python.org/pypi/lit/0.2.0

Git isn't essential. I didn't know that llvm-lit was in pypi. It seems
that this version is quite out of date though. My lit.site.cfg files
work with upstream llvm-lit and when I try to use lit from pypi, I get
th

--
Regards, Konstantin

Hi,

Thanks for the reply.

I just noticed there was a typo in my last e-mail. That should of said
"I find the llvm-lit tool incredibly useful for other non-LLVM
projects. I'd like to setup a git mirror that only mirrors stuff in
utils/lit which I could then use as a git submodule".

Are you sure you really need git, or you just want to install last stable
version? If the latter, run `pip install lit` to install it system-wide.

https://pypi.python.org/pypi/lit/0.2.0

Thanks. I didn't realise llvm-lit was in pypi, this is probably a
better solution. It doesn't seem this version has been updated in a
while though. I've been using upstream llvm-lit and when I try to use
lit from pip I get the following error message when it tries to load
my lit.site.cfg file.

Traceback (most recent call last):
  File "/home/dan/pythonvenv/bin/lit", line 9, in <module>
    load_entry_point('lit==0.2.0', 'console_scripts', 'lit')()
  File "/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 522, in main
    testSuiteCache, localConfigCache)[1])
  File "/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 230, in getTests
    ts,path_in_suite = getTestSuite(path, litConfig, testSuiteCache)
  File "/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 199, in getTestSuite
    ts, relative = search(item)
  File "/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 183, in search
    cache[path] = res = search1(path)
  File "/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 174, in search1
    cfg = TestingConfig.frompath(cfgpath, None, litConfig, mustExist = True)
  File "/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/TestingConfig.py",
line 61, in frompath
    exec f in cfg_globals
  File "/home/dan/dev/OutputCheck/tests/lit.site.cfg", line 1, in <module>
    import lit.formats
ImportError: No module named formats

@Daniel Dunbar: Any chance of updating the pypi lit package to
upstream llvm-lit?

Thanks,
Dan

Hi Konstantin,

>> I find the llvm-lit tool incredibly useful for other to setup a git
>> mirror that mirrors only stuff in utils/lit which I could then use as
>> a git submodule in other projects I work on. The rationale for doing
>> this is that that cloning the llvm git repository is wasteful if I
>> only want llvm-lit.

Oops. There was a typo there. That should of said.

"I find the llvm-lit tool incredibly useful for other non-LLVM
projects. I'd like to setup a git mirror that only mirrors stuff in
utils/lit which I could then use as a git submodule in other
projects".

> Are you sure you really need git, or you just want to install last stable
> version? If the latter, run `pip install lit` to install it system-wide.
>
> https://pypi.python.org/pypi/lit/0.2.0

Git isn't essential. I didn't know that llvm-lit was in pypi. It seems
that this version is quite out of date though. My lit.site.cfg files
work with upstream llvm-lit and when I try to use lit from pypi, I get
th

> --
> Regards, Konstantin

Hi,

Thanks for the reply.

I just noticed there was a typo in my last e-mail. That should of said
"I find the llvm-lit tool incredibly useful for other non-LLVM
projects. I'd like to setup a git mirror that only mirrors stuff in
utils/lit which I could then use as a git submodule".

> Are you sure you really need git, or you just want to install last stable
> version? If the latter, run `pip install lit` to install it system-wide.
>
> https://pypi.python.org/pypi/lit/0.2.0

Thanks. I didn't realise llvm-lit was in pypi, this is probably a
better solution. It doesn't seem this version has been updated in a
while though. I've been using upstream llvm-lit and when I try to use
lit from pip I get the following error message when it tries to load
my lit.site.cfg file.

Traceback (most recent call last):
  File "/home/dan/pythonvenv/bin/lit", line 9, in <module>
    load_entry_point('lit==0.2.0', 'console_scripts', 'lit')()
  File
"/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 522, in main
    testSuiteCache, localConfigCache)[1])
  File
"/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 230, in getTests
    ts,path_in_suite = getTestSuite(path, litConfig, testSuiteCache)
  File
"/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 199, in getTestSuite
    ts, relative = search(item)
  File
"/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 183, in search
    cache[path] = res = search1(path)
  File
"/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/main.py",
line 174, in search1
    cfg = TestingConfig.frompath(cfgpath, None, litConfig, mustExist =
True)
  File
"/home/dan/pythonvenv/local/lib/python2.7/site-packages/lit/TestingConfig.py",
line 61, in frompath
    exec f in cfg_globals
  File "/home/dan/dev/OutputCheck/tests/lit.site.cfg", line 1, in <module>
    import lit.formats
ImportError: No module named formats

@Daniel Dunbar: Any chance of updating the pypi lit package to
upstream llvm-lit?

Yeah, thats a good idea. I'll put this on my TODO list.

Towards your original question, I agree that using the Python lit package
is probably the right way to go for people who want to use 'lit' on
non-LLVM projects.

- Daniel

Yeah, thats a good idea. I'll put this on my TODO list.

Towards your original question, I agree that using the Python lit
package is probably the right way to go for people who want to use 'lit'
on non-LLVM projects.

Thanks. Perhaps the lit PyPi package version should also follow the LLVM
version number to make things less confusing (the current 0.2.0 isn't
very helpful). Even better would be to make updating the lit PyPi
package part of the LLVM release process (i.e. when a release is made
update the PyPi package).

Thanks,
Dan.

Done, lit-0.3.0 is now on PyPI.

I think of lit as a separate tool from LLVM that happens to be inside the llvm svn repo. For now, I prefer to keep it on its own version numbers, I make releases of it out of band with LLVM, and it rarely changes.

  • Daniel

Done, lit-0.3.0 is now on PyPI.

Thanks. I just tested this. It works fine for Python2 but its broken
for Python3 (install fails) due to an old python2 style print
statement. Attached is a patch that fixes this. Could you apply it and
regenerate the pypi package (bumping version number if necessary)?

$ pip install lit
Downloading/unpacking lit
  Downloading lit-0.3.0.tar.gz (45kB): 45kB downloaded
  Running setup.py (path:/home/dsl11/test/venv/build/lit/setup.py)
egg_info for package lit
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/dsl11/test/venv/build/lit/setup.py", line 1, in <module>
        import lit
      File "./lit/__init__.py", line 4, in <module>
        from .main import main
      File "./lit/main.py", line 235
        print "lit %s" % (lit.__version__,)
                     ^
    SyntaxError: invalid syntax

I think of lit as a separate tool from LLVM that happens to be inside the
llvm svn repo. For now, I prefer to keep it on its own version numbers, I
make releases of it out of band with LLVM, and it rarely changes.

Okay sure.

Thanks,
Dan.

fix_lit_python3.patch (395 Bytes)

Fixed, thanks for pointing that out.

  • Daniel

Fixed, thanks for pointing that out.

No problem. The package from pypi seems to work fine with python 3
now. Are you going to apply the patch to svn trunk too? When I checked
just now it appeared that utils/lit/main.py still remain unpatched.

Thanks,
Dan.

Just pushed, r203573.

Thanks!

  • Daniel

Yeah, thats a good idea. I’ll put this on my TODO list.

Towards your original question, I agree that using the Python lit
package is probably the right way to go for people who want to use ‘lit’
on non-LLVM projects.

Thanks. Perhaps the lit PyPi package version should also follow the LLVM
version number to make things less confusing (the current 0.2.0 isn’t
very he

Thanks for pushing and please ignore my last e-mail. I accidently sent
an old draft from my phone (woops!).

Thanks,
Dan.