Skip to content

Commit 18c82f9

Browse files
committed
[GR-15251] Fixes for docs.
PullRequest: truffleruby/816
2 parents a0aa559 + 0db8353 commit 18c82f9

29 files changed

+180
-166
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Thank you for thinking about contributing something to TruffleRuby!
22

3+
You can build TruffleRuby from source - see the [building
4+
instructions](doc/contributor/workflow.md). You can also use
5+
[Docker](doc/contributor/docker.md) to get an automated build.
6+
37
You will need to sign the Oracle Contributor Agreement for us to able to merge
48
your work.
59

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ There are three ways to install TruffleRuby:
3333
3434
You can use `gem` to install Gems as normal.
3535

36-
You can also build TruffleRuby from source, see the
37-
[building instructions](doc/contributor/workflow.md), and using
38-
[Docker](doc/contributor/docker.md).
39-
4036
Please report any issue you might find on [GitHub](https://github.com/oracle/truffleruby/issues).
4137

4238
## Aim
@@ -58,18 +54,18 @@ important to understand the different configurations of TruffleRuby, as each has
5854
different capabilities and performance characteristics. You should pick the
5955
execution mode that is appropriate for your application.
6056

61-
TruffleRuby by default runs in the *native*
62-
configuration. In this configuration, TruffleRuby is ahead-of-time compiled to a
63-
standalone native executable. This means that you don't need a JVM installed on
64-
your system to use it. The advantage of the native configuration is that it
65-
[starts about as fast as MRI](doc/contributor/native-image.md), it may use less memory,
66-
and it becomes fast in less time. The disadvantage of the native configuration
67-
is that you can't use Java tools like VisualVM, you can't use Java
68-
interoperability, and *peak performance may be lower than on the JVM*. The
69-
native configuration is used by default, but you can also request it using
70-
`--native`. To use polyglot programming with the *native* configuration, you
71-
need to use the `--polyglot` flag. To check you are using the *native*
72-
configuration, `ruby --version` should mention `Native`.
57+
TruffleRuby by default runs in the *native* configuration. In this
58+
configuration, TruffleRuby is ahead-of-time compiled to a standalone native
59+
executable. This means that you don't need a JVM installed on your system to
60+
use it. The advantage of the native configuration is that it starts about as
61+
fast as MRI, it may use less memory, and it becomes fast in less time. The
62+
disadvantage of the native configuration is that you can't use Java tools like
63+
VisualVM, you can't use Java interoperability, and *peak performance may be
64+
lower than on the JVM*. The native configuration is used by default, but you
65+
can also request it using `--native`. To use polyglot programming with the
66+
*native* configuration, you need to use the `--polyglot` flag. To check you
67+
are using the *native* configuration, `ruby --version` should mention
68+
`Native`.
7369

7470
TruffleRuby can also be used in the *JVM* configuration, where it runs as a
7571
normal Java application on the JVM, as any other Java application would. The
@@ -150,8 +146,11 @@ should read our [migration guide](doc/user/jruby-migration.md).
150146
## Documentation
151147

152148
Extensive documentation is available in [`doc`](doc).
153-
[`doc/user`](doc/user) documents how to use TruffleRuby and
154-
[`doc/contributor`](doc/contributor) documents how to develop TruffleRuby.
149+
150+
See our [source code repository](https://github.com/oracle/truffleruby) and
151+
[contributor
152+
documentation](https://github.com/oracle/truffleruby/tree/master/doc/contributor)
153+
to contribute to TruffleRuby.
155154

156155
## Contact
157156

bench/chunky_png/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
These benchmarks are originally from
2-
[Bench 9000](https://github.com/jruby/bench9000).
1+
These benchmarks are originally from JRuby Bench 9000.
32

43
We are using ChunkyPNG at revision `efd61c8d0ddcabdcf09fb44f8e8c1ba709995940`.
54
We use this old revision because we know it has interesting patterns of

bench/psd.rb/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
These benchmarks are originally from
2-
[Bench 9000](https://github.com/jruby/bench9000).
1+
These benchmarks are originally from JRuby Bench 9000.
32

43
We are using PSD.rb at revision `e14d652ddc705e865d8b2b897d618b25d78bcc7c`.
54
We use this old revision because we know it has interesting patterns of

doc/contributor/benchmarking.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Benchmarking with the GraalVM Compiler
44

5-
```
5+
```bash
66
$ jt benchmark bench/classic/mandelbrot.rb --simple
77
```
88

@@ -13,13 +13,13 @@ for the first few iterations).
1313

1414
You can turn off the GraalVM Compiler if you want using `--no-graal`.
1515

16-
```
16+
```bash
1717
$ jt benchmark --no-graal bench/classic/mandelbrot.rb --simple
1818
```
1919

2020
You can benchmark an entirely different implementation using the
2121
`JT_BENCHMARK_RUBY` environment variable.
2222

23-
```
23+
```bash
2424
$ JT_BENCHMARK_RUBY=ruby jt benchmark bench/classic/mandelbrot.rb --simple
2525
```

doc/contributor/building-graal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ install Graal locally.
1111
Our workflow tool can install Graal automatically under the directory
1212
`../graal/compiler` with:
1313

14-
```
14+
```bash
1515
$ jt install graal
1616
```
1717

1818
You can then use `jt` to run TruffleRuby with Graal.
1919

20-
```
20+
```bash
2121
$ jt ruby --graal ...
2222
```
2323

@@ -32,6 +32,6 @@ You can then set the `GRAAL_HOME` environment variable to the location of the
3232
`compiler` directory inside the `graal` repository and use `jt` to run
3333
TruffleRuby.
3434

35-
```
35+
```bash
3636
$ GRAAL_HOME=.../graal/compiler jt ruby --graal ...
3737
```

doc/contributor/cexts.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
Get the gem test pack.
66

77
```bash
8-
jt gem-test-pack
8+
$ jt gem-test-pack
99
```
1010

1111
You can then test C extension support.
1212

1313
```bash
14-
jt test cexts
14+
$ jt test cexts
1515
```
1616

1717
You can also runs specs:
1818

1919
```bash
20-
jt test :capi
20+
$ jt test :capi
2121
```
2222

2323
### OpenSSL
2424

2525
The `openssl` specs and tests are currently segregated and are run separately.
2626

2727
```bash
28-
jt test :openssl
29-
jt test mri --openssl
28+
$ jt test :openssl
29+
$ jt test mri --openssl
3030
```
3131

3232
## Benchmarking
@@ -40,7 +40,7 @@ jt cextc bench/chunky_png/oily_png
4040
Then follow the instructions for benchmarking above, and then try:
4141

4242
```bash
43-
USE_CEXTS=true TRUFFLERUBYOPT=--cexts-log-load jt benchmark bench/chunky_png/chunky-color-r.rb --simple
43+
$ USE_CEXTS=true TRUFFLERUBYOPT=--cexts-log-load jt benchmark bench/chunky_png/chunky-color-r.rb --simple
4444
```
4545

4646
These benchmarks have Ruby fallbacks, so we should carefully check that the

doc/contributor/docker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For example, to build a Docker image called `truffleruby-test` to test
1212
installing the public GraalVM CE binary and the public Ruby installable,
1313
using rbenv, and running a basic test:
1414

15-
```
15+
```bash
1616
$ jt docker build truffleruby-test --ubuntu1804 --public 1.0.0 --rbenv --basic-test
1717
```
1818

@@ -23,13 +23,13 @@ built to use TruffleRuby.
2323
Or, to print a Dockerfile to show how to install TruffleRuby from source on
2424
Fedora 28 using RVM:
2525

26-
```
26+
```bash
2727
$ jt docker print --fedora28 --source --rvm
2828
```
2929

3030
Or, to run a full set of tests on a set of new release candidate tarballs:
3131

32-
```
32+
```bash
3333
$ jt docker test --graalvm graalvm-ce.tar.gz ruby-installable.jar --test release_branch
3434
$ jt docker test --graalvm graalvm-ee.tar.gz ruby-installable.jar --test release_branch
3535
$ jt docker test --graalvm graalvm-ee.tar.gz ruby-installable.jar --rebuild-images --test release_branch
@@ -87,7 +87,7 @@ You may find that the Docker cache interacts badly with these Dockerfiles (such
8787
as repository URLs being cached that become unavailable). Therefore we recommend
8888
regularly clearing your Docker cache.
8989

90-
```
90+
```bash
9191
$ docker system prune -a -f
9292
```
9393

doc/contributor/native-image.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ warm-up time for shorter running commands and benchmarks.
3333
$ cd graalvm
3434
$ otool -L jre/bin/ruby
3535
jre/bin/ruby:
36-
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.28.0)
37-
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
38-
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
36+
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.28.0)
37+
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
38+
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
39+
```
3940

41+
```bash
4042
$ du -h jre/bin/ruby
41-
200M jre/bin/ruby
43+
200M jre/bin/ruby
4244
```
4345

4446
The Native Image version of TruffleRuby has better startup performance and lower memory
@@ -81,7 +83,7 @@ There is no need to do so, but you can actually also compile your own copy of
8183
the Native Image version of TruffleRuby using a tool distributed as part of GraalVM and
8284
the Java version of TruffleRuby from GraalVM.
8385

84-
```
86+
```bash
8587
$ native-image -H:Name=native-ruby --language:ruby
8688
```
8789

@@ -90,7 +92,7 @@ $ native-image -H:Name=native-ruby --language:ruby
9092
You can build a native build of TruffleRuby using the Native Image Tool from a
9193
source distribution using:
9294

93-
```
95+
```bash
9496
$ jt build native
9597
```
9698

doc/contributor/static-analysis.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The [Clang Static Analyzer](https://clang-analyzer.llvm.org) finds bugs in C
1111
code. We occasionally run this tool locally but only take its output as a
1212
suggestion. We use a default configuration.
1313

14-
```
14+
```bash
1515
$ scan-build --use-analyzer `which clang` -analyze-headers clang -c --std=c99 -Ilib/cext/include src/main/c/cext/ruby.c src/main/c/truffleposix/truffleposix.c
1616
$ scan-view ...as instructed by scan-build...
1717
```
@@ -23,7 +23,7 @@ $ scan-view ...as instructed by scan-build...
2323
We have a tool to check that some use of our internal annotations and the
2424
Truffle DSL are correct. Passing this is enforced in our CI gate.
2525

26-
```
26+
```bash
2727
$ jt check_dsl_usage
2828
```
2929

@@ -32,7 +32,7 @@ $ jt check_dsl_usage
3232
[CheckStyle](http://checkstyle.sourceforge.net) enforces a Java style guide.
3333
Passing CheckStyle is enforced in our CI gate.
3434

35-
```
35+
```bash
3636
$ mx checkstyle
3737
```
3838

@@ -42,7 +42,7 @@ $ mx checkstyle
4242
errors. We run it with the default Graal project configuration. Passing
4343
SpotBugs is enforced in our CI gate.
4444

45-
```
45+
```bash
4646
$ mx spotbugs
4747
```
4848

@@ -54,7 +54,7 @@ $ mx spotbugs
5454
It's configured in `.rubocop.yml`, and can be run locally as `jt rubocop`.
5555
Passing Rubocop is enforced in our CI gate.
5656

57-
```
57+
```bash
5858
$ jt rubocop
5959
```
6060

@@ -64,7 +64,7 @@ $ jt rubocop
6464
performance improvements. We occasionally run this tool locally but only take
6565
its output as a suggestion. We use a default configuration.
6666

67-
```
67+
```bash
6868
$ gem install fasterer
6969
$ fasterer lib/truffle lib/cext src/main
7070
```
@@ -78,7 +78,7 @@ suggestion. We disable a lot of the defaults in `.reek.yml`, either because
7878
we're implementing a set API, because we're doing something low-level or
7979
outside normal Ruby semantics, or for performance reasons.
8080

81-
```
81+
```bash
8282
$ gem install reek
8383
$ reek lib/truffle lib/cext src/main
8484
```
@@ -89,7 +89,7 @@ $ reek lib/truffle lib/cext src/main
8989
check that your methods do not appear near the top of this list. We
9090
occasionally run this tool locally but only take its output as a suggestion.
9191

92-
```
92+
```bash
9393
$ gem install flog
9494
$ flog -m -t 10 lib/truffle lib/cext src/main
9595
```
@@ -100,7 +100,7 @@ $ flog -m -t 10 lib/truffle lib/cext src/main
100100
could potentially be factored out. We occasionally run this tool locally but
101101
only take its output as a suggestion.
102102

103-
```
103+
```bash
104104
$ gem install flay
105105
$ flay lib/truffle lib/cext src/main
106106
```
@@ -112,7 +112,7 @@ vulnerabilities. It's really designed for Rails, and many of the rules are
112112
specific to Rails, but we do run it ocassionally anyway and take its output as
113113
a suggestion.
114114

115-
```
115+
```bash
116116
$ gem install brakeman
117117
$ brakeman --force-scan --run-all-checks --interprocedural --no-pager --add-libs-path src --only-files lib/truffle/,lib/cext/,src/main/ruby/core/
118118
```

0 commit comments

Comments
 (0)