Skip to content

Commit a4c8b44

Browse files
committed
Remove the no longer used nokogiri stubs
PullRequest: truffleruby/663
2 parents b778145 + 315b406 commit a4c8b44

File tree

4 files changed

+25
-40
lines changed

4 files changed

+25
-40
lines changed

doc/contributor/quick-rails-testing.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ API, and shut downs the rails server. It requires Redis as a database to be
88
running in its default configuration on `localhost:6379`.
99

1010
The `jt test ecosystem rails-app` should be executed in TruffleRuby's home. The
11-
output will be similar to following:
11+
output will be similar to following:
1212

1313
```txt
1414
jt test ecosystem rails-app
@@ -88,7 +88,7 @@ Use `bundle show [gemname]` to see where a bundled gem is installed.
8888
+ path/to/truffleruby/bin/truffleruby path/to/truffleruby/test/truffleruby-tool/bin/truffleruby-tool run --offline -- -S bundle exec bin/rails server
8989
....jtt: loading YAML configuration path/to/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool.yaml
9090
jtt: executing "run" command
91-
jtt: $ TRUFFLERUBY_RESILIENT_GEM_HOME="" GEM_HOME="path/to/truffleruby/truffleruby-gem-test-pack-5/gems" GEM_PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems" PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems/bin:<snipped>" NO_FORK="true" path/to/truffleruby/bin/truffleruby -J-Xmx2G -J-ea -J-esa -Xcore.load_path\=path/to/truffleruby/src/main/ruby -I path/to/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool_bundle/mocks -r openssl-stubs -r stubs -S bundle exec bin/rails server
91+
jtt: $ TRUFFLERUBY_RESILIENT_GEM_HOME="" GEM_HOME="path/to/truffleruby/truffleruby-gem-test-pack-5/gems" GEM_PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems" PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems/bin:<snipped>" NO_FORK="true" path/to/truffleruby/bin/truffleruby -J-Xmx2G -J-ea -J-esa -Xcore.load_path\=path/to/truffleruby/src/main/ruby -I path/to/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool_bundle/mocks -S bundle exec bin/rails server
9292
....[ruby] WARNING rubygems.rb:11 Could not find 'did_you_mean' (>= 0) among 148 total gem(s)
9393
Checked in 'GEM_PATH=path/to/truffleruby/truffleruby-gem-test-pack-5/gems', execute `gem env` for more information
9494
.HTML sanitization stubbed
@@ -151,29 +151,29 @@ true+ kill %1
151151
+ kill 9617
152152
```
153153

154-
There are several levels of indirection but it always prints what command is actually
154+
There are several levels of indirection but it always prints what command is actually
155155
executed. It's prefixed with `+` if it's executed by bash or by `$` if it's our tool.
156156

157157
If the test finishes without problem then the rails server can be executed from
158158
the `path/to/truffleruby/test/truffle/ecosystem/rails-app` directory for further investigation.
159159
The server can be started with following command which can be copied out from the output.
160160

161161
```bash
162-
TRUFFLERUBY_RESILIENT_GEM_HOME="" GEM_HOME="path/to/truffleruby/truffleruby-gem-test-pack-5/gems" GEM_PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems" PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems/bin:<snipped>" NO_FORK="true" path/to/truffleruby/bin/truffleruby -J-Xmx2G -J-ea -J-esa -Xcore.load_path\=path/to/truffleruby/src/main/ruby -I path/to/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool_bundle/mocks -r openssl-stubs -r stubs -S bundle exec bin/rails server
162+
TRUFFLERUBY_RESILIENT_GEM_HOME="" GEM_HOME="path/to/truffleruby/truffleruby-gem-test-pack-5/gems" GEM_PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems" PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems/bin:<snipped>" NO_FORK="true" path/to/truffleruby/bin/truffleruby -J-Xmx2G -J-ea -J-esa -Xcore.load_path\=path/to/truffleruby/src/main/ruby -I path/to/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool_bundle/mocks -S bundle exec bin/rails server
163163
```
164164

165165
The command can be further modified for inspection.
166-
First it's useful to use jt not to run TruffleRuby directly.
166+
First it's useful to use jt not to run TruffleRuby directly.
167167
(`-Xcore.load_path` option can be then omitted.)
168168

