mozilla-spidermonkey / jsparagus

Experimental JS parser-generator project.
Other
447 stars 20 forks source link

Add smoosh_tools #567

Closed arai-a closed 4 years ago

arai-a commented 4 years ago

This is Rust version of smoosh-tools.

With this, we can build SpiderMonkey JS shell with SmooshMonkey enabled, and with local jsparagus with the following command, in jsparagus directory:

cargo run --bin smoosh_tools build

or, the following until another binary is added:

cargo run build

Prerequisite:

This has the following commands (from usage):

Usage:
    cargo run --bin smoosh_tools build [--opt] [PATH_TO_MOZILLA_CENTRAL]
        Build SpiderMonkey JS shell with SmooshMonkey enabled,
        using this jsparagus clone, instead of vendored one

        PATH_TO_MOZILLA_CENTRAL can be omitted if either
        mozilla-central or mozilla-unified is placed next to
        jsparagus clone directory

        --opt: Use optimized build, instead of debug build

    cargo run --bin smoosh_tools test [--opt] [PATH_TO_MOZILLA_CENTRAL]
        Run jstests/jit-test with SpiderMonkey JS shell binary 
        built by build command

    cargo run --bin smoosh_tools bump [PATH_TO_MOZILLA_CENTRAL]
        Bump jsparagus version referred by mozilla-central to
        latest ci_generated branch HEAD, and re-vendor jsparagus

    cargo run --bin smoosh_tools gen
        Push current jsparagus branch to "generated" branch,
        with generated files included, to refer from mozilla-central

    cargo run --bin smoosh_tools try [PATH_TO_MOZILLA_CENTRAL]
        Push to try with jsparagus generated branch.
        This requires L1 Commit Access,
        and mozilla-central should be a Git repository
arai-a commented 4 years ago

Forgot to mention run command in usage (will fix) cargo run --bin smoosh_tools run [PATH_TO_MOZILLA_CENTRAL] will run JS shell built by build command

nbp commented 4 years ago

This looks really good from my point of view. One concern might be the list of dependencies for building SpiderMonkey, but I think this is fine to suggest to run mach bootstrap to make it work.