1. 28
  1. 3

    Failed almost immediately on Mint:

    $ build/dev.sh minimal
    build/setup.py -> libc.so
    native/libc.c:22:10: fatal error: Python.h: No such file or directory
       22 | #include <Python.h>
          |          ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    Installed python2-dev package. Failed next with:

    build/setup_line_input.py -> line_input.so
    native/line_input.c:64:10: fatal error: readline/readline.h: No such file or directory
       64 | #include <readline/readline.h>
          |          ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    Installed libreadline-dev. Next failure:

    $ build/dev.sh minimal
    Removing _devbuild/gen/*
    build/setup.py -> libc.so
    Ran 13 tests in 0.001s
    build/setup_line_input.py -> line_input.so
    Ran 1 test in 0.000s
    build/setup_posix.py -> posix_.so
    Ran 8 tests in 0.000s
    py-yajl/setup.py -> yajl.so
    python2: can't open file 'setup.py': [Errno 2] No such file or directory


    1. 3

      Thanks for trying it and for the report!

      Yeah I guess the “quick start” isn’t really that great if you don’t have those 2 packages. The longer Contributing page has the ubuntu-deps shell function, but it’s unclear if everyone can use that. I think it would work on Mint because it’s ubuntu derived ?


      I’m not sure what the next error is. Maybe py-yajl/setup.py doesn’t exist because the submodule isn’t there? The

      git submodule update –init –recursive

      command should do that.

      In any case, this is useful, I will think about how to smooth over the process … Ironically Oil is running into the “shell script portability” problem, which “Linux Standard Base” was trying to fix (but failed)! I think we need something like that …

      1. 1

        My first try (above) was using your original instructions given here, but without the git clone (just downloading the git .zip file). My next try below was using the instructions at your Contributing page. That fared better, but there were issues:

        1. I noticed that the packages python-dev-is-python2 and python-is-python2 were required by build/dev.sh ubuntu-deps. This sounds like a no-no (everything should be explicitly labelled as either python2 or python3).
        2. The build seemed to go OK (with warnings) and bin/osh ran without error, but many of the tests are failing.
        1. 1

          Yeah unfortunately both I and our Travis build are on Ubuntu 16.04 (default for Travis), and it doesn’t have a python2-dev package. Looks like that came about in 20.04 :


          I have a TODO to upgrade the Ubuntu version …


          I just fixed a couple shebang lines that aren’t explicitly python2, and there is now a lint check for it in the continuous build.

    2. 1

      If you liked this post, do me a favor and tell me if you can run the dev build of Oil, which I believe takes less than 2 minutes, although people appear to have problems with it:


      It’s basically:

      1. A Linux machine – Debian/Ubuntu-ish is most likely to work – bash, coreutils, etc. (Other distros should also work, but Debian/Ubuntu are frequently tested)
      2. git clone (with a submodule)
      3. build/dev.sh minimal
      4. bin/osh.
      5. Now you have a shell and you can even modify it with pure Python code!

      I think that is easy, but I’m interested in feedback otherwise. And let me know if there instructions are unclear.

      If you have a Linux machine, and are not able to do that in 2 minutes, let me know where you are at the 2 minute mark … did something not work?

      1. 4

        I gave this a go, but I don’t have a /bin/bash and got stuck at:

        Removing _devbuild/gen/*
        asdl/hnode.asdl -> (asdl/tool) -> _devbuild/gen/hnode_asdl.py
        frontend/types.asdl -> (asdl/tool) -> _devbuild/gen/types_asdl.py
        core/runtime.asdl -> (asdl/tool) -> _devbuild/gen/runtime_asdl.py
        tools/find/find.asdl -> (asdl/tool) -> _devbuild/gen/find_asdl.py
        ./build/dev.sh: build/codegen.sh: /bin/bash: bad interpreter: No such file or directory

        I do have a /bin/sh (which is dash) and I do have bash in my PATH and /usr/bin/env, so #!/usr/bin/env bash would work.

        edit I gave it more than two minutes. I ran:

        rg -l '#!/bin/bash' | xargs sed -i -e 's%#!/bin/bash%#!/usr/bin/env bash%'

        and got further, but found gcc was needed:

        build/setup.py -> libc.so
        unable to execute 'gcc': No such file or directory
        error: command 'gcc' failed with exit status 1

        I added gcc and readline to my environment, and ran:

        (export PATH=$(dirname $(which zcat)):$(dirname $(which git)):$(dirname $(which gcc)):$(dirname $(which bash)):$(dirname $(which coreutils)):$(dirname $(which python2)); ./build/dev.sh minimal)

        and it seems to work, and the build is super fast. Really nice!

        1. 3

          Excellent, the shebangs are indeed a mistake and I appreciate the followups! Thanks for trying it.

        2. 2

          On Arch it works as advertised.

          1. 1

            ‘’’Removing _devbuild/gen/* /usr/bin/env: ‘python2’: No such file or directory’’’

            Fwiw, it’s issues like this that steer me away from Python projects. I’ve been burnt out from maintaining Python dependencies, and even though Py2 is now deprecated, it still exists. If I really need a Python project, I’ll typically try to encapsulate it within a docker container or go out of my way to make sure it only support Py3.

            I’ve been following Oil since it feels like it’s inception, but Python has always kept me from trying it, and still does apparently.

            1. 3

              OK thanks for trying it.

              BTW you don’t need Python (either 2 or 3) to use Oil. You only need it to change the code.

              The tarballs don’t depend on Python: https://www.oilshell.org/release/0.8.1/ (and that’s been true since the very first release, over 3 years ago)

              Or it is also packaged in a number of places: https://github.com/oilshell/oil/wiki/Oil-Deployments

              Also, for developers, there is a nascent shell.nix that declares the Python dep: https://github.com/oilshell/oil/blob/master/shell.nix

              (I don’t use Nix personally, but others may want to run with it.)

              Filed an issue for this: https://github.com/oilshell/oil/issues/833

              Also FAQ about Python: http://www.oilshell.org/blog/2018/03/04.html#faq