Skip to content

Commit e237d8d

Browse files
committed
[GR-27287] Mark core and standard library as non-internal by default
PullRequest: truffleruby/2141
2 parents b55e3ee + b9e3c90 commit e237d8d

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

src/main/java/org/truffleruby/core/CoreLibrary.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public class CoreLibrary {
123123
private final RubyContext context;
124124
private final RubyLanguage language;
125125

126-
public final SourceSection sourceSection;
126+
public final SourceSection sourceSection = initCoreSourceSection();
127127

128128
public final RubyClass argumentErrorClass;
129129
public final RubyClass arrayClass;
@@ -261,14 +261,11 @@ public class CoreLibrary {
261261
public final String corePath;
262262

263263
@TruffleBoundary
264-
private SourceSection initCoreSourceSection(RubyContext context) {
264+
private SourceSection initCoreSourceSection() {
265265
final Source.SourceBuilder builder = Source.newBuilder(TruffleRuby.LANGUAGE_ID, "", "(core)");
266-
if (context.getOptions().CORE_AS_INTERNAL) {
267-
builder.internal(true);
268-
}
266+
builder.internal(true);
269267

270268
final Source source;
271-
272269
try {
273270
source = builder.build();
274271
} catch (IOException e) {
@@ -311,7 +308,6 @@ public CoreLibrary(RubyContext context, RubyLanguage language) {
311308
this.language = language;
312309
this.coreLoadPath = buildCoreLoadPath();
313310
this.corePath = coreLoadPath + File.separator + "core" + File.separator;
314-
this.sourceSection = initCoreSourceSection(context);
315311
this.node = SingletonClassNode.getUncached();
316312

317313
// Nothing in this constructor can use RubyContext.getCoreLibrary() as we are building it!

src/main/java/org/truffleruby/options/Options.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ public class Options {
7575
public final boolean TRACE_CALLS;
7676
/** --coverage-global=false */
7777
public final boolean COVERAGE_GLOBAL;
78-
/** --core-as-internal=true */
78+
/** --core-as-internal=false */
7979
public final boolean CORE_AS_INTERNAL;
80-
/** --stdlib-as-internal=true */
80+
/** --stdlib-as-internal=false */
8181
public final boolean STDLIB_AS_INTERNAL;
8282
/** --exceptions-store-java=false */
8383
public final boolean EXCEPTIONS_STORE_JAVA;

src/options.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ EXPERT:
5252
COVERAGE_GLOBAL: [coverage-global, boolean, false, Run coverage for all code and print results on exit]
5353

5454
# Options helpful in for debugging, potentially also for user code
55-
CORE_AS_INTERNAL: [core-as-internal, boolean, true, 'Mark core library sources as internal']
56-
STDLIB_AS_INTERNAL: [stdlib-as-internal, boolean, true, 'Mark stdlib sources as internal']
55+
CORE_AS_INTERNAL: [core-as-internal, boolean, false, 'Mark core library sources as internal']
56+
STDLIB_AS_INTERNAL: [stdlib-as-internal, boolean, false, 'Mark stdlib sources as internal']
5757
LAZY_TRANSLATION_USER: [lazy-translation-user, boolean, DEFAULT_LAZY, 'Lazily translation of stdlib, gem and user source files']
5858

5959
# Options to tweak backtraces

src/shared/java/org/truffleruby/shared/options/OptionsCatalog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public class OptionsCatalog {
4747
public static final OptionKey<Boolean> HOST_INTEROP_KEY = new OptionKey<>(true);
4848
public static final OptionKey<Boolean> TRACE_CALLS_KEY = new OptionKey<>(true);
4949
public static final OptionKey<Boolean> COVERAGE_GLOBAL_KEY = new OptionKey<>(false);
50-
public static final OptionKey<Boolean> CORE_AS_INTERNAL_KEY = new OptionKey<>(true);
51-
public static final OptionKey<Boolean> STDLIB_AS_INTERNAL_KEY = new OptionKey<>(true);
50+
public static final OptionKey<Boolean> CORE_AS_INTERNAL_KEY = new OptionKey<>(false);
51+
public static final OptionKey<Boolean> STDLIB_AS_INTERNAL_KEY = new OptionKey<>(false);
5252
public static final OptionKey<Boolean> LAZY_TRANSLATION_USER_KEY = new OptionKey<>(DEFAULT_LAZY_KEY.getDefaultValue());
5353
public static final OptionKey<Boolean> EXCEPTIONS_STORE_JAVA_KEY = new OptionKey<>(false);
5454
public static final OptionKey<Boolean> EXCEPTIONS_PRINT_JAVA_KEY = new OptionKey<>(false);

0 commit comments

Comments
 (0)