Commit f880d6e
authored
SIP 46 - read classpath from file, remove lib directory in distribution (scala#20631)
**This should be backported to the 3.5.0 line**
write classpath to file, and do not write the `lib` directory, this
saves duplicating the jars in the distribution.
In the distribution, we write `/etc/scala.classpath`,
`/etc/with_compiler.classpath`, and `/etc/scaladoc.classpath`. each of
these are formatted such that each line is a relative path from the
`/maven2` directory in the distribution.
To produce these files, I use the output of the same `cs fetch` command
that is used to populate the `maven2` directory - so the correspondence
is 1:1. This is a much better solution than the previous manual
resolution of classpath from within the bash/batch scripts - as the
classpath libraries actually change a lot between versions.
The contents look like the following:
**scala.classpath** (compiler classpath used by scalac)
```text
org/scala-lang/scala3-interfaces/3.5.1-RC1-bin-SNAPSHOT/scala3-interfaces-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/scala3-compiler_3/3.5.1-RC1-bin-SNAPSHOT/scala3-compiler_3-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/scala3-library_3/3.5.1-RC1-bin-SNAPSHOT/scala3-library_3-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/tasty-core_3/3.5.1-RC1-bin-SNAPSHOT/tasty-core_3-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/modules/scala-asm/9.6.0-scala-1/scala-asm-9.6.0-scala-1.jar
org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar
org/jline/jline-reader/3.25.1/jline-reader-3.25.1.jar
org/jline/jline-terminal/3.25.1/jline-terminal-3.25.1.jar
org/jline/jline-terminal-jna/3.25.1/jline-terminal-jna-3.25.1.jar
org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar
org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar
org/jline/jline-native/3.25.1/jline-native-3.25.1.jar
net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar
```
**with_compiler.classpath** (concatenated to scala.classpath to run the
scalac command)
```
org/scala-lang/scala3-staging_3/3.5.1-RC1-bin-SNAPSHOT/scala3-staging_3-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/scala3-tasty-inspector_3/3.5.1-RC1-bin-SNAPSHOT/scala3-tasty-inspector_3-3.5.1-RC1-bin-SNAPSHOT.jar
```
and **scaladoc.classpath**
```
org/scala-lang/scala3-interfaces/3.5.1-RC1-bin-SNAPSHOT/scala3-interfaces-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/scala3-compiler_3/3.5.1-RC1-bin-SNAPSHOT/scala3-compiler_3-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/scala3-library_3/3.5.1-RC1-bin-SNAPSHOT/scala3-library_3-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/tasty-core_3/3.5.1-RC1-bin-SNAPSHOT/tasty-core_3-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/modules/scala-asm/9.6.0-scala-1/scala-asm-9.6.0-scala-1.jar
org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar
org/jline/jline-reader/3.25.1/jline-reader-3.25.1.jar
org/jline/jline-terminal/3.25.1/jline-terminal-3.25.1.jar
org/jline/jline-terminal-jna/3.25.1/jline-terminal-jna-3.25.1.jar
org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar
org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar
org/jline/jline-native/3.25.1/jline-native-3.25.1.jar
net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar
org/scala-lang/scala3-tasty-inspector_3/3.5.1-RC1-bin-SNAPSHOT/scala3-tasty-inspector_3-3.5.1-RC1-bin-SNAPSHOT.jar
org/scala-lang/scaladoc_3/3.5.1-RC1-bin-SNAPSHOT/scaladoc_3-3.5.1-RC1-bin-SNAPSHOT.jar
com/vladsch/flexmark/flexmark/0.62.2/flexmark-0.62.2.jar
com/vladsch/flexmark/flexmark-util-ast/0.62.2/flexmark-util-ast-0.62.2.jar
com/vladsch/flexmark/flexmark-util-data/0.62.2/flexmark-util-data-0.62.2.jar
com/vladsch/flexmark/flexmark-util-html/0.62.2/flexmark-util-html-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-anchorlink/0.62.2/flexmark-ext-anchorlink-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-autolink/0.62.2/flexmark-ext-autolink-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-emoji/0.62.2/flexmark-ext-emoji-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-gfm-strikethrough/0.62.2/flexmark-ext-gfm-strikethrough-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-gfm-tasklist/0.62.2/flexmark-ext-gfm-tasklist-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-wikilink/0.62.2/flexmark-ext-wikilink-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-tables/0.62.2/flexmark-ext-tables-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-yaml-front-matter/0.62.2/flexmark-ext-yaml-front-matter-0.62.2.jar
nl/big-o/liqp/0.8.2/liqp-0.8.2.jar
org/jsoup/jsoup/1.17.2/jsoup-1.17.2.jar
com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.1/jackson-dataformat-yaml-2.15.1.jar
com/vladsch/flexmark/flexmark-util-builder/0.62.2/flexmark-util-builder-0.62.2.jar
com/vladsch/flexmark/flexmark-util-collection/0.62.2/flexmark-util-collection-0.62.2.jar
com/vladsch/flexmark/flexmark-util-dependency/0.62.2/flexmark-util-dependency-0.62.2.jar
com/vladsch/flexmark/flexmark-util-format/0.62.2/flexmark-util-format-0.62.2.jar
com/vladsch/flexmark/flexmark-util-misc/0.62.2/flexmark-util-misc-0.62.2.jar
com/vladsch/flexmark/flexmark-util-sequence/0.62.2/flexmark-util-sequence-0.62.2.jar
com/vladsch/flexmark/flexmark-util-visitor/0.62.2/flexmark-util-visitor-0.62.2.jar
org/jetbrains/annotations/15.0/annotations-15.0.jar
com/vladsch/flexmark/flexmark-util/0.62.2/flexmark-util-0.62.2.jar
org/nibor/autolink/autolink/0.6.0/autolink-0.6.0.jar
com/vladsch/flexmark/flexmark-jira-converter/0.62.2/flexmark-jira-converter-0.62.2.jar
org/antlr/antlr4-runtime/4.7.2/antlr4-runtime-4.7.2.jar
com/fasterxml/jackson/core/jackson-annotations/2.15.1/jackson-annotations-2.15.1.jar
com/fasterxml/jackson/core/jackson-core/2.15.1/jackson-core-2.15.1.jar
com/fasterxml/jackson/core/jackson-databind/2.15.1/jackson-databind-2.15.1.jar
com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.12.1/jackson-datatype-jsr310-2.12.1.jar
ua/co/k/strftime4j/1.0.5/strftime4j-1.0.5.jar
org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar
com/vladsch/flexmark/flexmark-util-options/0.62.2/flexmark-util-options-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-ins/0.62.2/flexmark-ext-ins-0.62.2.jar
com/vladsch/flexmark/flexmark-ext-superscript/0.62.2/flexmark-ext-superscript-0.62.2.jar
```
the bash/batch scripts then read these files, concatenating each line to
the absolute path of the `maven2` directory, and joining with the
systems path separator (and replacing `/` with `\` in batch)
fixes scala#20711File tree
9 files changed
+258
-230
lines changed- dist
- bin-native-overrides
- bin
- project
9 files changed
+258
-230
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | | - | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 25 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 26 | + | |
| 27 | + | |
48 | 28 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
65 | 32 | | |
66 | 33 | | |
67 | 34 | | |
68 | 35 | | |
69 | | - | |
| 36 | + | |
70 | 37 | | |
71 | 38 | | |
72 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
File mode changed.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
114 | 102 | | |
115 | 103 | | |
116 | 104 | | |
| |||
119 | 107 | | |
120 | 108 | | |
121 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 56 | + | |
112 | 57 | | |
113 | 58 | | |
114 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
110 | 109 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 110 | + | |
154 | 111 | | |
155 | 112 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
162 | 126 | | |
163 | 127 | | |
164 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2130 | 2130 | | |
2131 | 2131 | | |
2132 | 2132 | | |
2133 | | - | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
2134 | 2141 | | |
2135 | 2142 | | |
2136 | 2143 | | |
| |||
2170 | 2177 | | |
2171 | 2178 | | |
2172 | 2179 | | |
2173 | | - | |
| 2180 | + | |
2174 | 2181 | | |
2175 | 2182 | | |
2176 | 2183 | | |
| |||
0 commit comments