Skip to content

Commit 50825e6

Browse files
committed
Exclude Fortran-related files in the llvm-toolchain in Ruby standalones
* size on disk on linux-amd64, before: 334MB, after: 197M, 23.0: 183M. * Diff of `tree -I include/` between 23.0 and after this commit (excluding include/ changes as they are verbose and use little space): diff --git a/home/eregon/tmp/before b/home/eregon/tmp/after index ab5a172b9c..d2b095115e 100644 --- a/home/eregon/tmp/before +++ b/home/eregon/tmp/after @@ -1,16 +1,17 @@ . ├── 3rd_party_license_llvm-toolchain.txt ├── bin +│   ├── amdgpu-arch │   ├── analyze-build -│   ├── clang -> clang-15 +│   ├── clang -> clang-16 │   ├── clang++ -> clang -│   ├── clang-15 +│   ├── clang-16 │   ├── clang-cl -> clang │   ├── clang-cpp -> clang │   ├── clang-format │   ├── clang-linker-wrapper -│   ├── clang-nvlink-wrapper │   ├── clang-repl +│   ├── clang-tblgen │   ├── dsymutil │   ├── intercept-build │   ├── ld64.lld -> lld @@ -23,6 +24,7 @@ │   ├── llvm-as │   ├── llvm-bitcode-strip -> llvm-objcopy │   ├── llvm-config +│   ├── llvm-debuginfo-analyzer │   ├── llvm-debuginfod │   ├── llvm-debuginfod-find │   ├── llvm-diff @@ -49,32 +51,39 @@ │   ├── llvm-readobj │   ├── llvm-reduce │   ├── llvm-remark-size-diff +│   ├── llvm-remarkutil │   ├── llvm-sim │   ├── llvm-strip -> llvm-objcopy │   ├── llvm-tapi-diff │   ├── llvm-tli-checker +│   ├── nvptx-arch │   ├── opt -│   ├── split-file +│   ├── tblgen-lsp-server │   └── wasm-ld -> lld ├── lib │   ├── clang -│   │   └── 15.0.6 +│   │   └── 16 │   │   └── lib -│   │   └── linux -│   │   ├── clang_rt.crtbegin-x86_64.o -│   │   ├── clang_rt.crtend-x86_64.o -│   │   └── libclang_rt.builtins-x86_64.a -│   ├── libclang-cpp.so -> libclang-cpp.so.15-4-gaeae49c2d7-bg8671e93c04 -│   ├── libclang-cpp.so.15-4-gaeae49c2d7-bg8671e93c04 +│   │   ├── linux +│   │   │   ├── clang_rt.crtbegin-x86_64.o +│   │   │   ├── clang_rt.crtend-x86_64.o +│   │   │   └── libclang_rt.builtins-x86_64.a +│   │   └── x86_64-unknown-linux-gnu +│   │   ├── clang_rt.crtbegin.o +│   │   ├── clang_rt.crtend.o +│   │   ├── libclang_rt.builtins.a +│   │   └── liborc_rt.a +│   ├── libclang-cpp.so -> libclang-cpp.so.16-4-gad8c248269-bg39f02d0d6a +│   ├── libclang-cpp.so.16-4-gad8c248269-bg39f02d0d6a │   ├── libear │   │   ├── config.h.in │   │   ├── ear.c │   │   └── __init__.py -│   ├── libLLVM-15.0.6-4-gaeae49c2d7-bg8671e93c04.so -> libLLVM-15-4-gaeae49c2d7-bg8671e93c04.so -│   ├── libLLVM-15-4-gaeae49c2d7-bg8671e93c04.so -│   ├── libLLVM.so -> libLLVM-15-4-gaeae49c2d7-bg8671e93c04.so -│   ├── libLTO.so -> libLTO.so.15-4-gaeae49c2d7-bg8671e93c04 -│   ├── libLTO.so.15-4-gaeae49c2d7-bg8671e93c04 +│   ├── libLLVM-16.0.1-4-gad8c248269-bg39f02d0d6a.so -> libLLVM-16-4-gad8c248269-bg39f02d0d6a.so +│   ├── libLLVM-16-4-gad8c248269-bg39f02d0d6a.so +│   ├── libLLVM.so -> libLLVM-16-4-gad8c248269-bg39f02d0d6a.so +│   ├── libLTO.so -> libLTO.so.16-4-gad8c248269-bg39f02d0d6a +│   ├── libLTO.so.16-4-gad8c248269-bg39f02d0d6a │   ├── libscanbuild │   │   ├── analyze.py │   │   ├── arguments.py @@ -107,4 +116,4 @@ │   └── README.md └── README.md -13 directories, 95 files +14 directories, 103 files
1 parent d60d4eb commit 50825e6

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

mx.truffleruby/mx_truffleruby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def ruby_maven_deploy_public(args):
246246
standalone_dependencies_common = {
247247
'LLVM Runtime Core': ('lib/sulong', []),
248248
'LLVM Runtime Native': ('lib/sulong', []),
249-
'LLVM.org toolchain': ('lib/llvm-toolchain', []),
249+
'LLVM.org toolchain': ('lib/llvm-toolchain', ['bin/flang-*', 'bin/f18*', 'lib/libFortran*', 'include/flang']),
250250
}
251251

252252
mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage(

spec/truffle/standalone_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. This
2+
# code is released under a tri EPL/GPL/LGPL license. You can use it,
3+
# redistribute it and/or modify it under the terms of the:
4+
#
5+
# Eclipse Public License version 2.0, or
6+
# GNU General Public License version 2, or
7+
# GNU Lesser General Public License version 2.1.
8+
# OTHER DEALINGS IN THE SOFTWARE.
9+
10+
require_relative '../ruby/spec_helper'
11+
12+
describe "The standalone" do
13+
llvm_toolchain = "#{Truffle::Boot.ruby_home}/lib/llvm-toolchain"
14+
guard -> { Dir.exist? llvm_toolchain } do
15+
it "should not include Fortran-related files in the toolchain" do
16+
Dir.glob("#{llvm_toolchain}/bin/flang*").should.empty?
17+
Dir.glob("#{llvm_toolchain}/lib/libFortran*").should.empty?
18+
Dir.glob("#{llvm_toolchain}/include/flang/*").should.empty?
19+
end
20+
end
21+
end

0 commit comments

Comments
 (0)