169169
```bash
170-
env TRUFFLERUBY_RESILIENT_GEM_HOME="" GEM_HOME="/Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/truffleruby-gem-test-pack-5/gems" GEM_PATH="/Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/truffleruby-gem-test-pack-5/gems" PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems/bin:<snipped>" NO_FORK="true" ../../../../tool/jt.rb ruby -J-Xmx2G -J-ea -J-esa -I /Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool_bundle/mocks -r openssl-stubs -r stubs -S bundle exec ./bin/rails server
170+
env TRUFFLERUBY_RESILIENT_GEM_HOME="" GEM_HOME="/Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/truffleruby-gem-test-pack-5/gems" GEM_PATH="/Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/truffleruby-gem-test-pack-5/gems" PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems/bin:<snipped>" NO_FORK="true" ../../../../tool/jt.rb ruby -J-Xmx2G -J-ea -J-esa -I /Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool_bundle/mocks -S bundle exec ./bin/rails server
171171
```
172172

173173
To run on Graal pass `--graal` to `jt ruby`.
174174

175175
```bash
176-
env TRUFFLERUBY_RESILIENT_GEM_HOME="" GEM_HOME="/Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/truffleruby-gem-test-pack-5/gems" GEM_PATH="/Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/truffleruby-gem-test-pack-5/gems" PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems/bin:<snipped>" NO_FORK="true" ../../../../tool/jt.rb ruby --graal -J-Xmx2G -J-ea -J-esa -I /Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool_bundle/mocks -r openssl-stubs -r stubs -S bundle exec ./bin/rails server
176+
env TRUFFLERUBY_RESILIENT_GEM_HOME="" GEM_HOME="/Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/truffleruby-gem-test-pack-5/gems" GEM_PATH="/Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/truffleruby-gem-test-pack-5/gems" PATH="path/to/truffleruby/truffleruby-gem-test-pack-5/gems/bin:<snipped>" NO_FORK="true" ../../../../tool/jt.rb ruby --graal -J-Xmx2G -J-ea -J-esa -I /Users/pitr/Workspace/labs/truffleruby-ws/truffleruby/test/truffle/ecosystem/rails-app/.truffleruby-tool_bundle/mocks -S bundle exec ./bin/rails server
177177
```
178-
178+
179179
The command can be further modified as needed to investigate.

lib/truffle/nokogiri-stubs.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.

lib/truffle/nokogiri-stubs/nokogiri.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/truffle/integration/no_extra_output/all_stdlibs.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,48 @@
66
# GNU General Public License version 2, or
77
# GNU Lesser General Public License version 2.1.
88

9+
require 'rbconfig'
10+
911
def glob(pattern)
1012
files = Dir.glob(pattern)
1113
raise "no libraries found with #{pattern}" if files.empty?
1214
files
1315
end
1416

15-
stdlibs = glob('lib/mri/*.{rb,su}').map { |file|
16-
File.basename(file, '.*')
17+
stdlibs = []
18+
19+
glob("#{RbConfig::CONFIG['rubylibdir']}/*.rb").each { |file|
20+
stdlibs << File.basename(file, '.*')
1721
}
1822

19-
glob('lib/truffle/*.rb').map { |file|
20-
lib = File.basename(file, '.*')
21-
stdlibs << lib unless lib.end_with? '-stubs'
23+
glob("#{RbConfig::CONFIG['archdir']}/*.su").each { |file|
24+
stdlibs << File.basename(file, '.*')
2225
}
2326

24-
glob('lib/mri/net/*.rb').map { |file| File.basename(file, '.*') }.each { |file|
25-
stdlibs << "net/#{file}"
27+
glob("#{RbConfig::CONFIG['prefix']}/lib/truffle/*.rb").each { |file|
28+
stdlibs << File.basename(file, '.*')
29+
}
30+
31+
glob("#{RbConfig::CONFIG['rubylibdir']}/net/*.rb").each { |file|
32+
stdlibs << "net/#{File.basename(file, '.*')}"
2633
}
2734

2835
stdlibs += %w[json]
2936

37+
# 'continuation' warns on being required, as MRI
38+
# Others fail to load
3039
ignore = %w[
31-
continuation # warns on being required, as intended
32-
dbm
33-
gdbm
34-
sdbm
40+
continuation
3541
debug
3642
profile
3743
profiler
38-
pty
39-
ripper
4044
shell
41-
win32
42-
win32ole
4345
]
4446

4547
stdlibs -= ignore
4648

4749
stdlibs.uniq!
4850

49-
stdlibs.reject! { |lib| lib.end_with? '-stubs' }
50-
5151
stdlibs.each { |lib| require lib }
5252

5353
puts 3 * 4

0 commit comments

Comments
 (0)