docs/build_system.md in prism-0.17.1 vs docs/build_system.md in prism-0.18.0
- old
+ new
@@ -14,18 +14,18 @@
The main solution for the second point seems a Makefile, otherwise many of the usages would have to duplicate the logic to build prism.
## General Design
1. Templates are generated by `templates/template.rb`
-4. The `Makefile` compiles both `librubyparser.a` and `librubyparser.{so,dylib,dll}` from the `src/**/*.c` and `include/**/*.h` files
+4. The `Makefile` compiles both `libprism.a` and `libprism.{so,dylib,dll}` from the `src/**/*.c` and `include/**/*.h` files
5. The `Rakefile` `:compile` task ensures the above prerequisites are done, then calls `make`,
- and uses `Rake::ExtensionTask` to compile the C extension (using its `extconf.rb`), which uses `librubyparser.a`
+ and uses `Rake::ExtensionTask` to compile the C extension (using its `extconf.rb`), which uses `libprism.a`
This way there is minimal duplication, and each layer builds on the previous one and has its own responsibilities.
The static library exports no symbols, to avoid any conflict.
-The shared library exports some symbols, and this is fine since there should only be one librubyparser shared library
+The shared library exports some symbols, and this is fine since there should only be one libprism shared library
loaded per process (i.e., at most one version of the prism *gem* loaded in a process, only the gem uses the shared library).
## The various ways to build prism
### Building from ruby/prism repository with `bundle exec rake`
@@ -34,15 +34,15 @@
### Building the prism gem by `gem install/bundle install`
The gem contains the pre-generated templates.
When installing the gem, `extconf.rb` is used and that:
-* runs `make build/librubyparser.a`
+* runs `make build/libprism.a`
* compiles the C extension with mkmf
When installing the gem on JRuby and TruffleRuby, no C extension is built, so instead of the last step,
-there is Ruby code using FFI which uses `librubyparser.{so,dylib,dll}`
+there is Ruby code using FFI which uses `libprism.{so,dylib,dll}`
to implement the same methods as the C extension, but using serialization instead of many native calls/accesses
(JRuby does not support C extensions, serialization is faster on TruffleRuby than the C extension).
### Building the prism gem from git, e.g. `gem "prism", github: "ruby/prism"`
@@ -65,10 +65,10 @@
The script generates the templates when importing.
Then when `mx build` builds TruffleRuby and the `prism` mx project inside, it runs `make`.
Then the `prism bindings` mx project is built, which contains the [bindings](https://github.com/oracle/truffleruby/blob/master/src/main/c/prism_bindings/src/prism_bindings.c)
-and links to `librubyparser.a` (to avoid exporting symbols, so no conflict when installing the prism gem).
+and links to `libprism.a` (to avoid exporting symbols, so no conflict when installing the prism gem).
### Building prism as part of JRuby
TODO, probably similar to TruffleRuby.