Skip to content

Commit b760aa4

Browse files
committed
Update build system docs with the latest changes
1 parent 71f6234 commit b760aa4

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

docs/build_system.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ The main solution for the second point seems a Makefile, otherwise many of the u
1616
## General Design
1717

1818
1. Templates are generated by `templates/template.rb`
19-
4. The `Makefile` compiles both `libprism.a` and `libprism.{so,dylib,dll}` from the `src/**/*.c` and `include/**/*.h` files
20-
5. The `Rakefile` `:compile` task ensures the above prerequisites are done, then calls `make`,
21-
and uses `Rake::ExtensionTask` to compile the C extension (using its `extconf.rb`), which uses `libprism.a`
19+
2. The `Makefile` compiles both `libprism.a` and `libprism.{so,dylib,dll}` from the `src/**/*.c` and `include/**/*.h` files
20+
3. The `Rakefile` `:compile` task ensures the above prerequisites are done, then calls `make`,
21+
and uses `Rake::ExtensionTask` to compile the C extension (using its `extconf.rb`)
2222

2323
This way there is minimal duplication, and each layer builds on the previous one and has its own responsibilities.
2424

@@ -35,14 +35,11 @@ loaded per process (i.e., at most one version of the prism *gem* loaded in a pro
3535
### Building the prism gem by `gem install/bundle install`
3636

3737
The gem contains the pre-generated templates.
38-
When installing the gem, `extconf.rb` is used and that:
39-
* runs `make build/libprism.a`
40-
* compiles the C extension with mkmf
41-
42-
When installing the gem on JRuby and TruffleRuby, no C extension is built, so instead of the last step,
43-
there is Ruby code using FFI which uses `libprism.{so,dylib,dll}`
44-
to implement the same methods as the C extension, but using serialization instead of many native calls/accesses
45-
(JRuby does not support C extensions, serialization is faster on TruffleRuby than the C extension).
38+
39+
When installing the gem on CRuby, `extconf.rb` is used and that compiles the C extension with mkmf, including both the extension files and the sources of prism itself.
40+
41+
When installing the gem on JRuby and TruffleRuby, no C extension is built, so instead the `extconf.rb` runs `make build/libprism.{so,dylib,dll}`.
42+
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).
4643

4744
### Building the prism gem from git, e.g. `gem "prism", github: "ruby/prism"`
4845

0 commit comments

Comments
 (0)