Skip to content

Oil Native Quick Start

andychu edited this page Apr 19, 2023 · 14 revisions

Context: Compiler Engineer Job

Related: Oil Dev Cheat Sheet

1. Get bin/osh -c 'echo hi' Working

The Contributing page will walk you through it. You need a Linux machine -- Ubuntu/Debian-ish are most likely to work.

This often takes less than 1 minute. If it takes more than 5 or 10 minutes, something has gone wrong! Paste the command you ran and the error message in #oil-dev at https://oilshell.zulipchat.com/

Run the spec tests

I usually run this command as a sanity check.

~/git/oilshell/oil$ test/spec.sh smoke 
smoke.test.sh
case    line    dash    bash    mksh    osh
  0       4     pass    pass    pass    pass    builtin
  1       8     pass    pass    pass    pass    command sub
...

The Contributing page has more details. Also see Spec Tests.

2. Get _bin/cxx-dbg/osh -c 'echo hi' Working

This is oil-native, the C++ translation. This is a bit harder to run.

Instructions are in mycpp/README.md. This may take slightly longer.

The basic idea is that we have:

  1. A Python program that depends on MyPy (called mycpp)
  2. That translates another Python program to C++
  3. Then we compile the C++.

And the build system uses Python that generates Ninja.

Again let us know if anything doesn't work!

Run the Same Spec Tests Against oil-native

~/git/oilshell/oil$ test/spec-cpp.sh run-file smoke
smoke.test.sh
case    line    osh     osh_.py osh_.cc
  0       4     pass    pass    pass    builtin
  1       8     pass    pass    pass    command sub
...

Find the Spec Tests in the CI

Go to http://travis-ci.oilshell.org/github-jobs/cpp task → spec-cpp RESULTS.

Example: http://travis-ci.oilshell.org/github-jobs/2022-05-23__17-34-18.wwz/_tmp/spec/cpp/osh-summary.html

Pick a Test To Make Pass

TODO: Chat with me on https://oilshell.zulipchat.com/ about this. Some tests are much easier than others.

I made ~300 tests pass in 4-5 days back in March! See Oil 0.9.9 Made a Big Leap.

But it's also possible that 1 test will take 2 weeks!

Related

Clone this wiki locally