Skip to content

Commit ec783d5

Browse files
committed
Merge remote-tracking branch 'origin/master' into merge_release_branch
2 parents 97ec18a + 826814c commit ec783d5

File tree

388 files changed

+8002
-26401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

388 files changed

+8002
-26401
lines changed

.gitattributes

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
# and a whole lot of actually vendored code isn't listed! What we want to do is
88
# make the stats accurate for what is actually runtime code.
99

10-
# Ignore everything that isn't actually runtime code
10+
# Note that changes to this file have to be *committed* for github-linguist to
11+
# notice them.
12+
13+
# Non-runtime code
1114

1215
/bench/* linguist-vendored
1316
/bin/* linguist-vendored
@@ -23,22 +26,22 @@
2326
/lib/json/tools/* linguist-vendored
2427
/src/main/c/Makefile linguist-vendored
2528
/src/main/c/truffleposix/Makefile linguist-vendored
29+
/lib/ruby/gems/*/gems/*/bin/setup linguist-vendored
30+
/lib/truffle/post_install_hook.sh linguist-vendored
31+
/src/test/* linguist-vendored
32+
/src/processor/* linguist-vendored
2633

27-
# Some things that I just want to ignore as it skews things
28-
29-
/lib/ruby/gems/2.3.0/gems/net-telnet-0.1.1/bin/setup linguist-vendored
30-
31-
# Ignore generated code
34+
# Generated code
3235

3336
/src/main/java/org/truffleruby/parser/parser/RubyParser.java linguist-generated
3437

35-
# Ignore templates
38+
# templates
3639

3740
/lib/mri/rdoc/generator/template/* linguist-vendored
3841

39-
# Ignore extra documentation
42+
# Documentation
4043

41-
/lib/ruby/gems/2.3.0/gems/rake-10.4.2/doc/rake.1 linguist-documentation
44+
/lib/ruby/gems/*/gems/*/doc/* linguist-documentation
4245

4346
# All our headers are C - don't magically work out they're ObjectiveC or C++
4447

.reek.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
detectors:
2+
UncommunicativeVariableName:
3+
enabled: false # we're happy with short variable names
4+
UncommunicativeParameterName:
5+
enabled: false # we're happy with short parameter names
6+
LongParameterList:
7+
enabled: false # we're often meeting an existing Ruby API with fixed parameters
8+
UncommunicativeModuleName:
9+
enabled: false # we're often meeting an existing Ruby API with fixed module names
10+
UncommunicativeMethodName:
11+
enabled: false # we're often meeting an existing Ruby API with fixed method names
12+
BooleanParameter:
13+
enabled: false # we're often meeting an existing Ruby API with boolean parameters
14+
TooManyStatements:
15+
enabled: false # yes we often write longer methods
16+
FeatureEnvy:
17+
enabled: false # we don't want to add new public methods to Ruby API classes to better encapsulate behaviour
18+
UnusedParameters:
19+
enabled: false # primitives mean that the use of parameters can be hidden
20+
NilCheck:
21+
enabled: false # our code is often too low level to factor this away
22+
ManualDispatch:
23+
enabled: false # manual dispatch is often part of Ruby internal semantics
24+
IrresponsibleModule:
25+
enabled: false # we don't comment all modules because we're implementing an existing interface so they do not need a raison d'être
26+
ControlParameter:
27+
enabled: false # we're often meeting an existing Ruby API with control parameters
28+
DataClump:
29+
enabled: false # we're often meeting an existing Ruby API with 'data clumps'
30+
TooManyMethods:
31+
enabled: false # we're often meeting an existing Ruby API with an existing set of methods
32+
TooManyConstants:
33+
enabled: false # we're often meeting an existing Ruby API with an existing set of constants
34+
UtilityFunction:
35+
enabled: false # we're often meeting an existing Ruby API with utility functions
36+
MissingSafeMethod:
37+
enabled: false # we're often meeting an existing Ruby API without safe equivalents, or the safe equivalent is implemented in Java
38+
Attribute:
39+
enabled: false # we're often meeting an existing Ruby API with writable attributes
40+
InstanceVariableAssumption:
41+
enabled: false # we often set instance variables lazily
42+
NestedIterators:
43+
enabled: false # yes we often write nested iterators
44+
TooManyInstanceVariables:
45+
enabled: false # yes we sometimes use a lot of instance variables
46+
RepeatedConditional:
47+
enabled: false # we don't want to add new public methods to Ruby API classes to better encapsulate behaviour
48+
DuplicateMethodCall:
49+
enabled: false # needs investigation - sometimes legitimate due to Ruby semantics, but lots of failures

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AllCops:
1111

1212
# Type 'Style' (166):
1313
# Supports --auto-correct
14-
Layout/TrailingBlankLines:
14+
Style/TrailingBlankLines:
1515
Description: Checks trailing blank lines and final newline.
1616
StyleGuide: "#newline-eof"
1717
Enabled: true
@@ -21,7 +21,7 @@ Layout/TrailingBlankLines:
2121
- final_blank_line
2222

2323
# Supports --auto-correct
24-
Layout/TrailingWhitespace:
24+
Style/TrailingWhitespace:
2525
Description: Avoid trailing whitespace.
2626
StyleGuide: "#no-trailing-whitespace"
2727
Enabled: true

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1-
# 1.0 RC 11
1+
# 1.0 RC 12
2+
3+
Bug fixes:
4+
5+
* Fixed a bug with `String#lines` and similar methods with multibyte
6+
characters (#1543).
7+
* Fixed an issue with `String#{encode,encode!}` double-processing strings
8+
using XML conversion options and a new destination encoding (#1545).
9+
* Fixed a bug where a raised cloned exception would be caught as the
10+
original exception (#1542).
11+
* Fixed a bug with `StringScanner` and patterns starting with `^` (#1544).
12+
* Fixed `Enumerable::Lazy#uniq` with infinite streams (#1516).
13+
14+
Compatibility:
15+
16+
* Change to a new system for handling Ruby objects in C extensions which
17+
greatly increases compatibility with MRI.
18+
* Implemented `BigDecimal#to_r` (#1521).
19+
* `Symbol#to_proc` now returns `-1` like on MRI (#1462).
20+
21+
# 1.0 RC 11, 15 January 2019
222

323
New features:
424

LICENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TruffleRuby Licence
22

3-
TruffleRuby is copyright (c) 2013-2018 Oracle and/or its
3+
TruffleRuby is copyright (c) 2013-2019 Oracle and/or its
44
affiliates, and is made available to you under the terms of any one of the following three licenses:
55

66
* Eclipse Public License version 1.0, or

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,23 @@ There are three ways to install TruffleRuby:
2121
using a Ruby manager.
2222

2323
* Using the [standalone distribution](doc/user/standalone-distribution.md)
24-
as a simple binary tarball. This distribution can also be used for
24+
as a simple binary tarball. This distribution is also useful for
2525
[testing TruffleRuby in CI](doc/user/standalone-distribution.md).
26+
On [TravisCI](https://docs.travis-ci.com/user/languages/ruby#truffleruby), you can simply use:
27+
```yaml
28+
language: ruby
29+
rvm:
30+
- truffleruby
31+
```
2632
2733
You can use `gem` to install Gems as normal.
2834

2935
You can also build TruffleRuby from source, see the
3036
[building instructions](doc/contributor/workflow.md), and using
3137
[Docker](doc/contributor/docker.md).
3238

39+
Please report any issue you might find on [GitHub](https://github.com/oracle/truffleruby/issues).
40+
3341
## Aim
3442

3543
TruffleRuby aims to:
@@ -163,6 +171,7 @@ The main authors of TruffleRuby in order of joining the project are:
163171
* Petr Chalupa
164172
* Brandon Fish
165173
* Duncan MacGregor
174+
* Christian Wirth
166175

167176
Additionally:
168177

@@ -187,7 +196,7 @@ See the [security documentation](doc/user/security.md).
187196

188197
## Licence
189198

190-
TruffleRuby is copyright (c) 2013-2018 Oracle and/or its affiliates, and is made
199+
TruffleRuby is copyright (c) 2013-2019 Oracle and/or its affiliates, and is made
191200
available to you under the terms of any one of the following three licenses:
192201

193202
* Eclipse Public License version 1.0, or

ci.jsonnet

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ local part_definitions = {
4040
PATH: std.join(":", self.path + ["$PATH"]),
4141
},
4242

43+
packages+: {
44+
"pip:ninja_syntax": "==1.7.2", # Required by NFI and mx
45+
},
46+
4347
setup+: [
4448
# We don't want to proxy any internet access
4549
["unset", "ANT_OPTS", "FTP_PROXY", "ftp_proxy", "GRADLE_OPTS",
@@ -175,7 +179,7 @@ local part_definitions = {
175179
],
176180

177181
environment+: {
178-
GRAAL_HOME: "$PWD/../graal-enterprise/graal-enterprise",
182+
GRAAL_HOME: "$BUILD_DIR/graal-enterprise/graal-enterprise",
179183
HOST_VM: "server",
180184
HOST_VM_CONFIG: "graal-enterprise",
181185
},
@@ -214,8 +218,8 @@ local part_definitions = {
214218

215219
environment+: {
216220
HOST_VM_CONFIG: "graal-core",
217-
GRAAL_HOME: "$PWD/../graal/compiler",
218-
VM_SUITE_HOME: "$PWD/../graal/vm",
221+
GRAAL_HOME: "$BUILD_DIR/graal/compiler",
222+
VM_SUITE_HOME: "$BUILD_DIR/graal/vm",
219223
},
220224
},
221225

@@ -240,8 +244,8 @@ local part_definitions = {
240244

241245
environment+: {
242246
HOST_VM_CONFIG: "graal-enterprise",
243-
GRAAL_HOME: "$PWD/../graal-enterprise/graal-enterprise",
244-
VM_SUITE_HOME: "$PWD/../graal-enterprise/vm-enterprise",
247+
GRAAL_HOME: "$BUILD_DIR/graal-enterprise/graal-enterprise",
248+
VM_SUITE_HOME: "$BUILD_DIR/graal-enterprise/vm-enterprise",
245249
},
246250
},
247251

@@ -297,7 +301,7 @@ local part_definitions = {
297301
downloads+: {
298302
JAVA_HOME: {
299303
name: "labsjdk",
300-
version: "8u192-jvmci-0.52",
304+
version: "8u192-jvmci-0.54",
301305
platformspecific: true,
302306
},
303307
},
@@ -311,7 +315,7 @@ local part_definitions = {
311315
downloads+: {
312316
JAVA_HOME: {
313317
name: "openjdk",
314-
version: "8u192-jvmci-0.52",
318+
version: "8u192-jvmci-0.54",
315319
platformspecific: true,
316320
},
317321
},
@@ -367,7 +371,7 @@ local part_definitions = {
367371
],
368372
"$.run.specs":: { test_spec_options: ["-GdarwinCI"] },
369373
"$.cap":: {
370-
normal_machine: ["darwin_sierra", "amd64"],
374+
normal_machine: ["darwin_mojave", "amd64"],
371375
},
372376
environment+: {
373377
LANG: "en_US.UTF-8",

doc/contributor/static-analysis.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Static Analysis of TruffleRuby
2+
3+
We apply static analysis to the production code that we maintain -
4+
`lib/truffle`, `lib/cext`, `src/annotations`, `src/launcher`, `src/main`,
5+
`src/services` (some parts of static analysis are also applied to other files,
6+
but these are the key ones).
7+
8+
## C
9+
10+
The [Clang Static Analyzer](https://clang-analyzer.llvm.org) finds bugs in C
11+
code. We occasionally run this tool locally but only take its output as a
12+
suggestion. We use a default configuration.
13+
14+
```
15+
$ 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
16+
$ scan-view ...as instructed by scan-build...
17+
```
18+
19+
## Java
20+
21+
### DSL usage
22+
23+
We have a tool to check that some use of our internal annotations and the
24+
Truffle DSL are correct. Passing this is enforced in our CI gate.
25+
26+
```
27+
$ jt check_dsl_usage
28+
```
29+
30+
### CheckStyle
31+
32+
[CheckStyle](http://checkstyle.sourceforge.net) enforces a Java style guide.
33+
Passing CheckStyle is enforced in our CI gate.
34+
35+
```
36+
$ mx checkstyle
37+
```
38+
39+
### FindBugs
40+
41+
[FindBugs](http://findbugs.sourceforge.net) looks for potential Java
42+
programming errors. We run it with the default Graal project configuration.
43+
Passing FindBugs is enforced in our CI gate.
44+
45+
```
46+
$ mx findbugs
47+
```
48+
49+
## Ruby
50+
51+
### Rubocop
52+
53+
[Rubocop](https://github.com/rubocop-hq/rubocop) enforces a Ruby style guide.
54+
It's configured in `.rubocop.yml`, and can be run locally as `jt rubocop`.
55+
Passing Rubocop is enforced in our CI gate.
56+
57+
```
58+
$ jt rubocop
59+
```
60+
61+
### Fasterer
62+
63+
[Fasterer](https://github.com/DamirSvrtan/fasterer) looks for potential
64+
performance improvements. We occasionally run this tool locally but only take
65+
its output as a suggestion. We use a default configuration.
66+
67+
```
68+
$ gem install fasterer
69+
$ fasterer lib/truffle lib/cext src/main
70+
```
71+
72+
### Reek
73+
74+
[Reek](https://github.com/troessner/reek) looks for patterns of Ruby code
75+
which could be improved - generally around making it simpler and more clear.
76+
We occasionally run this tool locally but only take its output as a
77+
suggestion. We disable a lot of the defaults in `.reek.yml`, either because
78+
we're implementing a set API, because we're doing something low-level or
79+
outside normal Ruby semantics, or for performance reasons.
80+
81+
```
82+
$ gem install reek
83+
$ reek lib/truffle lib/cext src/main
84+
```
85+
86+
### Flog
87+
88+
[Flog](http://ruby.sadi.st/Flog.html) lists methods by complexity. You can
89+
check that your methods do not appear near the top of this list. We
90+
occasionally run this tool locally but only take its output as a suggestion.
91+
92+
```
93+
$ gem install flog
94+
$ flog -m -t 10 lib/truffle lib/cext src/main
95+
```
96+
97+
### Flay
98+
99+
[Flay](http://ruby.sadi.st/Flay.html) finds similar or identical code, which
100+
could potentially be factored out. We occasionally run this tool locally but
101+
only take its output as a suggestion.
102+
103+
```
104+
$ gem install flay
105+
$ flay lib/truffle lib/cext src/main
106+
```
107+
108+
### Brakeman
109+
110+
[Brakeman](https://github.com/presidentbeef/brakeman) looks for security
111+
vulnerabilities. It's really designed for Rails, and many of the rules are
112+
specific to Rails, but we do run it ocassionally anyway and take its output as
113+
a suggestion.
114+
115+
```
116+
$ gem install brakeman
117+
$ brakeman --force-scan --run-all-checks --interprocedural --no-pager --add-libs-path src --only-files lib/truffle/,lib/cext/,src/main/ruby/core/
118+
```

doc/legal/legal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GraalVM, which is the only supported way to use TruffleRuby.
55

66
## TruffleRuby
77

8-
TruffleRuby is copyright (c) 2013-2018 Oracle and/or its
8+
TruffleRuby is copyright (c) 2013-2019 Oracle and/or its
99
affiliates, and is made available to you under the terms of any one of the
1010
following three licenses:
1111

0 commit comments

Comments
 (0)