Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebIDL codegen: Replace cmake with a single Python script #24303

Merged
merged 2 commits into from Sep 30, 2019
Merged

Commits on Sep 27, 2019

  1. WebIDL codegen: Replace cmake with a single Python script

    When playing around with Cargo’s new timing visualization:
    https://internals.rust-lang.org/t/exploring-crate-graph-build-times-with-cargo-build-ztimings/10975/21
    
    … I was surprised to see the `script` crate’s build script take 76 seconds.
    I did not expect WebIDL bindings generation to be *that* computationally
    intensive.
    
    It turns out almost all of this time is overhead. The build script uses CMake
    to generate bindings for each WebIDL file in parallel, but that causes a lot
    of work to be repeated 366 times:
    
    * Starting up a Python VM
    * Importing (parts of) the Python standard library
    * Importing ~16k lines of our Python code
    * Recompiling the latter to bytecode, since we used `python -B` to disable
      writing `.pyc` file
    * Deserializing with `cPickle` and recreating in memory the results
      of parsing all WebIDL files
    
    ----
    
    This commit remove the use of CMake and cPickle for the `script` crate.
    Instead, all WebIDL bindings generation is done sequentially
    in a single Python process. This takes 2 to 3 seconds.
    SimonSapin committed Sep 27, 2019

Commits on Sep 30, 2019

  1. Don’t rely on `$CARGO_TARGET_DIR` in build scripts

    SimonSapin committed Sep 30, 2019
You can’t perform that action at this time.