mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-08 09:31:42 +01:00
Compare commits
660 Commits
jbr21-spla
...
mkartash/J
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dcbd50a5a | ||
|
|
5ab0faa3b8 | ||
|
|
add3143b36 | ||
|
|
020374aedf | ||
|
|
4b6379e1a1 | ||
|
|
8e47fb6f68 | ||
|
|
41726c971f | ||
|
|
aeb9ed2c4e | ||
|
|
75069f1448 | ||
|
|
1f621c65c4 | ||
|
|
2e7a2203b2 | ||
|
|
2c65b03a82 | ||
|
|
f9788507e7 | ||
|
|
1fc8a0defb | ||
|
|
e478daa5b3 | ||
|
|
9c90407c59 | ||
|
|
4f073400d8 | ||
|
|
4a7e22283a | ||
|
|
d3f945716e | ||
|
|
dedf14bb36 | ||
|
|
0008e5ca4f | ||
|
|
87353a75e9 | ||
|
|
ce23776de9 | ||
|
|
16b576edaa | ||
|
|
e804878850 | ||
|
|
d3e9824508 | ||
|
|
aba17b10f7 | ||
|
|
ce1052817c | ||
|
|
e014385d6b | ||
|
|
e8aa4efbe3 | ||
|
|
79ed5d02be | ||
|
|
3028927482 | ||
|
|
ed730c4f79 | ||
|
|
f1f8b556be | ||
|
|
4a1d8ef5f6 | ||
|
|
3bf2188fda | ||
|
|
9d6fa8c89c | ||
|
|
e4cb7f3d91 | ||
|
|
4c58067e6c | ||
|
|
74bc1b5449 | ||
|
|
376dbb9143 | ||
|
|
2ca39076e5 | ||
|
|
94dcbd9e3d | ||
|
|
8d8ffbfdaa | ||
|
|
8acc661cec | ||
|
|
bef22877f3 | ||
|
|
b4f19a1bd1 | ||
|
|
4ac96401ac | ||
|
|
b0df810747 | ||
|
|
fd630dfdf7 | ||
|
|
d40bf2635e | ||
|
|
f7ecf51d7a | ||
|
|
607530425f | ||
|
|
0e8e42e850 | ||
|
|
3df616970a | ||
|
|
c920f63274 | ||
|
|
c05924b77a | ||
|
|
72b0390511 | ||
|
|
4dfa7219e0 | ||
|
|
a5ae6c93a7 | ||
|
|
0a5e1961be | ||
|
|
cb2e45450f | ||
|
|
89e2cd239e | ||
|
|
6e0f6f6269 | ||
|
|
853463c919 | ||
|
|
59b90f7bc2 | ||
|
|
c66d17b310 | ||
|
|
5dec29b5d2 | ||
|
|
00c2557105 | ||
|
|
c82e9af606 | ||
|
|
e8b9ba7c36 | ||
|
|
f2c3715896 | ||
|
|
82dcd08ab6 | ||
|
|
11965e07f3 | ||
|
|
5a1d5e7b3a | ||
|
|
7d5aa4f99f | ||
|
|
57891a2d0c | ||
|
|
225bc6d6e4 | ||
|
|
26fc55a6c1 | ||
|
|
d0a998b4c8 | ||
|
|
60d1b2bad1 | ||
|
|
00f86a3b77 | ||
|
|
10b1b6ff98 | ||
|
|
566a59593f | ||
|
|
e0552c9bda | ||
|
|
65f14f7ee5 | ||
|
|
c364215caa | ||
|
|
f809fd759c | ||
|
|
91a014f9d7 | ||
|
|
78966b62b3 | ||
|
|
b9a76f38e2 | ||
|
|
08e2d1d971 | ||
|
|
c007f2f3d7 | ||
|
|
d628f23c65 | ||
|
|
07fb096ef4 | ||
|
|
b7b287c685 | ||
|
|
39677f85b1 | ||
|
|
9b3340a63b | ||
|
|
503bfbc146 | ||
|
|
c76201c615 | ||
|
|
3c487f5b04 | ||
|
|
d121b3f1b3 | ||
|
|
0b585edc6f | ||
|
|
2d5c106267 | ||
|
|
632ffe0c46 | ||
|
|
e45b838ce0 | ||
|
|
3bf8997d4f | ||
|
|
c06a372eb4 | ||
|
|
65525e9adb | ||
|
|
79968132ad | ||
|
|
fd7b0b4102 | ||
|
|
85571c5fcc | ||
|
|
8f402575bb | ||
|
|
2dee2268ed | ||
|
|
a0a9f2e6a3 | ||
|
|
e9aaf53113 | ||
|
|
7392bf0db3 | ||
|
|
36c08a70dd | ||
|
|
e5e8c28e84 | ||
|
|
a758d322e7 | ||
|
|
e8b40fb63a | ||
|
|
7b213712c7 | ||
|
|
27383ab6f5 | ||
|
|
77dd64c115 | ||
|
|
8988b385fa | ||
|
|
40f7a50b36 | ||
|
|
41b7fc51a6 | ||
|
|
3b60539845 | ||
|
|
9027a7db71 | ||
|
|
5bb7caa514 | ||
|
|
468ea804f3 | ||
|
|
73bf7c2823 | ||
|
|
f7397dfd0d | ||
|
|
d872a95f56 | ||
|
|
582a098346 | ||
|
|
b69d7ac712 | ||
|
|
c4358d136c | ||
|
|
28e156a62c | ||
|
|
5974fad510 | ||
|
|
6caef4e9ec | ||
|
|
8617c31d2e | ||
|
|
7c6c282114 | ||
|
|
2f7b840b4d | ||
|
|
b2e60342a5 | ||
|
|
a186704479 | ||
|
|
9541ae9b96 | ||
|
|
6a6d1436ec | ||
|
|
3d02e50020 | ||
|
|
a48b9d9153 | ||
|
|
dabe599b99 | ||
|
|
248915add7 | ||
|
|
bfa606205b | ||
|
|
7f90dac98d | ||
|
|
4edb4755d8 | ||
|
|
ff263663b3 | ||
|
|
bca8c21c3b | ||
|
|
c151b54eb8 | ||
|
|
41b63b9f58 | ||
|
|
ca67a15327 | ||
|
|
795d977c96 | ||
|
|
03e87ff1c1 | ||
|
|
a6c3157e94 | ||
|
|
d9eb02f451 | ||
|
|
b8904dbcea | ||
|
|
50d53d7357 | ||
|
|
b353253248 | ||
|
|
d9b4537a6d | ||
|
|
bc0e1dde78 | ||
|
|
a26ef5fa33 | ||
|
|
ce569f4f70 | ||
|
|
4e70f5fa41 | ||
|
|
7448a182e0 | ||
|
|
712c696f10 | ||
|
|
e15f3992b0 | ||
|
|
981be81fdf | ||
|
|
baf282d0b2 | ||
|
|
1c5422c83a | ||
|
|
11d59324f8 | ||
|
|
82d02ddcae | ||
|
|
6afb2582ca | ||
|
|
698a9537bf | ||
|
|
b8455d6380 | ||
|
|
c1ab653043 | ||
|
|
946b2188d1 | ||
|
|
2b6d90edb7 | ||
|
|
a8fa327aeb | ||
|
|
103ed7810c | ||
|
|
f9f4cc90ae | ||
|
|
9378824112 | ||
|
|
6b81a71495 | ||
|
|
d16ecf87b7 | ||
|
|
dffcdf0447 | ||
|
|
45563a065d | ||
|
|
149212ae6f | ||
|
|
920f753765 | ||
|
|
9738ca6471 | ||
|
|
083f0ec357 | ||
|
|
4f71a7e6fb | ||
|
|
c6f09ec4d3 | ||
|
|
a9dd5898a3 | ||
|
|
1128ad218a | ||
|
|
2f11fa34bf | ||
|
|
e19c3ddf93 | ||
|
|
0846eacfde | ||
|
|
081c6e736f | ||
|
|
31e7a667d7 | ||
|
|
ad6df73b81 | ||
|
|
47f8b8c405 | ||
|
|
70477be78d | ||
|
|
29cc6b927c | ||
|
|
4014bd72c0 | ||
|
|
808f557fa6 | ||
|
|
29082f6939 | ||
|
|
d9f42ba3a7 | ||
|
|
91d0fd3357 | ||
|
|
66944ccd44 | ||
|
|
01f894dca4 | ||
|
|
ee9db93dff | ||
|
|
578169d1c8 | ||
|
|
578566d641 | ||
|
|
529af3e07d | ||
|
|
be11e3eb85 | ||
|
|
7c39b4446f | ||
|
|
17266b2597 | ||
|
|
62d4e33f0e | ||
|
|
f9cbc05c0d | ||
|
|
69322536e7 | ||
|
|
0b16de4a08 | ||
|
|
c5ad1ed700 | ||
|
|
b3d116a9a9 | ||
|
|
007b6738dc | ||
|
|
751a8f0457 | ||
|
|
6ed06c0116 | ||
|
|
fcaabb265d | ||
|
|
bea127ec17 | ||
|
|
d9b90a79ee | ||
|
|
affa0e4776 | ||
|
|
0ffc37479c | ||
|
|
2d50116715 | ||
|
|
3382284336 | ||
|
|
38bdf328d5 | ||
|
|
f100d4965d | ||
|
|
1965236d97 | ||
|
|
e8e66679ea | ||
|
|
d6fd8c491a | ||
|
|
35c1433d22 | ||
|
|
6ba308ccf2 | ||
|
|
3c4a911b52 | ||
|
|
3944a32426 | ||
|
|
bcbb46f3e8 | ||
|
|
8c1ddd01cb | ||
|
|
0dd72f28e3 | ||
|
|
fccac36c8b | ||
|
|
c00080bc35 | ||
|
|
fc43b0fe60 | ||
|
|
bce00dee8f | ||
|
|
76fffa401c | ||
|
|
5fde309459 | ||
|
|
21de1d64d2 | ||
|
|
a64db66f10 | ||
|
|
07e747de99 | ||
|
|
da7840f49c | ||
|
|
06a9e1d458 | ||
|
|
ca7d155be5 | ||
|
|
3c1a01d7d8 | ||
|
|
28ba30396c | ||
|
|
4585d3ab58 | ||
|
|
d16d1b4cd3 | ||
|
|
07d0f214d9 | ||
|
|
1d584dfa53 | ||
|
|
1893316a70 | ||
|
|
b33ed332b7 | ||
|
|
28ab3277c2 | ||
|
|
8fe84bba53 | ||
|
|
b781828638 | ||
|
|
50b2743a55 | ||
|
|
8db9e48ff1 | ||
|
|
1f601a7fbe | ||
|
|
41faabea56 | ||
|
|
89fb1db368 | ||
|
|
809391c96c | ||
|
|
98b1592c9e | ||
|
|
4ab5585baa | ||
|
|
1e8b49af6c | ||
|
|
6483a6d250 | ||
|
|
50ddbc00ba | ||
|
|
4e7bad9c04 | ||
|
|
f158a38569 | ||
|
|
4d87d49997 | ||
|
|
272f3d8673 | ||
|
|
552e9a92ff | ||
|
|
f6e5d7642f | ||
|
|
28d038e4b0 | ||
|
|
568caeb9e5 | ||
|
|
6e2c3c0ad4 | ||
|
|
7ec278e8b5 | ||
|
|
90fa87e378 | ||
|
|
402f39af15 | ||
|
|
c8abbff19d | ||
|
|
1f2cdf37cb | ||
|
|
8ae2a460ba | ||
|
|
9c933d5af5 | ||
|
|
4a70db6458 | ||
|
|
0ca478db2f | ||
|
|
4ab3c5ad3f | ||
|
|
1ba8bd9fd0 | ||
|
|
f6ca5b2fb8 | ||
|
|
ced750cee5 | ||
|
|
b783349f5f | ||
|
|
0678f331c3 | ||
|
|
53cf34d75a | ||
|
|
2eea2e8924 | ||
|
|
7617aba1d7 | ||
|
|
6b465c8eb8 | ||
|
|
8cefceac98 | ||
|
|
dd76588bac | ||
|
|
f2f51e66a0 | ||
|
|
a8a8a08f47 | ||
|
|
7c128200ae | ||
|
|
e47228a8b1 | ||
|
|
b4381eda43 | ||
|
|
2253e99c97 | ||
|
|
c3aa91b3c3 | ||
|
|
83f9260faf | ||
|
|
b699061f9c | ||
|
|
d8603634bc | ||
|
|
7cbe977061 | ||
|
|
f94824cbd5 | ||
|
|
cfae15e3d8 | ||
|
|
45e4b73270 | ||
|
|
15a7f22b13 | ||
|
|
52a0b35e2c | ||
|
|
9953c33d4c | ||
|
|
84a2f288d0 | ||
|
|
a337c8882d | ||
|
|
92ff0ca194 | ||
|
|
aefffaa670 | ||
|
|
7da6302b3a | ||
|
|
b71b25b72b | ||
|
|
f3e95495c9 | ||
|
|
33a331cff0 | ||
|
|
14afd60bd9 | ||
|
|
0d818e30bf | ||
|
|
df6143fd56 | ||
|
|
8957a1fe0f | ||
|
|
5881fcf35d | ||
|
|
e18a01ff24 | ||
|
|
67ad89d831 | ||
|
|
357c329fd0 | ||
|
|
0d9e32e07a | ||
|
|
981d349abe | ||
|
|
4945ee3d25 | ||
|
|
0bade04e3f | ||
|
|
116fa6a91f | ||
|
|
4c127ac401 | ||
|
|
5349f4147f | ||
|
|
366505c0ea | ||
|
|
75f47fe859 | ||
|
|
f9d9c0448c | ||
|
|
9402419001 | ||
|
|
bbadbc2a9a | ||
|
|
79ad483153 | ||
|
|
4583fda4de | ||
|
|
207b6ecd2b | ||
|
|
a98477b88d | ||
|
|
395641602a | ||
|
|
0b2e1f56ef | ||
|
|
053d50a974 | ||
|
|
1776806463 | ||
|
|
b35aa28ff1 | ||
|
|
35d001eb5e | ||
|
|
af6cab6692 | ||
|
|
bef33af083 | ||
|
|
9feb9d5335 | ||
|
|
b111746d3f | ||
|
|
6300fd9266 | ||
|
|
b143b550d7 | ||
|
|
f1ee0a6f5d | ||
|
|
b73922c628 | ||
|
|
53abce212f | ||
|
|
6c8aa233c4 | ||
|
|
a54f414a07 | ||
|
|
044ee14121 | ||
|
|
9b4ba72781 | ||
|
|
c538d8cf9f | ||
|
|
7a44fedb8b | ||
|
|
24d268890f | ||
|
|
87cb508fba | ||
|
|
5bf915f8c1 | ||
|
|
ff7351c315 | ||
|
|
aa0386921a | ||
|
|
4d8e23dcee | ||
|
|
f6dbdfffd8 | ||
|
|
c3544e93c1 | ||
|
|
aae6f85e30 | ||
|
|
049578a66c | ||
|
|
1fa71d78be | ||
|
|
54e3c59872 | ||
|
|
fad6d91831 | ||
|
|
6c56100e55 | ||
|
|
082138bcd0 | ||
|
|
d6d9d13372 | ||
|
|
f68540f787 | ||
|
|
d12d020478 | ||
|
|
242b0717b9 | ||
|
|
7cdb2ab358 | ||
|
|
8a4fe1838e | ||
|
|
5ab9e3f576 | ||
|
|
85c46112b4 | ||
|
|
e01d4312bd | ||
|
|
5f7a872691 | ||
|
|
377edcaea3 | ||
|
|
56af167ffe | ||
|
|
ac19e7cf8e | ||
|
|
846a561ab5 | ||
|
|
1e6fb8f9f4 | ||
|
|
69974d53da | ||
|
|
5d86b90b12 | ||
|
|
868da9c9ea | ||
|
|
de7f6c95c4 | ||
|
|
3dd942fb66 | ||
|
|
1eb7ddae84 | ||
|
|
5cf9ee2a0a | ||
|
|
1e57c3b7a5 | ||
|
|
92a3a6a469 | ||
|
|
ee8bfd2918 | ||
|
|
677807e9c8 | ||
|
|
6e818e64c1 | ||
|
|
89fabcb4fc | ||
|
|
c3031e5ed6 | ||
|
|
4369ea5c2b | ||
|
|
4462695f6f | ||
|
|
b6eaa680f9 | ||
|
|
1841a4a26a | ||
|
|
bfd4ef2632 | ||
|
|
363611e0c7 | ||
|
|
f15cf64c02 | ||
|
|
942520eb5a | ||
|
|
975b7cef98 | ||
|
|
c00a3c4ffe | ||
|
|
bd9c5be26b | ||
|
|
49c90506ba | ||
|
|
e556dba038 | ||
|
|
0967b72984 | ||
|
|
81dc234491 | ||
|
|
14025167e2 | ||
|
|
3a4729ccb3 | ||
|
|
c42dbc37f2 | ||
|
|
34d6cb7183 | ||
|
|
58ce3d549b | ||
|
|
bfc9f64d15 | ||
|
|
7bfab8be5b | ||
|
|
d0fe655fea | ||
|
|
f87ed49aca | ||
|
|
33bfe265be | ||
|
|
8a9788d6cb | ||
|
|
2cf8576c8b | ||
|
|
abaa648cd1 | ||
|
|
a37ee663e2 | ||
|
|
27d89b79ff | ||
|
|
47ec157075 | ||
|
|
98fccf17df | ||
|
|
25f0fe1519 | ||
|
|
f55d846a82 | ||
|
|
63aa0fe888 | ||
|
|
a876d22e62 | ||
|
|
642f37d5cd | ||
|
|
af53f38a1d | ||
|
|
4e84be6952 | ||
|
|
a53aa26816 | ||
|
|
d81921b6ad | ||
|
|
2bf8ec4f6e | ||
|
|
17cf6c3a6e | ||
|
|
626dfcd2c3 | ||
|
|
44cbb54abe | ||
|
|
43c9bc3926 | ||
|
|
d34ed1e401 | ||
|
|
e80919601d | ||
|
|
a70795085f | ||
|
|
d1b5058b9b | ||
|
|
0254d3971e | ||
|
|
959513180e | ||
|
|
d0083984cc | ||
|
|
325a455e88 | ||
|
|
d866c24537 | ||
|
|
64688e090e | ||
|
|
7bafdf4d0b | ||
|
|
195cec8191 | ||
|
|
093c182e44 | ||
|
|
91153848dc | ||
|
|
12d8760e75 | ||
|
|
6362940fc4 | ||
|
|
4d689a95e8 | ||
|
|
362557dfab | ||
|
|
a9231dfad8 | ||
|
|
836564a376 | ||
|
|
5a746e50ab | ||
|
|
92cc06226d | ||
|
|
e01eeb8a79 | ||
|
|
ffcfd84436 | ||
|
|
3a600a3a0c | ||
|
|
2fb7c6c5d6 | ||
|
|
0fdd3bb394 | ||
|
|
852b9dabe0 | ||
|
|
9cb345c6b4 | ||
|
|
51db4d7108 | ||
|
|
1966d6c584 | ||
|
|
aef4130ce7 | ||
|
|
2fa8b75bfd | ||
|
|
87d481e3b6 | ||
|
|
607f126895 | ||
|
|
f7398aba5f | ||
|
|
90bdac84f7 | ||
|
|
1c23f43e85 | ||
|
|
2622a0ee2b | ||
|
|
0e08b25fb4 | ||
|
|
cf1973cacd | ||
|
|
55ad1d21a9 | ||
|
|
237f4284b6 | ||
|
|
246858c608 | ||
|
|
2f6bca6669 | ||
|
|
95a5c1f652 | ||
|
|
9ceee4e55a | ||
|
|
124b00219c | ||
|
|
ce02ecea50 | ||
|
|
fd9498a5af | ||
|
|
c6a5aad5e0 | ||
|
|
f44df489d3 | ||
|
|
ee894a0906 | ||
|
|
6b8c182637 | ||
|
|
65745d9707 | ||
|
|
5ba7f4f761 | ||
|
|
3f6fe14173 | ||
|
|
2fa254aa1c | ||
|
|
23f516dedf | ||
|
|
356efff411 | ||
|
|
31aeea711e | ||
|
|
43043c85fe | ||
|
|
91ba0de260 | ||
|
|
9f4b58ecdd | ||
|
|
aea9fd6e4b | ||
|
|
7bee74207f | ||
|
|
3199a47062 | ||
|
|
db713a08e1 | ||
|
|
a73e8241ea | ||
|
|
7aa989c850 | ||
|
|
195486ba8a | ||
|
|
4cbef42557 | ||
|
|
fe49ad422f | ||
|
|
e4338d059c | ||
|
|
96207b97bd | ||
|
|
e9bb19bb89 | ||
|
|
5339320909 | ||
|
|
f6b4814fe2 | ||
|
|
acf5d69ceb | ||
|
|
e8e70ac2c3 | ||
|
|
f243429c48 | ||
|
|
52b8fecde4 | ||
|
|
ad47947c3b | ||
|
|
2c36724722 | ||
|
|
cbaeecfd57 | ||
|
|
c218aaa259 | ||
|
|
03b28705fc | ||
|
|
d2092bae76 | ||
|
|
215ab10871 | ||
|
|
48e8850859 | ||
|
|
6aecdbeb37 | ||
|
|
fac36c21ab | ||
|
|
cf6d73e45b | ||
|
|
a40631257c | ||
|
|
d62a6723cd | ||
|
|
5fcbdd00ae | ||
|
|
d8121c9f84 | ||
|
|
c00c0d39b4 | ||
|
|
313133ec82 | ||
|
|
a501f07cb4 | ||
|
|
62cb2fdb62 | ||
|
|
f74ae95149 | ||
|
|
7d9d8c28aa | ||
|
|
c8dc2a4c00 | ||
|
|
11b33c76a7 | ||
|
|
1180a5b9e3 | ||
|
|
118f3f952a | ||
|
|
0796499e12 | ||
|
|
50b56dccd4 | ||
|
|
90680d5206 | ||
|
|
61eae4d8dd | ||
|
|
e56e08898c | ||
|
|
67a5d847c9 | ||
|
|
188740257b | ||
|
|
ff252737f1 | ||
|
|
9939417de7 | ||
|
|
b708b8924f | ||
|
|
921cec73dc | ||
|
|
e1e1707d15 | ||
|
|
fdc8102464 | ||
|
|
4603939c31 | ||
|
|
c2fe794496 | ||
|
|
3d92e1b9a6 | ||
|
|
e6948f8034 | ||
|
|
0eefef44c4 | ||
|
|
b9fca08f2e | ||
|
|
aaf606ed98 | ||
|
|
34390fb0f4 | ||
|
|
d47d97de5f | ||
|
|
db2d680c12 | ||
|
|
694e56745a | ||
|
|
b4c2667cf7 | ||
|
|
9c9dec7723 | ||
|
|
bf7d5c2378 | ||
|
|
d107e2aa74 | ||
|
|
24be132d74 | ||
|
|
c83994c2ea | ||
|
|
810ec105c9 | ||
|
|
85fa2976cd | ||
|
|
a37d9412dc | ||
|
|
48777f9df2 | ||
|
|
457de008da | ||
|
|
0eb10975a6 | ||
|
|
d890adfaff | ||
|
|
c36154dfd5 | ||
|
|
f3f67e820f | ||
|
|
f19ba5997d | ||
|
|
211bd86acd | ||
|
|
6c696f641e | ||
|
|
35158010c2 | ||
|
|
0f762b7113 | ||
|
|
25d05923f1 | ||
|
|
796d373b6e | ||
|
|
60113d0adb | ||
|
|
3229399cee | ||
|
|
7ec6ea85ae | ||
|
|
b29e41439c | ||
|
|
4e7df07ccc | ||
|
|
77cb7a5e8e | ||
|
|
c00205677f | ||
|
|
8fe8e3bf6b | ||
|
|
98a1ce6148 | ||
|
|
c7ac90593b | ||
|
|
946f6d7640 | ||
|
|
f2703b96ea | ||
|
|
399a415bd3 | ||
|
|
3e7b2c64b0 | ||
|
|
f5cb14f12e | ||
|
|
67adeebee8 | ||
|
|
d2d199340d | ||
|
|
ab67f7072c | ||
|
|
6a8d2a8ff0 | ||
|
|
d49ce3c851 | ||
|
|
8ac4d5ec90 | ||
|
|
9b2afca060 | ||
|
|
9485435c01 | ||
|
|
eddaecf216 | ||
|
|
9f79801964 | ||
|
|
070f990d7b | ||
|
|
4a0ca7e25b | ||
|
|
65e73783d6 | ||
|
|
ff6d969e40 | ||
|
|
a9ecfbff89 | ||
|
|
2227dea425 |
2
.github/actions/config/action.yml
vendored
2
.github/actions/config/action.yml
vendored
@@ -42,5 +42,5 @@ runs:
|
||||
run: |
|
||||
# Extract value from configuration file
|
||||
value="$(grep -h ${{ inputs.var }}= make/conf/github-actions.conf | cut -d '=' -f 2-)"
|
||||
echo "value=$value" >> $GITHUB_OUTPUT
|
||||
echo "::set-output name=value::$value"
|
||||
shell: bash
|
||||
|
||||
2
.github/actions/do-build/action.yml
vendored
2
.github/actions/do-build/action.yml
vendored
@@ -61,7 +61,7 @@ runs:
|
||||
$build_dir/make-support/failure-summary.log \
|
||||
$build_dir/make-support/failure-logs/* \
|
||||
failure-logs/ 2> /dev/null || true
|
||||
echo 'failure=true' >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=failure::true'
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
|
||||
4
.github/actions/get-bootjdk/action.yml
vendored
4
.github/actions/get-bootjdk/action.yml
vendored
@@ -42,7 +42,7 @@ runs:
|
||||
run: |
|
||||
# Convert platform name to upper case
|
||||
platform_prefix="$(echo ${{ inputs.platform }} | tr [a-z-] [A-Z_])"
|
||||
echo "value=$platform_prefix" >> $GITHUB_OUTPUT
|
||||
echo "::set-output name=value::$platform_prefix"
|
||||
shell: bash
|
||||
|
||||
- name: 'Get URL configuration'
|
||||
@@ -105,5 +105,5 @@ runs:
|
||||
id: path-name
|
||||
run: |
|
||||
# Export the path
|
||||
echo 'path=bootjdk/jdk' >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=path::bootjdk/jdk'
|
||||
shell: bash
|
||||
|
||||
6
.github/actions/get-bundles/action.yml
vendored
6
.github/actions/get-bundles/action.yml
vendored
@@ -103,7 +103,7 @@ runs:
|
||||
tests_dir="$(cygpath $tests_dir)"
|
||||
fi
|
||||
|
||||
echo "jdk=$jdk_dir" >> $GITHUB_OUTPUT
|
||||
echo "symbols=$symbols_dir" >> $GITHUB_OUTPUT
|
||||
echo "tests=$tests_dir" >> $GITHUB_OUTPUT
|
||||
echo "::set-output name=jdk::$jdk_dir"
|
||||
echo "::set-output name=symbols::$symbols_dir"
|
||||
echo "::set-output name=tests::$tests_dir"
|
||||
shell: bash
|
||||
|
||||
6
.github/actions/get-gtest/action.yml
vendored
6
.github/actions/get-gtest/action.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -43,12 +43,12 @@ runs:
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: google/googletest
|
||||
ref: 'v${{ steps.version.outputs.value }}'
|
||||
ref: 'release-${{ steps.version.outputs.value }}'
|
||||
path: gtest
|
||||
|
||||
- name: 'Export path to where GTest is installed'
|
||||
id: path-name
|
||||
run: |
|
||||
# Export the path
|
||||
echo 'path=gtest' >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=path::gtest'
|
||||
shell: bash
|
||||
|
||||
6
.github/actions/get-jtreg/action.yml
vendored
6
.github/actions/get-jtreg/action.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -57,7 +57,7 @@ runs:
|
||||
- name: 'Build JTReg'
|
||||
run: |
|
||||
# Build JTReg and move files to the proper locations
|
||||
bash make/build.sh --jdk "$JAVA_HOME_17_X64"
|
||||
bash make/build.sh --jdk "$JAVA_HOME_11_X64"
|
||||
mkdir ../installed
|
||||
mv build/images/jtreg/* ../installed
|
||||
working-directory: jtreg/src
|
||||
@@ -68,5 +68,5 @@ runs:
|
||||
id: path-name
|
||||
run: |
|
||||
# Export the path
|
||||
echo 'path=jtreg/installed' >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=path::jtreg/installed'
|
||||
shell: bash
|
||||
|
||||
7
.github/actions/get-msys2/action.yml
vendored
7
.github/actions/get-msys2/action.yml
vendored
@@ -30,16 +30,15 @@ runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: 'Install MSYS2'
|
||||
# use a specific release of msys2/setup-msys2 to prevent jtreg build failures on newer release
|
||||
uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
install: 'autoconf tar unzip zip make'
|
||||
path-type: minimal
|
||||
location: ${{ runner.tool_cache }}/msys2
|
||||
location: msys2
|
||||
|
||||
# We can't run bash until this is completed, so stick with pwsh
|
||||
- name: 'Set MSYS2 path'
|
||||
run: |
|
||||
# Prepend msys2/msys64/usr/bin to the PATH
|
||||
echo "$env:RUNNER_TOOL_CACHE/msys2/msys64/usr/bin" >> $env:GITHUB_PATH
|
||||
echo "$env:GITHUB_WORKSPACE/msys2/msys64/usr/bin" >> $env:GITHUB_PATH
|
||||
shell: pwsh
|
||||
|
||||
4
.github/actions/upload-bundles/action.yml
vendored
4
.github/actions/upload-bundles/action.yml
vendored
@@ -62,9 +62,9 @@ runs:
|
||||
fi
|
||||
|
||||
if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$symbols_bundle$tests_bundle" != "" ]]; then
|
||||
echo 'bundles-found=true' >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=bundles-found::true'
|
||||
else
|
||||
echo 'bundles-found=false' >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=bundles-found::false'
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
|
||||
7
.github/scripts/gen-test-summary.sh
vendored
7
.github/scripts/gen-test-summary.sh
vendored
@@ -25,7 +25,6 @@
|
||||
#
|
||||
|
||||
GITHUB_STEP_SUMMARY="$1"
|
||||
GITHUB_OUTPUT="$2"
|
||||
|
||||
test_suite_name=$(cat build/run-test-prebuilt/test-support/test-last-ids.txt)
|
||||
results_dir=build/run-test-prebuilt/test-results/$test_suite_name/text
|
||||
@@ -42,12 +41,12 @@ error_count=$(echo $errors | wc -w || true)
|
||||
|
||||
if [[ "$failures" = "" && "$errors" = "" ]]; then
|
||||
# We know something went wrong, but not what
|
||||
echo 'error-message=Unspecified test suite failure. Please see log for job for details.' >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=error-message::Unspecified test suite failure. Please see log for job for details.'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo 'failure=true' >> $GITHUB_OUTPUT
|
||||
echo "error-message=Test run reported $failure_count test failure(s) and $error_count error(s). See summary for details." >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=failure::true'
|
||||
echo "::set-output name=error-message::Test run reported $failure_count test failure(s) and $error_count error(s). See summary for details."
|
||||
|
||||
echo '### :boom: Test failures summary' >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
|
||||
70
.github/workflows/build-cross-compile.yml
vendored
70
.github/workflows/build-cross-compile.yml
vendored
@@ -29,28 +29,22 @@ on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
gcc-major-version:
|
||||
required: true
|
||||
required: false
|
||||
type: string
|
||||
default: '10'
|
||||
apt-gcc-version:
|
||||
required: true
|
||||
type: string
|
||||
apt-gcc-cross-version:
|
||||
required: true
|
||||
type: string
|
||||
extra-conf-options:
|
||||
required: false
|
||||
type: string
|
||||
configure-arguments:
|
||||
required: false
|
||||
type: string
|
||||
make-arguments:
|
||||
default: '10.3.0-1ubuntu1~20.04'
|
||||
apt-gcc-cross-suffix:
|
||||
required: false
|
||||
type: string
|
||||
default: 'cross1'
|
||||
|
||||
jobs:
|
||||
build-cross-compile:
|
||||
name: build
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -60,35 +54,20 @@ jobs:
|
||||
- arm
|
||||
- s390x
|
||||
- ppc64le
|
||||
- riscv64
|
||||
include:
|
||||
- target-cpu: aarch64
|
||||
gnu-arch: aarch64
|
||||
debian-arch: arm64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
gnu-arch: aarch64
|
||||
- target-cpu: arm
|
||||
gnu-arch: arm
|
||||
debian-arch: armhf
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
gnu-arch: arm
|
||||
gnu-abi: eabihf
|
||||
- target-cpu: s390x
|
||||
gnu-arch: s390x
|
||||
debian-arch: s390x
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
gnu-arch: s390x
|
||||
- target-cpu: ppc64le
|
||||
gnu-arch: powerpc64le
|
||||
debian-arch: ppc64el
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
- target-cpu: riscv64
|
||||
gnu-arch: riscv64
|
||||
debian-arch: riscv64
|
||||
debian-repository: https://deb.debian.org/debian-ports
|
||||
debian-keyring: /usr/share/keyrings/debian-ports-archive-keyring.gpg
|
||||
debian-version: sid
|
||||
gnu-arch: powerpc64le
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the JDK source'
|
||||
@@ -116,10 +95,9 @@ jobs:
|
||||
sudo apt-get install \
|
||||
gcc-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
|
||||
g++-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
|
||||
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
|
||||
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
|
||||
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev \
|
||||
debian-ports-archive-keyring
|
||||
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-version }}${{ inputs.apt-gcc-cross-suffix }} \
|
||||
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-version }}${{ inputs.apt-gcc-cross-suffix }} \
|
||||
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
|
||||
|
||||
- name: 'Check cache for sysroot'
|
||||
@@ -135,15 +113,14 @@ jobs:
|
||||
|
||||
- name: 'Create sysroot'
|
||||
run: >
|
||||
sudo debootstrap
|
||||
sudo qemu-debootstrap
|
||||
--arch=${{ matrix.debian-arch }}
|
||||
--verbose
|
||||
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev
|
||||
--resolve-deps
|
||||
$(test -n "${{ matrix.debian-keyring }}" && echo "--keyring=${{ matrix.debian-keyring }}")
|
||||
${{ matrix.debian-version }}
|
||||
buster
|
||||
sysroot
|
||||
${{ matrix.debian-repository }}
|
||||
https://httpredir.debian.org/debian/
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Prepare sysroot'
|
||||
@@ -151,9 +128,7 @@ jobs:
|
||||
# Prepare sysroot and remove unused files to minimize cache
|
||||
sudo chroot sysroot symlinks -cr .
|
||||
sudo chown ${USER} -R sysroot
|
||||
rm -rf sysroot/{dev,proc,run,sys,var}
|
||||
rm -rf sysroot/usr/{sbin,bin,share}
|
||||
rm -rf sysroot/usr/lib/{apt,udev,systemd}
|
||||
rm -rf sysroot/{dev,proc,run,sys}
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Configure'
|
||||
@@ -168,17 +143,12 @@ jobs:
|
||||
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
|
||||
--with-sysroot=sysroot
|
||||
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
|
||||
--with-jmod-compress=zip-1
|
||||
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
|
||||
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
exit 1)
|
||||
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-10
|
||||
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-10
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
uses: ./.github/actions/do-build
|
||||
with:
|
||||
make-target: 'hotspot ${{ inputs.make-arguments }}'
|
||||
make-target: 'hotspot'
|
||||
platform: linux-${{ matrix.target-cpu }}
|
||||
|
||||
32
.github/workflows/build-linux.yml
vendored
32
.github/workflows/build-linux.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -42,13 +42,6 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: '[ "debug", "release" ]'
|
||||
gcc-major-version:
|
||||
required: true
|
||||
type: string
|
||||
gcc-package-suffix:
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
apt-gcc-version:
|
||||
required: true
|
||||
type: string
|
||||
@@ -58,17 +51,11 @@ on:
|
||||
apt-extra-packages:
|
||||
required: false
|
||||
type: string
|
||||
configure-arguments:
|
||||
required: false
|
||||
type: string
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
name: build
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -102,7 +89,7 @@ jobs:
|
||||
run: |
|
||||
# Set a proper suffix for packages if using a different architecture
|
||||
if [[ '${{ inputs.apt-architecture }}' != '' ]]; then
|
||||
echo 'suffix=:${{ inputs.apt-architecture }}' >> $GITHUB_OUTPUT
|
||||
echo '::set-output name=suffix:::${{ inputs.apt-architecture }}'
|
||||
fi
|
||||
|
||||
# Upgrading apt to solve libc6 installation bugs, see JDK-8260460.
|
||||
@@ -114,8 +101,8 @@ jobs:
|
||||
fi
|
||||
sudo apt-get update
|
||||
sudo apt-get install --only-upgrade apt
|
||||
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
|
||||
sudo apt-get install gcc-${{ inputs.apt-gcc-version }} g++-${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
|
||||
|
||||
- name: 'Configure'
|
||||
run: >
|
||||
@@ -126,18 +113,15 @@ jobs:
|
||||
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
|
||||
--with-jtreg=${{ steps.jtreg.outputs.path }}
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--enable-jtreg-failure-handler
|
||||
--with-zlib=system
|
||||
--with-jmod-compress=zip-1
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
exit 1)
|
||||
${{ inputs.extra-conf-options }}
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
uses: ./.github/actions/do-build
|
||||
with:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
make-target: '${{ inputs.make-target }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
|
||||
|
||||
19
.github/workflows/build-macos.yml
vendored
19
.github/workflows/build-macos.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -45,17 +45,11 @@ on:
|
||||
xcode-toolset-version:
|
||||
required: true
|
||||
type: string
|
||||
configure-arguments:
|
||||
required: false
|
||||
type: string
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
name: build
|
||||
runs-on: macos-11
|
||||
runs-on: macos-10.15
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -101,18 +95,15 @@ jobs:
|
||||
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
|
||||
--with-jtreg=${{ steps.jtreg.outputs.path }}
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--enable-jtreg-failure-handler
|
||||
--with-zlib=system
|
||||
--with-jmod-compress=zip-1
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
exit 1)
|
||||
${{ inputs.extra-conf-options }}
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
uses: ./.github/actions/do-build
|
||||
with:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
make-target: '${{ inputs.make-target }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
|
||||
|
||||
34
.github/workflows/build-windows.yml
vendored
34
.github/workflows/build-windows.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -48,12 +48,6 @@ on:
|
||||
msvc-toolset-architecture:
|
||||
required: true
|
||||
type: string
|
||||
configure-arguments:
|
||||
required: false
|
||||
type: string
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
env:
|
||||
# These are needed to make the MSYS2 bash work properly
|
||||
@@ -98,26 +92,12 @@ jobs:
|
||||
id: gtest
|
||||
uses: ./.github/actions/get-gtest
|
||||
|
||||
- name: 'Check toolchain installed'
|
||||
id: toolchain-check
|
||||
run: |
|
||||
set +e
|
||||
'/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }}
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Toolchain is already installed"
|
||||
echo "toolchain-installed=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Toolchain is not yet installed"
|
||||
echo "toolchain-installed=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: 'Install toolchain and dependencies'
|
||||
run: |
|
||||
# Run Visual Studio Installer
|
||||
'/c/Program Files (x86)/Microsoft Visual Studio/Installer/vs_installer.exe' \
|
||||
modify --quiet --installPath 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise' \
|
||||
modify --quiet --installPath 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise' \
|
||||
--add Microsoft.VisualStudio.Component.VC.${{ inputs.msvc-toolset-version }}.${{ inputs.msvc-toolset-architecture }}
|
||||
if: steps.toolchain-check.outputs.toolchain-installed != 'true'
|
||||
|
||||
- name: 'Configure'
|
||||
run: >
|
||||
@@ -128,23 +108,19 @@ jobs:
|
||||
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
|
||||
--with-jtreg=${{ steps.jtreg.outputs.path }}
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--enable-jtreg-failure-handler
|
||||
--with-msvc-toolset-version=${{ inputs.msvc-toolset-version }}
|
||||
--with-jmod-compress=zip-1
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
exit 1)
|
||||
${{ inputs.extra-conf-options }}
|
||||
env:
|
||||
# We need a minimal PATH on Windows
|
||||
# Set PATH to "", so just GITHUB_PATH is included
|
||||
PATH: ''
|
||||
shell: env /usr/bin/bash --login -eo pipefail {0}
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
uses: ./.github/actions/do-build
|
||||
with:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
make-target: '${{ inputs.make-target }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
|
||||
|
||||
131
.github/workflows/main.yml
vendored
131
.github/workflows/main.yml
vendored
@@ -26,18 +26,16 @@
|
||||
name: 'OpenJDK GHA Sanity Checks'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- master
|
||||
- pr/*
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
platforms:
|
||||
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
|
||||
required: true
|
||||
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
|
||||
configure-arguments:
|
||||
description: 'Additional configure arguments'
|
||||
required: false
|
||||
make-arguments:
|
||||
description: 'Additional make arguments'
|
||||
required: false
|
||||
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -51,18 +49,16 @@ jobs:
|
||||
|
||||
select:
|
||||
name: 'Select platforms'
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
linux-x64: ${{ steps.include.outputs.linux-x64 }}
|
||||
linux-x86: ${{ steps.include.outputs.linux-x86 }}
|
||||
# additional build options for linux-x64 are disabled
|
||||
# linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
|
||||
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
|
||||
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
|
||||
macos-x64: ${{ steps.include.outputs.macos-x64 }}
|
||||
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
|
||||
windows-x64: ${{ steps.include.outputs.windows-x64 }}
|
||||
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
|
||||
docs: ${{ steps.include.outputs.docs }}
|
||||
|
||||
steps:
|
||||
# This function must be inlined in main.yml, or we'd be forced to checkout the repo
|
||||
@@ -75,17 +71,19 @@ jobs:
|
||||
# 'false' otherwise.
|
||||
# arg $1: platform name or names to look for
|
||||
function check_platform() {
|
||||
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
|
||||
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
|
||||
echo 'false'
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
|
||||
input='${{ github.event.inputs.platforms }}'
|
||||
elif [[ $GITHUB_EVENT_NAME == push ]]; then
|
||||
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
|
||||
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
|
||||
>&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
|
||||
echo 'false'
|
||||
return
|
||||
else
|
||||
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
|
||||
fi
|
||||
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
|
||||
else
|
||||
echo 'Internal error in GHA'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
normalized_input="$(echo ,$input, | tr -d ' ')"
|
||||
@@ -106,15 +104,14 @@ jobs:
|
||||
echo 'false'
|
||||
}
|
||||
|
||||
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
|
||||
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
|
||||
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
|
||||
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
|
||||
echo "::set-output name=linux-x64::$(check_platform linux-x64 linux x64)"
|
||||
echo "::set-output name=linux-x86::$(check_platform linux-x86 linux x86)"
|
||||
echo "::set-output name=linux-x64-variants::$(check_platform linux-x64-variants variants)"
|
||||
echo "::set-output name=linux-cross-compile::$(check_platform linux-cross-compile cross-compile)"
|
||||
echo "::set-output name=macos-x64::$(check_platform macos-x64 macos x64)"
|
||||
echo "::set-output name=macos-aarch64::$(check_platform macos-aarch64 macos aarch64)"
|
||||
echo "::set-output name=windows-x64::$(check_platform windows-x64 windows x64)"
|
||||
echo "::set-output name=windows-aarch64::$(check_platform windows-aarch64 windows aarch64)"
|
||||
|
||||
###
|
||||
### Build jobs
|
||||
@@ -126,10 +123,7 @@ jobs:
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
|
||||
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
|
||||
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
@@ -139,16 +133,12 @@ jobs:
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x86
|
||||
gcc-major-version: '10'
|
||||
gcc-package-suffix: '-multilib'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-version: '10-multilib'
|
||||
apt-architecture: 'i386'
|
||||
# Some multilib libraries do not have proper inter-dependencies, so we have to
|
||||
# install their dependencies manually.
|
||||
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386 libgcc-s1:i386 libstdc++6:i386'
|
||||
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386'
|
||||
extra-conf-options: '--with-target-bits=32'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x86 == 'true'
|
||||
|
||||
build-linux-x64-hs-nopch:
|
||||
@@ -159,11 +149,8 @@ jobs:
|
||||
platform: linux-x64
|
||||
make-target: 'hotspot'
|
||||
debug-levels: '[ "debug" ]'
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
|
||||
extra-conf-options: '--disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-zero:
|
||||
@@ -174,11 +161,8 @@ jobs:
|
||||
platform: linux-x64
|
||||
make-target: 'hotspot'
|
||||
debug-levels: '[ "debug" ]'
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
|
||||
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-minimal:
|
||||
@@ -189,11 +173,8 @@ jobs:
|
||||
platform: linux-x64
|
||||
make-target: 'hotspot'
|
||||
debug-levels: '[ "debug" ]'
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
|
||||
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-optimized:
|
||||
@@ -205,11 +186,8 @@ jobs:
|
||||
make-target: 'hotspot'
|
||||
# Technically this is not the "debug" level, but we can't inject a new matrix state for just this job
|
||||
debug-levels: '[ "debug" ]'
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
|
||||
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-cross-compile:
|
||||
@@ -218,12 +196,6 @@ jobs:
|
||||
- select
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/build-cross-compile.yml
|
||||
with:
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-cross-version: '10.4.0-4ubuntu1~22.04cross1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-macos-x64:
|
||||
@@ -232,9 +204,7 @@ jobs:
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
xcode-toolset-version: '12.5.1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
xcode-toolset-version: '11.3.1'
|
||||
if: needs.select.outputs.macos-x64 == 'true'
|
||||
|
||||
build-macos-aarch64:
|
||||
@@ -243,10 +213,8 @@ jobs:
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
xcode-toolset-version: '12.5.1'
|
||||
xcode-toolset-version: '12.4'
|
||||
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-aarch64 == 'true'
|
||||
|
||||
build-windows-x64:
|
||||
@@ -255,10 +223,8 @@ jobs:
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-version: '14.25'
|
||||
msvc-toolset-architecture: 'x86.x64'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-x64 == 'true'
|
||||
|
||||
build-windows-aarch64:
|
||||
@@ -271,27 +237,8 @@ jobs:
|
||||
msvc-toolset-architecture: 'arm64'
|
||||
make-target: 'hotspot'
|
||||
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-aarch64 == 'true'
|
||||
|
||||
build-docs:
|
||||
name: docs
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
debug-levels: '[ "debug" ]'
|
||||
make-target: 'docs-jdk-bundles'
|
||||
# Make sure we never try to make full docs, since that would require a
|
||||
# build JDK, and we do not need the additional testing of the graphs.
|
||||
extra-conf-options: '--disable-full-docs'
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.docs == 'true'
|
||||
|
||||
###
|
||||
### Test jobs
|
||||
###
|
||||
@@ -304,7 +251,7 @@ jobs:
|
||||
with:
|
||||
platform: linux-x64
|
||||
bootjdk-platform: linux-x64
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
test-linux-x86:
|
||||
name: linux-x86
|
||||
@@ -314,7 +261,7 @@ jobs:
|
||||
with:
|
||||
platform: linux-x86
|
||||
bootjdk-platform: linux-x64
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
test-macos-x64:
|
||||
name: macos-x64
|
||||
@@ -324,7 +271,7 @@ jobs:
|
||||
with:
|
||||
platform: macos-x64
|
||||
bootjdk-platform: macos-x64
|
||||
runs-on: macos-11
|
||||
runs-on: macos-10.15
|
||||
|
||||
test-windows-x64:
|
||||
name: windows-x64
|
||||
@@ -339,7 +286,7 @@ jobs:
|
||||
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
|
||||
remove-bundles:
|
||||
name: 'Remove bundle artifacts'
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
if: always()
|
||||
needs:
|
||||
- build-linux-x64
|
||||
|
||||
270
.github/workflows/pr.yml
vendored
270
.github/workflows/pr.yml
vendored
@@ -1,270 +0,0 @@
|
||||
#
|
||||
# Copyright 2000-2023 JetBrains s.r.o.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
name: 'Build OpenJDK on pull request'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
###
|
||||
### Determine platforms to include
|
||||
###
|
||||
select:
|
||||
name: 'Select platforms'
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
linux-x64: ${{ steps.include.outputs.linux-x64 }}
|
||||
linux-x86: ${{ steps.include.outputs.linux-x86 }}
|
||||
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
|
||||
macos-x64: ${{ steps.include.outputs.macos-x64 }}
|
||||
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
|
||||
windows-x64: ${{ steps.include.outputs.windows-x64 }}
|
||||
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
|
||||
windows-x86: ${{ steps.include.outputs.windows-x86 }}
|
||||
|
||||
steps:
|
||||
# This function must be inlined in main.yml, or we'd be forced to checkout the repo
|
||||
- name: 'Check what jobs to run'
|
||||
id: include
|
||||
run: |
|
||||
# Determine which platform jobs to run
|
||||
|
||||
# Returns 'true' if the input platform list matches any of the platform monikers given as argument,
|
||||
# 'false' otherwise.
|
||||
# arg $1: platform name or names to look for
|
||||
function check_platform() {
|
||||
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
|
||||
input='${{ github.event.inputs.platforms }}'
|
||||
elif [[ $GITHUB_EVENT_NAME == push ]]; then
|
||||
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
|
||||
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
|
||||
>&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
|
||||
echo 'false'
|
||||
return
|
||||
else
|
||||
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
|
||||
fi
|
||||
fi
|
||||
|
||||
normalized_input="$(echo ,$input, | tr -d ' ')"
|
||||
if [[ "$normalized_input" == ",," ]]; then
|
||||
# For an empty input, assume all platforms should run
|
||||
echo 'true'
|
||||
return
|
||||
else
|
||||
# Check for all acceptable platform names
|
||||
for part in $* ; do
|
||||
if echo "$normalized_input" | grep -q -e ",$part," ; then
|
||||
echo 'true'
|
||||
return
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo 'false'
|
||||
}
|
||||
|
||||
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
|
||||
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
|
||||
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
|
||||
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-x86=$(check_platform windows-x86 windows x86)" >> $GITHUB_OUTPUT
|
||||
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
|
||||
|
||||
###
|
||||
### Build jobs
|
||||
###
|
||||
|
||||
build-linux-x64:
|
||||
name: linux-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
|
||||
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-linux-x86:
|
||||
name: linux-x86
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x86
|
||||
gcc-major-version: '10'
|
||||
gcc-package-suffix: '-multilib'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-architecture: 'i386'
|
||||
# Some multilib libraries do not have proper inter-dependencies, so we have to
|
||||
# install their dependencies manually.
|
||||
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386'
|
||||
extra-conf-options: '--with-target-bits=32'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x86 == 'true'
|
||||
|
||||
build-linux-cross-compile:
|
||||
name: linux-cross-compile
|
||||
needs:
|
||||
- select
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/build-cross-compile.yml
|
||||
with:
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-cross-version: '10.4.0-4ubuntu1~22.04cross1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-macos-x64:
|
||||
name: macos-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
xcode-toolset-version: '12.5.1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-x64 == 'true'
|
||||
|
||||
build-macos-aarch64:
|
||||
name: macos-aarch64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
xcode-toolset-version: '12.5.1'
|
||||
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-aarch64 == 'true'
|
||||
|
||||
build-windows-x64:
|
||||
name: windows-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'x86.x64'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-x64 == 'true'
|
||||
|
||||
build-windows-x86:
|
||||
name: windows-x86
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x86
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'x86'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-x86 == 'true'
|
||||
|
||||
build-windows-aarch64:
|
||||
name: windows-aarch64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-aarch64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'arm64'
|
||||
make-target: 'hotspot'
|
||||
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-aarch64 == 'true'
|
||||
|
||||
build-docs:
|
||||
name: docs
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
debug-levels: '[ "debug" ]'
|
||||
make-target: 'docs-jdk-bundles'
|
||||
# Make sure we never try to make full docs, since that would require a
|
||||
# build JDK, and we do not need the additional testing of the graphs.
|
||||
extra-conf-options: '--disable-full-docs'
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.docs == 'true'
|
||||
|
||||
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
|
||||
remove-bundles:
|
||||
name: 'Remove bundle artifacts'
|
||||
runs-on: ubuntu-22.04
|
||||
if: always()
|
||||
needs:
|
||||
- build-linux-x64
|
||||
- build-linux-x86
|
||||
- build-linux-cross-compile
|
||||
- build-macos-x64
|
||||
- build-macos-aarch64
|
||||
- build-windows-x64
|
||||
- build-windows-aarch64
|
||||
- build-windows-x86
|
||||
|
||||
steps:
|
||||
# Hack to get hold of the api environment variables that are only defined for actions
|
||||
- name: 'Get API configuration'
|
||||
id: api
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
|
||||
|
||||
- name: 'Remove bundle artifacts'
|
||||
run: |
|
||||
# Find and remove all bundle artifacts
|
||||
ALL_ARTIFACT_URLS="$(curl -s \
|
||||
-H 'Accept: application/json;api-version=6.0-preview' \
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
|
||||
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
|
||||
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
|
||||
for url in $BUNDLE_ARTIFACT_URLS; do
|
||||
echo "Removing $url"
|
||||
curl -s \
|
||||
-H 'Accept: application/json;api-version=6.0-preview' \
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
|
||||
-X DELETE "$url" \
|
||||
|| echo "Failed to remove bundle"
|
||||
done
|
||||
15
.github/workflows/test.yml
vendored
15
.github/workflows/test.yml
vendored
@@ -64,7 +64,6 @@ jobs:
|
||||
- 'hs/tier1 gc'
|
||||
- 'hs/tier1 runtime'
|
||||
- 'hs/tier1 serviceability'
|
||||
- 'lib-test/tier1'
|
||||
|
||||
include:
|
||||
- test-name: 'jdk/tier1 part 1'
|
||||
@@ -99,10 +98,6 @@ jobs:
|
||||
test-suite: 'test/hotspot/jtreg/:tier1_serviceability'
|
||||
debug-suffix: -debug
|
||||
|
||||
- test-name: 'lib-test/tier1'
|
||||
test-suite: 'test/lib-test/:tier1'
|
||||
debug-suffix: -debug
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the JDK source'
|
||||
uses: actions/checkout@v3
|
||||
@@ -132,7 +127,7 @@ jobs:
|
||||
run: |
|
||||
# On macOS we need to install some dependencies for testing
|
||||
brew install make
|
||||
sudo xcode-select --switch /Applications/Xcode_11.7.app/Contents/Developer
|
||||
sudo xcode-select --switch /Applications/Xcode_11.3.1.app/Contents/Developer
|
||||
# This will make GNU make available as 'make' and not only as 'gmake'
|
||||
echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH
|
||||
if: runner.os == 'macOS'
|
||||
@@ -143,9 +138,9 @@ jobs:
|
||||
# We need a minimal PATH on Windows
|
||||
# Set PATH to "", so just GITHUB_PATH is included
|
||||
if [[ '${{ runner.os }}' == 'Windows' ]]; then
|
||||
echo "value=" >> $GITHUB_OUTPUT
|
||||
echo "::set-output name=value::"
|
||||
else
|
||||
echo "value=$PATH" >> $GITHUB_OUTPUT
|
||||
echo "::set-output name=value::$PATH"
|
||||
fi
|
||||
|
||||
- name: 'Run tests'
|
||||
@@ -159,7 +154,7 @@ jobs:
|
||||
SYMBOLS_IMAGE_DIR=${{ steps.bundles.outputs.symbols-path }}
|
||||
TEST_IMAGE_DIR=${{ steps.bundles.outputs.tests-path }}
|
||||
JTREG='JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash;VERBOSE=fail,error,time;KEYWORDS=!headful'
|
||||
&& bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY" "$GITHUB_OUTPUT"
|
||||
&& bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY"
|
||||
env:
|
||||
PATH: ${{ steps.path.outputs.value }}
|
||||
|
||||
@@ -192,7 +187,7 @@ jobs:
|
||||
fi
|
||||
|
||||
artifact_name="results-${{ inputs.platform }}-$(echo ${{ matrix.test-name }} | tr '/ ' '__')"
|
||||
echo "artifact-name=$artifact_name" >> $GITHUB_OUTPUT
|
||||
echo "::set-output name=artifact-name::$artifact_name"
|
||||
if: always()
|
||||
|
||||
- name: 'Upload test results'
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -18,8 +18,5 @@ NashornProfile.txt
|
||||
/src/utils/LogCompilation/target/
|
||||
/.project/
|
||||
/.settings/
|
||||
/.project
|
||||
/.classpath
|
||||
/.cproject
|
||||
/compile_commands.json
|
||||
/.cache
|
||||
*.class
|
||||
.idea/workspace.xml
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[general]
|
||||
project=jdk
|
||||
jbs=JDK
|
||||
version=21
|
||||
version=20
|
||||
|
||||
[checks]
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
|
||||
@@ -15,7 +15,7 @@ version=0
|
||||
domain=openjdk.org
|
||||
|
||||
[checks "whitespace"]
|
||||
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.gmk|.*\.m4|.*\.ac|Makefile
|
||||
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.gmk|.*\.m4|.*\.ac|Makefile
|
||||
ignore-tabs=.*\.gmk|Makefile
|
||||
|
||||
[checks "merge"]
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
OPENJDK ASSEMBLY EXCEPTION
|
||||
|
||||
The OpenJDK source code made available by Oracle America, Inc. (Oracle) at
|
||||
openjdk.org ("OpenJDK Code") is distributed under the terms of the GNU
|
||||
General Public License <https://www.gnu.org/copyleft/gpl.html> version 2
|
||||
openjdk.java.net ("OpenJDK Code") is distributed under the terms of the GNU
|
||||
General Public License <http://www.gnu.org/copyleft/gpl.html> version 2
|
||||
only ("GPL2"), with the following clarification and special exception.
|
||||
|
||||
Linking this OpenJDK Code statically or dynamically with other code
|
||||
@@ -12,7 +12,7 @@ only ("GPL2"), with the following clarification and special exception.
|
||||
|
||||
As a special exception, Oracle gives you permission to link this
|
||||
OpenJDK Code with certain code licensed by Oracle as indicated at
|
||||
https://openjdk.org/legal/exception-modules-2007-05-08.html
|
||||
http://openjdk.java.net/legal/exception-modules-2007-05-08.html
|
||||
("Designated Exception Modules") to produce an executable,
|
||||
regardless of the license terms of the Designated Exception Modules,
|
||||
and to copy and distribute the resulting executable under GPL2,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Contributing to the JDK
|
||||
|
||||
Please see <https://openjdk.org/contribute> for how to contribute.
|
||||
Please see <https://openjdk.java.net/contribute/> for how to contribute.
|
||||
|
||||
53
README.md
53
README.md
@@ -3,11 +3,8 @@
|
||||
# Welcome to JetBrains Runtime!
|
||||
|
||||
JetBrains Runtime is a fork of [OpenJDK](https://github.com/openjdk/jdk) available for Windows, Mac OS X, and Linux.
|
||||
It supports enhanced class redefinition ([DCEVM](https://ssw.jku.at/dcevm/)),
|
||||
features optional [JCEF](https://github.com/JetBrains/jcef), a framework for embedding Chromium-based browsers,
|
||||
includes a number of improvements in font rendering, keyboards support,
|
||||
windowing/focus subsystems, HiDPI, accessibility, and performance, provides better desktop integration
|
||||
and bugfixes not yet present in OpenJDK.
|
||||
It includes a number of enhancements in font rendering, HiDPI support, windowing/focus subsystems, performance
|
||||
improvements and bugfixes.
|
||||
|
||||
> **_NOTE_**: This is a **development** branch that is periodically synchronized with
|
||||
> the [OpenJDK master](https://github.com/openjdk/jdk/tree/master) branch.
|
||||
@@ -17,29 +14,26 @@ and bugfixes not yet present in OpenJDK.
|
||||
* [jbr17](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr17) (JDK 17)
|
||||
|
||||
Download the latest releases of JetBrains Runtime to use with JetBrains IDEs. The full list
|
||||
can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases).
|
||||
can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases).
|
||||
|
||||
## Releases based on JDK 17
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|--------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2023.1 | [17.0.6-b829.5](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b829.5) | 01-Mar-2023 |
|
||||
| 2022.3 | [17.0.6-b653.34](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b653.34) | 28-Feb-2023 |
|
||||
| 2022.2 | [17.0.6-b469.82](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b469.82) | 06-Mar-2023 |
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|---------------------------------------------------------------------------------------------|---------------|
|
||||
| 2022.2 | [17.0.3-b469.16](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr17.0.3b469.16)| 28-Jun-2022 |
|
||||
|
||||
## Releases based on JDK 11
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|-------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2022.1 | [11_0_16-b2043.64](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_16b2043.64) | 10-Nov-2022 |
|
||||
| 2022.1 | [11_0_15-b2043.56](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_15b2043.56) | 17-May-2022 |
|
||||
| 2021.3 | [11_0_14_1-b1751.46](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_14_1b1751.46) | 21-Feb-2022 |
|
||||
| 2021.2 | [11_0_13-b1504.49](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jb11_0_13-b1504.49) | 15-Nov-2021 |
|
||||
| 2021.1 | [11.0.11+9-b1341.60](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1248891540)| 15-Jun-2021 |
|
||||
| 2020.3 | [11_0_10-b1145.115](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1249243977) | 21-Jun-2021 |
|
||||
| 2021.1 | [11.0.11+9-b1341.60](https://confluence.jetbrains.com/pages/viewpage.action?pageId=218857477) | 15-Jun-2021 |
|
||||
| 2020.3 | [11_0_11-b1145.115](https://confluence.jetbrains.com/pages/viewpage.action?pageId=219349001) | 21-Jun-2021 |
|
||||
|
||||
## Contents
|
||||
- [Welcome to JetBrains Runtime](#welcome-to-jetbrains-runtime)
|
||||
- [Why Use JetBrains Runtime?](#why-use-jetbrains-runtime)
|
||||
- [Products Built on JetBrains Runtime](#products-built-on-jetbrains-runtime)
|
||||
- [Getting Sources](#getting-sources)
|
||||
- [macOS, Linux](#macos-linux)
|
||||
@@ -53,17 +47,6 @@ can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntim
|
||||
- [Contributing](#contributing)
|
||||
- [Resources](#resources)
|
||||
|
||||
## Why Use JetBrains Runtime?
|
||||
* **Embedded browser**: JetBrains Runtime includes the Java Chromium Embedded Framework ([JCEF](https://github.com/JetBrains/jcef)), which
|
||||
enables you to embed a Chromium-based browsers in your JVM-based application.
|
||||
To use it, [download a build with JCEF](https://github.com/JetBrains/JetBrainsRuntime/releases).
|
||||
* **Enhanced class re-definition** with the [DCEVM](https://ssw.jku.at/dcevm/) technology that makes it easier to reload
|
||||
changed code without restarting JVM; this feature needs to be explicitly enabled with `-XX:+AllowEnhancedClassRedefinition`.
|
||||
* **Better FPS performance** for graphics-intensive applications.
|
||||
* **Improved font rendering**, **keyboard input** (such as shortcuts and multinational keyboards),
|
||||
**HiDPI** and **accessibility** support.
|
||||
* **Robust desktop experience**: GUI-related fixes often reach JetBrains Runtime much earlier than the corresponding version of OpenJDK.
|
||||
|
||||
## Products Built on JetBrains Runtime
|
||||
* [Android Studio](https://developer.android.com/studio). The official IDE for Google's Android operating system.
|
||||
* [CLion](https://www.jetbrains.com/clion/). A cross-platform IDE for C and C++ from JetBrains.
|
||||
@@ -75,7 +58,6 @@ can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntim
|
||||
* [PyCharm](https://www.jetbrains.com/pycharm/). The Python IDE from JetBrains.
|
||||
* [Rider](https://www.jetbrains.com/rider/). The cross-platform .NET IDE from JetBrains.
|
||||
* [RubyMine](https://www.jetbrains.com/ruby/). The Ruby and Rails IDE from JetBrains.
|
||||
* [Toolbox App](https://www.jetbrains.com/toolbox-app/). JetBrains IDE manager.
|
||||
* [WebStorm](https://www.jetbrains.com/webstorm/). The JavaScript IDE from JetBrains.
|
||||
* [YourKit](https://www.yourkit.com/). Java and .NET profilers.
|
||||
|
||||
@@ -84,8 +66,6 @@ can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntim
|
||||
```
|
||||
git config --global core.autocrlf input
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
cd JetBrainsRuntime
|
||||
git checkout jbr21
|
||||
```
|
||||
|
||||
### Windows
|
||||
@@ -93,8 +73,6 @@ git checkout jbr21
|
||||
```
|
||||
git config --global core.autocrlf false
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
cd JetBrainsRuntime
|
||||
git checkout jbr21
|
||||
```
|
||||
|
||||
## Configuring the Build Environment
|
||||
@@ -127,12 +105,12 @@ Install the necessary tools, libraries, and headers with:
|
||||
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev \
|
||||
libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev
|
||||
```
|
||||
Get Java 19 (for instance, [Azul Zulu Builds of OpenJDK 19](https://www.azul.com/downloads/?version=java-19-sts&os=linux&package=jdk)).
|
||||
Get Java 18 (for instance, [Azul Zulu Builds of OpenJDK 18](https://www.azul.com/downloads/?version=java-18-sts&os=linux&package=jdk)).
|
||||
|
||||
Then run the following:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ git checkout jbr-dev
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
@@ -147,7 +125,7 @@ Install the following:
|
||||
* [Visual Studio compiler toolset](https://visualstudio.microsoft.com/downloads/).
|
||||
Install with the desktop development kit, which includes Windows SDK and compilers.
|
||||
Visual Studio 2019 is supported by default.
|
||||
* Java 19 (for instance, [Azul Zulu Builds of OpenJDK 19](https://www.azul.com/downloads/?version=java-19-sts&os=windows&package=jdk)).
|
||||
* Java 18 (for instance, [Azul Zulu Builds of OpenJDK 18](https://www.azul.com/downloads/?version=java-18-sts&os=windows&package=jdk)).
|
||||
If you have problems while configuring, read [Java tips on Cygwin](http://horstmann.com/articles/cygwin-tips.html).
|
||||
|
||||
From the command line:
|
||||
@@ -160,7 +138,7 @@ The first command sets up environment variables, the second starts a Cygwin shel
|
||||
In the Cygwin shell:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ git checkout jbr-dev
|
||||
$ bash configure --with-toolchain-version=2019
|
||||
$ make images
|
||||
```
|
||||
@@ -169,12 +147,12 @@ This will build the release configuration under `./build/windows-x86_64-server-r
|
||||
### macOS
|
||||
Install the following:
|
||||
* Xcode command line developer tools and `autoconf` via [Homebrew](https://brew.sh/).
|
||||
* Java 19 (for instance, [Azul Zulu Builds of OpenJDK 19](https://www.azul.com/downloads/?version=java-19-sts&os=macos&package=jdk)).
|
||||
* Java 18 (for instance, [Azul Zulu Builds of OpenJDK 18](https://www.azul.com/downloads/?version=java-18-sts&os=macos&package=jdk)).
|
||||
|
||||
From the command line:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ git checkout jbr-dev
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
@@ -213,4 +191,3 @@ Before you submit one, please sign our [Contributor License Agreement (CLA)](htt
|
||||
* [JetBrains Runtime on GitHub](https://github.com/JetBrains/JetBrainsRuntime).
|
||||
* [OpenJDK build instructions](https://openjdk.java.net/groups/build/doc/building.html).
|
||||
* [OpenJDK test instructions](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk/master/doc/building.html#running-tests).
|
||||
* [How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
|
||||
|
||||
@@ -114,7 +114,8 @@ cd "$SCRIPT_DIR/.." ; OPENJDK_DIR=`pwd`
|
||||
IDEA_MAKE="$OPENJDK_DIR/make/ide/idea/jdk"
|
||||
IDEA_TEMPLATE="$IDEA_MAKE/template"
|
||||
|
||||
cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
|
||||
cp -rn "$TOPLEVEL_DIR/jb/project/idea-project-files"/* "$IDEA_OUTPUT"
|
||||
cp -rn "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
|
||||
|
||||
#override template
|
||||
if [ -d "$TEMPLATES_OVERRIDE" ] ; then
|
||||
|
||||
45
bin/jib.sh
45
bin/jib.sh
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -128,15 +128,6 @@ install_jib() {
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# Want to check the filetype using file, to see if we got served a HTML error page.
|
||||
# This is sensitive to the filename containing a specific string, but good enough.
|
||||
file "${installed_jib_script}.gz" | grep "gzip compressed data" > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Warning: ${installed_jib_script}.gz is not a gzip file."
|
||||
echo "If you are behind a proxy you may need to configure exceptions using no_proxy."
|
||||
echo "The download URL was: ${jib_url}"
|
||||
exit 1
|
||||
fi
|
||||
echo "Extracting JIB bootstrap script"
|
||||
rm -f "${installed_jib_script}"
|
||||
gunzip "${installed_jib_script}.gz"
|
||||
@@ -144,28 +135,6 @@ install_jib() {
|
||||
echo "${data_string}" > "${install_data}"
|
||||
}
|
||||
|
||||
# Returns a shell-escaped version of the argument given.
|
||||
shell_quote() {
|
||||
if [[ -n "$1" ]]; then
|
||||
# Uses only shell-safe characters? No quoting needed.
|
||||
# '=' is a zsh meta-character, but only in word-initial position.
|
||||
if echo "$1" | grep '^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\.:,%/+=_-]\{1,\}$' > /dev/null \
|
||||
&& ! echo "$1" | grep '^=' > /dev/null; then
|
||||
quoted="$1"
|
||||
else
|
||||
if echo "$1" | grep "[\'!]" > /dev/null; then
|
||||
# csh does history expansion within single quotes, but not
|
||||
# when backslash-escaped!
|
||||
local quoted_quote="'\\''" quoted_exclam="'\\!'"
|
||||
word="${1//\'/${quoted_quote}}"
|
||||
word="${1//\!/${quoted_exclam}}"
|
||||
fi
|
||||
quoted="'$1'"
|
||||
fi
|
||||
echo "$quoted"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main body starts here
|
||||
|
||||
setup_url
|
||||
@@ -182,16 +151,4 @@ if [ -z "${JIB_SRC_DIR}" ]; then
|
||||
export JIB_SRC_DIR="${mydir}/../"
|
||||
fi
|
||||
|
||||
|
||||
# Save the original command line
|
||||
conf_quoted_arguments=()
|
||||
for conf_option; do
|
||||
conf_quoted_arguments=("${conf_quoted_arguments[@]}" "$(shell_quote "$conf_option")")
|
||||
done
|
||||
export REAL_CONFIGURE_COMMAND_LINE="${conf_quoted_arguments[@]}"
|
||||
|
||||
myfulldir="$(cd "${mydir}" > /dev/null && pwd)"
|
||||
export REAL_CONFIGURE_COMMAND_EXEC_FULL="$BASH $myfulldir/$myname"
|
||||
export REAL_CONFIGURE_COMMAND_EXEC_SHORT="$myname"
|
||||
|
||||
${installed_jib_script} "$@"
|
||||
|
||||
2425
doc/building.html
2425
doc/building.html
File diff suppressed because it is too large
Load Diff
278
doc/building.md
278
doc/building.md
@@ -7,7 +7,7 @@ the time. They assume that you have installed Git (and Cygwin if running
|
||||
on Windows) and cloned the top-level JDK repository that you want to build.
|
||||
|
||||
1. [Get the complete source code](#getting-the-source-code): \
|
||||
`git clone https://git.openjdk.org/jdk/`
|
||||
`git clone https://git.openjdk.java.net/jdk/`
|
||||
|
||||
2. [Run configure](#running-configure): \
|
||||
`bash configure`
|
||||
@@ -40,14 +40,14 @@ reasonably powerful hardware.
|
||||
|
||||
If you just want to use the JDK and not build it yourself, this document is not
|
||||
for you. See for instance [OpenJDK installation](
|
||||
http://openjdk.org/install) for some methods of installing a prebuilt
|
||||
http://openjdk.java.net/install) for some methods of installing a prebuilt
|
||||
JDK.
|
||||
|
||||
## Getting the Source Code
|
||||
|
||||
Make sure you are getting the correct version. As of JDK 10, the source is no
|
||||
longer split into separate repositories so you only need to clone one single
|
||||
repository. At the [OpenJDK Git site](https://git.openjdk.org/) you
|
||||
repository. At the [OpenJDK Git site](https://git.openjdk.java.net/) you
|
||||
can see a list of all available repositories. If you want to build an older version,
|
||||
e.g. JDK 11, it is recommended that you get the `jdk11u` repo, which contains
|
||||
incremental updates, instead of the `jdk11` repo, which was frozen at JDK 11 GA.
|
||||
@@ -96,7 +96,7 @@ on where and how to check out the source code.
|
||||
Cygwin paths (which are used throughout the JDK build system).
|
||||
However, it does not currently work well with the Skara CLI tooling.
|
||||
Please see the [Skara wiki on Git clients](
|
||||
https://wiki.openjdk.org/display/SKARA/Skara#Skara-Git) for
|
||||
https://wiki.openjdk.java.net/display/SKARA/Skara#Skara-Git) for
|
||||
up-to-date information about the Skara git client support.
|
||||
|
||||
* The [Git for Windows](https://gitforwindows.org) client has issues
|
||||
@@ -126,8 +126,6 @@ space is required.
|
||||
Even for 32-bit builds, it is recommended to use a 64-bit build machine, and
|
||||
instead create a 32-bit target using `--with-target-bits=32`.
|
||||
|
||||
Note: The Windows 32-bit x86 port is deprecated and may be removed in a future release.
|
||||
|
||||
### Building on aarch64
|
||||
|
||||
At a minimum, a machine with 8 cores is advisable, as well as 8 GB of RAM.
|
||||
@@ -164,18 +162,18 @@ This table lists the OS versions used by Oracle when building the JDK. Such
|
||||
information is always subject to change, but this table is up to date at the
|
||||
time of writing.
|
||||
|
||||
| Operating system | Vendor/version used |
|
||||
| ----------------- | ---------------------------------- |
|
||||
| Linux | Oracle Enterprise Linux 6.4 / 7.6 |
|
||||
| macOS | Mac OS X 10.13 (High Sierra) |
|
||||
| Windows | Windows Server 2012 R2 |
|
||||
Operating system Vendor/version used
|
||||
----------------- -------------------------------------------------------
|
||||
Linux Oracle Enterprise Linux 6.4 / 7.6
|
||||
macOS Mac OS X 10.13 (High Sierra)
|
||||
Windows Windows Server 2012 R2
|
||||
|
||||
The double version numbers for Linux are due to the hybrid model
|
||||
used at Oracle, where header files and external libraries from an older version
|
||||
are used when building on a more modern version of the OS.
|
||||
|
||||
The Build Group has a wiki page with [Supported Build Platforms](
|
||||
https://wiki.openjdk.org/display/Build/Supported+Build+Platforms). From
|
||||
https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms). From
|
||||
time to time, this is updated by contributors to list successes or failures of
|
||||
building on different platforms.
|
||||
|
||||
@@ -201,8 +199,6 @@ rule also applies to input to the build system, e.g. in arguments to
|
||||
`--with-msvcr-dll=c:\msvcr100.dll`. For details on this conversion, see the section
|
||||
on [Fixpath](#fixpath).
|
||||
|
||||
Note: The Windows 32-bit x86 port is deprecated and may be removed in a future release.
|
||||
|
||||
#### Cygwin
|
||||
|
||||
A functioning [Cygwin](http://www.cygwin.com/) environment is required for
|
||||
@@ -307,7 +303,7 @@ sudo apk add build-base bash grep zip
|
||||
### AIX
|
||||
|
||||
Please consult the AIX section of the [Supported Build Platforms](
|
||||
https://wiki.openjdk.org/display/Build/Supported+Build+Platforms) OpenJDK
|
||||
https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms) OpenJDK
|
||||
Build Wiki page for details about which versions of AIX are supported.
|
||||
|
||||
## Native Compiler (Toolchain) Requirements
|
||||
@@ -315,17 +311,14 @@ Build Wiki page for details about which versions of AIX are supported.
|
||||
Large portions of the JDK consists of native code, that needs to be compiled to
|
||||
be able to run on the target platform. In theory, toolchain and operating
|
||||
system should be independent factors, but in practice there's more or less a
|
||||
one-to-one correlation between target operating system and toolchain. There are
|
||||
ongoing efforts to loosen this strict coupling between compiler and operating
|
||||
system (see [JDK-8288293](https://bugs.openjdk.org/browse/JDK-8288293)) but it
|
||||
will likely be a very long time before this goal can be realized.
|
||||
one-to-one correlation between target operating system and toolchain.
|
||||
|
||||
| Operating system | Supported toolchain |
|
||||
| ------------------ | ------------------------- |
|
||||
| Linux | gcc, clang |
|
||||
| macOS | Apple Xcode (using clang) |
|
||||
| AIX | IBM XL C/C++ |
|
||||
| Windows | Microsoft Visual Studio |
|
||||
Operating system Supported toolchain
|
||||
------------------ -------------------------
|
||||
Linux gcc, clang
|
||||
macOS Apple Xcode (using clang)
|
||||
AIX IBM XL C/C++
|
||||
Windows Microsoft Visual Studio
|
||||
|
||||
Please see the individual sections on the toolchains for version
|
||||
recommendations. As a reference, these versions of the toolchains are used, at
|
||||
@@ -334,11 +327,11 @@ possible to compile the JDK with both older and newer versions, but the closer
|
||||
you stay to this list, the more likely you are to compile successfully without
|
||||
issues.
|
||||
|
||||
| Operating system | Toolchain version |
|
||||
| ------------------ | ------------------------------------------ |
|
||||
| Linux | gcc 11.2.0 |
|
||||
| macOS | Apple Xcode 10.1 (using clang 10.0.0) |
|
||||
| Windows | Microsoft Visual Studio 2022 update 17.1.0 |
|
||||
Operating system Toolchain version
|
||||
------------------ -------------------------------------------------------
|
||||
Linux gcc 11.2.0
|
||||
macOS Apple Xcode 10.1 (using clang 10.0.0)
|
||||
Windows Microsoft Visual Studio 2022 update 17.1.0
|
||||
|
||||
All compilers are expected to be able to compile to the C99 language standard,
|
||||
as some C99 features are used in the source code. Microsoft Visual Studio
|
||||
@@ -366,20 +359,20 @@ To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.
|
||||
|
||||
The oldest supported version of Xcode is 8.
|
||||
|
||||
You will need the Xcode command line developer tools to be able to build
|
||||
the JDK. (Actually, *only* the command line tools are needed, not the IDE.)
|
||||
You will need the Xcode command lines developers tools to be able to build
|
||||
the JDK. (Actually, *only* the command lines tools are needed, not the IDE.)
|
||||
The simplest way to install these is to run:
|
||||
```
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
When updating Xcode, it is advisable to keep an older version for building the JDK.
|
||||
To use a specific version of Xcode you have multiple options:
|
||||
|
||||
* Use `xcode-select -s` before running `configure`, e.g. `xcode-select -s /Applications/Xcode13.1.app`. The drawback is that the setting
|
||||
is system wide and you may have to revert it after an OpenJDK build.
|
||||
* Use configure option `--with-xcode-path`, e.g. `configure --with-xcode-path=/Applications/Xcode13.1.app`
|
||||
This allows using a specific Xcode version for an OpenJDK build, independently of the active Xcode version by `xcode-select`.
|
||||
It is advisable to keep an older version of Xcode for building the JDK when
|
||||
updating Xcode. This [blog page](
|
||||
http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html) has
|
||||
good suggestions on managing multiple Xcode versions. To use a specific version
|
||||
of Xcode, use `xcode-select -s` before running `configure`, or use
|
||||
`--with-toolchain-path` to point to the version of Xcode to use, e.g.
|
||||
`configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin`
|
||||
|
||||
If you have recently (inadvertently) updated your OS and/or Xcode version, and
|
||||
the JDK can no longer be built, please see the section on [Problems with the
|
||||
@@ -389,14 +382,14 @@ available for this update.
|
||||
|
||||
### Microsoft Visual Studio
|
||||
|
||||
The minimum accepted version is Visual Studio 2019 version 16.8. (Note that this
|
||||
version is often presented as "MSVC 14.28", and reported by cl.exe as 19.28.)
|
||||
Older versions will not be accepted by `configure` and will not work. The
|
||||
maximum accepted version of Visual Studio is 2022.
|
||||
For aarch64 machines running Windows the minimum accepted version is Visual Studio 2019
|
||||
(16.8 or higher). For all other platforms the minimum accepted version of
|
||||
Visual Studio is 2017. Older versions will not be accepted by `configure` and will
|
||||
not work. For all platforms the maximum accepted version of Visual Studio is 2022.
|
||||
|
||||
If you have multiple versions of Visual Studio installed, `configure` will by
|
||||
default pick the latest. You can request a specific version to be used by
|
||||
setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2022`.
|
||||
setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2017`.
|
||||
|
||||
If you have Visual Studio installed but `configure` fails to detect it, it may
|
||||
be because of [spaces in path](#spaces-in-path).
|
||||
@@ -404,7 +397,7 @@ be because of [spaces in path](#spaces-in-path).
|
||||
### IBM XL C/C++
|
||||
|
||||
Please consult the AIX section of the [Supported Build Platforms](
|
||||
https://wiki.openjdk.org/display/Build/Supported+Build+Platforms) OpenJDK
|
||||
https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms) OpenJDK
|
||||
Build Wiki page for details about which versions of XLC are supported.
|
||||
|
||||
|
||||
@@ -475,19 +468,6 @@ rather than bundling the JDK's own copy.
|
||||
Use `--with-freetype-include=<path>` and `--with-freetype-lib=<path>`
|
||||
if `configure` does not automatically locate the platform FreeType files.
|
||||
|
||||
### Fontconfig
|
||||
|
||||
Fontconfig from [freedesktop.org Fontconfig](http://fontconfig.org) is required
|
||||
on all platforms except Windows and macOS.
|
||||
|
||||
* To install on an apt-based Linux, try running `sudo apt-get install
|
||||
libfontconfig-dev`.
|
||||
* To install on an rpm-based Linux, try running `sudo yum install
|
||||
fontconfig-devel`.
|
||||
|
||||
Use `--with-fontconfig-include=<path>` and `--with-fontconfig=<path>`
|
||||
if `configure` does not automatically locate the platform Fontconfig files.
|
||||
|
||||
### CUPS
|
||||
|
||||
CUPS, [Common UNIX Printing System](http://www.cups.org) header files are
|
||||
@@ -868,27 +848,26 @@ Suggestions for Advanced Users](#hints-and-suggestions-for-advanced-users) and
|
||||
|
||||
## Running Tests
|
||||
|
||||
Most of the JDK tests are using the [JTReg](http://openjdk.org/jtreg)
|
||||
Most of the JDK tests are using the [JTReg](http://openjdk.java.net/jtreg)
|
||||
test framework. Make sure that your configuration knows where to find your
|
||||
installation of JTReg. If this is not picked up automatically, use the
|
||||
`--with-jtreg=<path to jtreg home>` option to point to the JTReg framework.
|
||||
Note that this option should point to the JTReg home, i.e. the top directory,
|
||||
containing `lib/jtreg.jar` etc.
|
||||
|
||||
The [Adoption Group](https://wiki.openjdk.org/display/Adoption) provides
|
||||
The [Adoption Group](https://wiki.openjdk.java.net/display/Adoption) provides
|
||||
recent builds of jtreg [here](
|
||||
https://ci.adoptium.net/view/Dependencies/job/dependency_pipeline/lastSuccessfulBuild/artifact/jtreg/).
|
||||
https://ci.adoptopenjdk.net/view/Dependencies/job/dependency_pipeline/lastSuccessfulBuild/artifact/jtreg/).
|
||||
Download the latest `.tar.gz` file, unpack it, and point `--with-jtreg` to the
|
||||
`jtreg` directory that you just unpacked.
|
||||
|
||||
Building of Hotspot Gtest suite requires the source code of Google
|
||||
Test framework. The top directory, which contains both `googletest`
|
||||
and `googlemock` directories, should be specified via `--with-gtest`.
|
||||
The minimum supported version of Google Test is 1.13.0, whose source
|
||||
code can be obtained:
|
||||
Building of Hotspot Gtest suite requires the source code of Google Test framework.
|
||||
The top directory, which contains both `googletest` and `googlemock`
|
||||
directories, should be specified via `--with-gtest`.
|
||||
The supported version of Google Test is 1.8.1, whose source code can be obtained:
|
||||
|
||||
* by downloading and unpacking the source bundle from [here](https://github.com/google/googletest/releases/tag/v1.13.0)
|
||||
* or by checking out `v1.13.0` tag of `googletest` project: `git clone -b v1.13.0 https://github.com/google/googletest`
|
||||
* by downloading and unpacking the source bundle from [here](https://github.com/google/googletest/releases/tag/release-1.8.1)
|
||||
* or by checking out `release-1.8.1` tag of `googletest` project: `git clone -b release-1.8.1 https://github.com/google/googletest`
|
||||
|
||||
To execute the most basic tests (tier 1), use:
|
||||
```
|
||||
@@ -898,42 +877,6 @@ make run-test-tier1
|
||||
For more details on how to run tests, please see **Testing the JDK**
|
||||
([html](testing.html), [markdown](testing.md)).
|
||||
|
||||
## Signing
|
||||
|
||||
### macOS
|
||||
|
||||
Modern versions of macOS require applications to be signed and notarizied before
|
||||
distribution. See Apple's documentation for more background on what this means
|
||||
and how it works. To help support this, the JDK build can be configured to
|
||||
automatically sign all native binaries, and the JDK bundle, with all the options
|
||||
needed for successful notarization, as well as all the entitlements required by
|
||||
the JDK. To enable `hardened` signing, use configure parameter
|
||||
`--with-macosx-codesign=hardened` and configure the signing identity you wish to
|
||||
use with `--with-macosx-codesign-identity=<identity>`. The identity refers to a
|
||||
signing identity from Apple that needs to be preinstalled on the build host.
|
||||
|
||||
When not signing for distribution with the hardened option, the JDK build will
|
||||
still attempt to perform `adhoc` signing to add the special entitlement
|
||||
`com.apple.security.get-task-allow` to each binary. This entitlement is required
|
||||
to be able to dump core files from a process. Note that adding this entitlement
|
||||
makes the build invalid for notarization, so it is only added when signing in
|
||||
`debug` mode. To explicitly enable this kind of adhoc signing, use configure
|
||||
parameter `--with-macosx-codesign=debug`. It will be enabled by default in most
|
||||
cases.
|
||||
|
||||
It's also possible to completely disable any explicit codesign operations done
|
||||
by the JDK build using the configure parameter `--without-macosx-codesign`.
|
||||
The exact behavior then depends on the architecture. For macOS on x64, it (at
|
||||
least at the time of this writing) results in completely unsigned binaries that
|
||||
should still work fine for development and debugging purposes. On aarch64, the
|
||||
Xcode linker will apply a default "adhoc" signing, without any entitlements.
|
||||
Such a build does not allow dumping core files.
|
||||
|
||||
The default mode "auto" will try for `hardened` signing if the debug level is
|
||||
`release` and either the default identity or the specified identity is valid.
|
||||
If hardened isn't possible, then `debug` signing is chosen if it works. If
|
||||
nothing works, the codesign build step is disabled.
|
||||
|
||||
## Cross-compiling
|
||||
|
||||
Cross-compiling means using one platform (the *build* platform) to generate
|
||||
@@ -987,14 +930,14 @@ https://sourceware.org/autobook/autobook/autobook_17.html). If no
|
||||
targets are given, a native toolchain for the current platform will be
|
||||
created. Currently, at least the following targets are known to work:
|
||||
|
||||
| Supported devkit targets |
|
||||
| ------------------------ |
|
||||
| x86_64-linux-gnu |
|
||||
| aarch64-linux-gnu |
|
||||
| arm-linux-gnueabihf |
|
||||
| ppc64-linux-gnu |
|
||||
| ppc64le-linux-gnu |
|
||||
| s390x-linux-gnu |
|
||||
Supported devkit targets
|
||||
-------------------------
|
||||
x86_64-linux-gnu
|
||||
aarch64-linux-gnu
|
||||
arm-linux-gnueabihf
|
||||
ppc64-linux-gnu
|
||||
ppc64le-linux-gnu
|
||||
s390x-linux-gnu
|
||||
|
||||
`BASE_OS` must be one of "OEL6" for Oracle Enterprise Linux 6 or
|
||||
"Fedora" (if not specified "OEL6" will be the default). If the base OS
|
||||
@@ -1164,7 +1107,7 @@ Note that X11 is needed even if you only want to build a headless JDK.
|
||||
### Cross compiling with Debian sysroots
|
||||
|
||||
Fortunately, you can create sysroots for foreign architectures with tools
|
||||
provided by your OS. On Debian/Ubuntu systems, one could use `debootstrap` to
|
||||
provided by your OS. On Debian/Ubuntu systems, one could use `qemu-deboostrap` to
|
||||
create the *target* system chroot, which would have the native libraries and headers
|
||||
specific to that *target* system. After that, we can use the cross-compiler on the *build*
|
||||
system, pointing into chroot to get the build dependencies right. This allows building
|
||||
@@ -1179,7 +1122,7 @@ For example, cross-compiling to AArch64 from x86_64 could be done like this:
|
||||
|
||||
* Create chroot on the *build* system, configuring it for *target* system:
|
||||
```
|
||||
sudo debootstrap \
|
||||
sudo qemu-debootstrap \
|
||||
--arch=arm64 \
|
||||
--verbose \
|
||||
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev,libffi-dev \
|
||||
@@ -1187,8 +1130,6 @@ For example, cross-compiling to AArch64 from x86_64 could be done like this:
|
||||
buster \
|
||||
~/sysroot-arm64 \
|
||||
http://httpredir.debian.org/debian/
|
||||
# If the target architecture is `riscv64`,
|
||||
# the path should be `debian-ports` instead of `debian`.
|
||||
```
|
||||
|
||||
* Make sure the symlinks inside the newly created chroot point to proper locations:
|
||||
@@ -1221,22 +1162,21 @@ it might require a little nudge with:
|
||||
|
||||
Architectures that are known to successfully cross-compile like this are:
|
||||
|
||||
| Target | Debian tree | Debian arch | `--openjdk-target=...` | `--with-jvm-variants=...` |
|
||||
| ------------ | ------------ | ------------- | ------------------------ | ------------------------- |
|
||||
| x86 | buster | i386 | i386-linux-gnu | (all) |
|
||||
| arm | buster | armhf | arm-linux-gnueabihf | (all) |
|
||||
| aarch64 | buster | arm64 | aarch64-linux-gnu | (all) |
|
||||
| ppc64le | buster | ppc64el | powerpc64le-linux-gnu | (all) |
|
||||
| s390x | buster | s390x | s390x-linux-gnu | (all) |
|
||||
| mipsle | buster | mipsel | mipsel-linux-gnu | zero |
|
||||
| mips64le | buster | mips64el | mips64el-linux-gnueabi64 | zero |
|
||||
| armel | buster | arm | arm-linux-gnueabi | zero |
|
||||
| ppc | sid | powerpc | powerpc-linux-gnu | zero |
|
||||
| ppc64be | sid | ppc64 | powerpc64-linux-gnu | (all) |
|
||||
| m68k | sid | m68k | m68k-linux-gnu | zero |
|
||||
| alpha | sid | alpha | alpha-linux-gnu | zero |
|
||||
| sh4 | sid | sh4 | sh4-linux-gnu | zero |
|
||||
| riscv64 | sid | riscv64 | riscv64-linux-gnu | (all) |
|
||||
Target Debian tree Debian arch `--openjdk-target=...` `--with-jvm-variants=...`
|
||||
------------ ------------ ------------- ------------------------ --------------
|
||||
x86 buster i386 i386-linux-gnu (all)
|
||||
arm buster armhf arm-linux-gnueabihf (all)
|
||||
aarch64 buster arm64 aarch64-linux-gnu (all)
|
||||
ppc64le buster ppc64el powerpc64le-linux-gnu (all)
|
||||
s390x buster s390x s390x-linux-gnu (all)
|
||||
mipsle buster mipsel mipsel-linux-gnu zero
|
||||
mips64le buster mips64el mips64el-linux-gnueabi64 zero
|
||||
armel buster arm arm-linux-gnueabi zero
|
||||
ppc sid powerpc powerpc-linux-gnu zero
|
||||
ppc64be sid ppc64 powerpc64-linux-gnu (all)
|
||||
m68k sid m68k m68k-linux-gnu zero
|
||||
alpha sid alpha alpha-linux-gnu zero
|
||||
sh4 sid sh4 sh4-linux-gnu zero
|
||||
|
||||
### Building for ARM/aarch64
|
||||
|
||||
@@ -1246,44 +1186,6 @@ available using `--with-abi-profile`: arm-vfp-sflt, arm-vfp-hflt, arm-sflt,
|
||||
armv5-vfp-sflt, armv6-vfp-hflt. Note that soft-float ABIs are no longer
|
||||
properly supported by the JDK.
|
||||
|
||||
### Building for RISC-V
|
||||
|
||||
The RISC-V community provides a basic
|
||||
[GNU compiler toolchain](https://github.com/riscv-collab/riscv-gnu-toolchain),
|
||||
but the [external libraries](#External-Library-Requirements) required by OpenJDK
|
||||
complicate the building process. The placeholder `<toolchain-installed-path>`
|
||||
shown below is the path where you want to install the toolchain.
|
||||
|
||||
* Install the RISC-V GNU compiler toolchain:
|
||||
```
|
||||
git clone --recursive https://github.com/riscv-collab/riscv-gnu-toolchain
|
||||
cd riscv-gnu-toolchain
|
||||
./configure --prefix=<toolchain-installed-path>
|
||||
make linux
|
||||
export PATH=<toolchain-installed-path>/bin:$PATH
|
||||
```
|
||||
|
||||
* Cross-compile all the required libraries:
|
||||
```
|
||||
# An example for libffi
|
||||
git clone https://github.com/libffi/libffi
|
||||
cd libffi
|
||||
./configure --host=riscv64-unknown-linux-gnu --prefix=<toolchain-installed-path>/sysroot/usr
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
* Configure and build OpenJDK:
|
||||
```
|
||||
bash configure \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--openjdk-target=riscv64-linux-gnu \
|
||||
--with-sysroot=<toolchain-installed-path>/sysroot \
|
||||
--with-toolchain-path=<toolchain-installed-path>/bin \
|
||||
--with-extra-path=<toolchain-installed-path>/bin
|
||||
make images
|
||||
```
|
||||
|
||||
### Building for musl
|
||||
|
||||
Just like it's possible to cross-compile for a different CPU, it's possible to
|
||||
@@ -1392,12 +1294,12 @@ it.
|
||||
To use, setup an icecc network, and install icecc on the build machine. Then
|
||||
run `configure` using `--enable-icecc`.
|
||||
|
||||
### Using the javac server
|
||||
### Using sjavac
|
||||
|
||||
To speed up compilation of Java code, especially during incremental
|
||||
compilations, the javac server is automatically enabled in the configuration
|
||||
step by default. To explicitly enable or disable the javac server, use either
|
||||
`--enable-javac-server` or `--disable-javac-server`.
|
||||
To speed up compilation of Java code, especially during incremental compilations,
|
||||
the sjavac server is automatically enabled in the configuration step by default.
|
||||
To explicitly enable or disable sjavac, use either `--enable-javac-server`
|
||||
or `--disable-javac-server`.
|
||||
|
||||
### Building the Right Target
|
||||
|
||||
@@ -1610,7 +1512,7 @@ You can run `fsutil file setshortname` in `cmd` on certain directories, such as
|
||||
|
||||
If none of the suggestions in this document helps you, or if you find what you
|
||||
believe is a bug in the build system, please contact the Build Group by sending
|
||||
a mail to [build-dev@openjdk.org](mailto:build-dev@openjdk.org).
|
||||
a mail to [build-dev@openjdk.java.net](mailto:build-dev@openjdk.java.net).
|
||||
Please include the relevant parts of the configure and/or build log.
|
||||
|
||||
If you need general help or advice about developing for the JDK, you can also
|
||||
@@ -1657,9 +1559,9 @@ make
|
||||
|
||||
Note that regardless if you specify a source date for `configure` or not, the
|
||||
JDK build system will set `SOURCE_DATE_EPOCH` for all build tools when building.
|
||||
If `--with-source-date` has the value `current` (which is the default unless
|
||||
If `--with-source-date` has the value `updated` (which is the default unless
|
||||
`SOURCE_DATE_EPOCH` is found by in the environment by `configure`), the source
|
||||
date value will be determined at configure time.
|
||||
date value will be determined at build time.
|
||||
|
||||
There are several aspects of reproducible builds that can be individually
|
||||
adjusted by `configure` arguments. If any of these are given, they will override
|
||||
@@ -1680,7 +1582,7 @@ the value derived from `SOURCE_DATE_EPOCH`. These arguments are:
|
||||
|
||||
When `SOURCE_DATE_EPOCH` is set, the default value for `--with-source-date`
|
||||
will be the value given by `SOURCE_DATE_EPOCH`. Otherwise, the default value
|
||||
is `current`.
|
||||
is `updated`.
|
||||
|
||||
* `--with-hotspot-build-time`
|
||||
|
||||
@@ -2020,7 +1922,7 @@ To analyze build performance, run with `LOG=trace` and check `$BUILD/build-trace
|
||||
Use `JOBS=1` to avoid parallelism.
|
||||
|
||||
Please check that you adhere to the [Code Conventions for the Build System](
|
||||
http://openjdk.org/groups/build/doc/code-conventions.html) before
|
||||
http://openjdk.java.net/groups/build/doc/code-conventions.html) before
|
||||
submitting patches.
|
||||
|
||||
## Contributing to the JDK
|
||||
@@ -2033,25 +1935,19 @@ However, please bear in mind that the JDK is a massive project, and we must ask
|
||||
you to follow our rules and guidelines to be able to accept your contribution.
|
||||
|
||||
The official place to start is the ['How to contribute' page](
|
||||
http://openjdk.org/contribute/). There is also an official (but somewhat
|
||||
http://openjdk.java.net/contribute/). There is also an official (but somewhat
|
||||
outdated and skimpy on details) [Developer's Guide](
|
||||
http://openjdk.org/guide/).
|
||||
http://openjdk.java.net/guide/).
|
||||
|
||||
If this seems overwhelming to you, the Adoption Group is there to help you! A
|
||||
good place to start is their ['New Contributor' page](
|
||||
https://wiki.openjdk.org/display/Adoption/New+Contributor), or start
|
||||
https://wiki.openjdk.java.net/display/Adoption/New+Contributor), or start
|
||||
reading the comprehensive [Getting Started Kit](
|
||||
https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-started-kit/en/). The
|
||||
Adoption Group will also happily answer any questions you have about
|
||||
contributing. Contact them by [mail](
|
||||
http://mail.openjdk.org/mailman/listinfo/adoption-discuss) or [IRC](
|
||||
http://openjdk.org/irc/).
|
||||
|
||||
## Editing this document
|
||||
|
||||
If you want to contribute changes to this document, edit `doc/building.md` and
|
||||
then run `make update-build-docs` to generate the same changes in
|
||||
`doc/building.html`.
|
||||
http://mail.openjdk.java.net/mailman/listinfo/adoption-discuss) or [IRC](
|
||||
http://openjdk.java.net/irc/).
|
||||
|
||||
---
|
||||
# Override styles from the base CSS file that are not ideal for this document.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -55,13 +55,13 @@ suburbs of Rome the rules are a little different; these differences
|
||||
can be pointed out here.
|
||||
|
||||
Proposed changes should be discussed on the
|
||||
[HotSpot Developers](mailto:hotspot-dev@openjdk.org) mailing
|
||||
[HotSpot Developers](mailto:hotspot-dev@openjdk.java.net) mailing
|
||||
list. Changes are likely to be cautious and incremental, since HotSpot
|
||||
coders have been using these guidelines for years.
|
||||
|
||||
Substantive changes are approved by
|
||||
[rough consensus](https://www.rfc-editor.org/rfc/rfc7282.html) of
|
||||
the [HotSpot Group](https://openjdk.org/census#hotspot) Members.
|
||||
the [HotSpot Group](https://openjdk.java.net/census#hotspot) Members.
|
||||
The Group Lead determines whether consensus has been reached.
|
||||
|
||||
Editorial changes (changes that only affect the description of HotSpot
|
||||
@@ -550,7 +550,7 @@ turned off. Many Standard Library facilities implicitly or explicitly
|
||||
use exceptions.
|
||||
|
||||
* `assert`. An issue that is quickly encountered is the `assert` macro name
|
||||
collision ([JDK-8007770](https://bugs.openjdk.org/browse/JDK-8007770)).
|
||||
collision ([JDK-8007770](https://bugs.openjdk.java.net/browse/JDK-8007770)).
|
||||
Some mechanism for addressing this would be needed before much of the
|
||||
Standard Library could be used. (Not all Standard Library implementations
|
||||
use assert in header files, but some do.)
|
||||
@@ -572,12 +572,8 @@ There are a few exceptions to this rule.
|
||||
|
||||
* `#include <new>` to use placement `new`, `std::nothrow`, and `std::nothrow_t`.
|
||||
* `#include <limits>` to use `std::numeric_limits`.
|
||||
* `#include <type_traits>` with some restrictions, listed below.
|
||||
* `#include <cstddef>` to use `std::nullptr_t` and `std::max_align_t`.
|
||||
|
||||
Certain restrictions apply to the declarations provided by `<type_traits>`.
|
||||
|
||||
* The `alignof` operator should be used rather than `std::alignment_of<>`.
|
||||
* `#include <type_traits>`.
|
||||
* `#include <cstddef>` to use `std::nullptr_t`.
|
||||
|
||||
TODO: Rather than directly \#including (permitted) Standard Library
|
||||
headers, use a convention of \#including wrapper headers (in some
|
||||
@@ -655,51 +651,6 @@ constant members. Compilers having such bugs are no longer supported.
|
||||
Except where an enum is semantically appropriate, new code should use
|
||||
integral constants.
|
||||
|
||||
### alignas
|
||||
|
||||
_Alignment-specifiers_ (`alignas`
|
||||
[n2341](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf))
|
||||
are permitted, with restrictions.
|
||||
|
||||
_Alignment-specifiers_ are permitted when the requested alignment is a
|
||||
_fundamental alignment_ (not greater than `alignof(std::max_align_t)`
|
||||
[C++14 3.11/2](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
|
||||
|
||||
_Alignment-specifiers_ with an _extended alignment_ (greater than
|
||||
`alignof(std::max_align_t)`
|
||||
[C++14 3.11/3](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf))
|
||||
may only be used to align variables with static or automatic storage duration
|
||||
([C++14 3.7.1, 3.7.3](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
|
||||
As a consequence, _over-aligned types_ are forbidden; this may change if
|
||||
HotSpot updates to using C++17 or later
|
||||
([p0035r4](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0035r4.html)).
|
||||
|
||||
Large _extended alignments_ should be avoided, particularly for stack
|
||||
allocated objects. What is a large value may depend on the platform and
|
||||
configuration. There may also be hard limits for some platforms.
|
||||
|
||||
An _alignment-specifier_ must always be applied to a definition
|
||||
([C++14 10.6.2/6](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
|
||||
(C++ allows an _alignment-specifier_ to optionally also be applied to a
|
||||
declaration, so long as the definition has equivalent alignment. There isn't
|
||||
any known benefit from duplicating the alignment in a non-definition
|
||||
declaration, so such duplication should be avoided in HotSpot code.)
|
||||
|
||||
Enumerations are forbidden from having _alignment-specifiers_. Aligned
|
||||
enumerations were originally permitted but insufficiently specified, and were
|
||||
later (C++20) removed
|
||||
([CWG 2354](https://cplusplus.github.io/CWG/issues/2354.html)).
|
||||
Permitting such usage in HotSpot now would just cause problems in the future.
|
||||
|
||||
_Alignment-specifiers_ are forbidden in `typedef` and _alias-declarations_.
|
||||
This may work or may have worked in some versions of some compilers, but was
|
||||
later (C++14) explicitly disallowed
|
||||
([CWG 1437](https://cplusplus.github.io/CWG/issues/1437.html)).
|
||||
|
||||
The HotSpot macro `ATTRIBUTE_ALIGNED` provides similar capabilities for
|
||||
platforms that define it. This macro predates the use by HotSpot of C++
|
||||
versions providing `alignas`. New code should use `alignas`.
|
||||
|
||||
### thread_local
|
||||
|
||||
Avoid use of `thread_local`
|
||||
@@ -710,7 +661,7 @@ be a constant expression. When `thread_local` must be used, use the Hotspot macr
|
||||
consideration.
|
||||
|
||||
As was discussed in the review for
|
||||
[JDK-8230877](https://mail.openjdk.org/pipermail/hotspot-dev/2019-September/039487.html),
|
||||
[JDK-8230877](https://mail.openjdk.java.net/pipermail/hotspot-dev/2019-September/039487.html),
|
||||
`thread_local` allows dynamic initialization and destruction
|
||||
semantics. However, that support requires a run-time penalty for
|
||||
references to non-function-local `thread_local` variables defined in a
|
||||
@@ -720,7 +671,7 @@ non-local `thread_local` variables also has the same ordering
|
||||
problems as for ordinary non-local variables. So we avoid use of
|
||||
`thread_local` in general, limiting its use to only those cases where dynamic
|
||||
initialization or destruction are essential. See
|
||||
[JDK-8282469](https://bugs.openjdk.org/browse/JDK-8282469)
|
||||
[JDK-8282469](https://bugs.openjdk.java.net/browse/JDK-8282469)
|
||||
for further discussion.
|
||||
|
||||
### nullptr
|
||||
@@ -1058,37 +1009,8 @@ and other supported compilers may not have anything similar.
|
||||
[p0136r1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0136r1.html
|
||||
"p0136r1"
|
||||
|
||||
### Attributes
|
||||
|
||||
The use of some attributes
|
||||
([n2761](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf))
|
||||
(listed below) is permitted. (Note that some of the attributes defined in
|
||||
that paper didn't make it into the final specification.)
|
||||
|
||||
Attributes are syntactically permitted in a broad set of locations, but
|
||||
specific attributes are only permitted in a subset of those locations. In
|
||||
some cases an attribute that appertains to a given element may be placed in
|
||||
any of several locations with the same meaning. In those cases HotSpot has a
|
||||
preferred location.
|
||||
|
||||
* An attribute that appertains to a function is placed at the beginning of the
|
||||
function's declaration, rather than between the function name and the parameter
|
||||
list.
|
||||
|
||||
Only the following attributes are permitted:
|
||||
|
||||
* `[[noreturn]]`
|
||||
|
||||
The following attributes are expressly forbidden:
|
||||
|
||||
* `[[carries_dependency]]` - Related to `memory_order_consume`.
|
||||
* `[[deprecated]]` - Not relevant in HotSpot code.
|
||||
|
||||
### Additional Permitted Features
|
||||
|
||||
* `alignof`
|
||||
([n2341](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf))
|
||||
|
||||
* `constexpr`
|
||||
([n2235](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf))
|
||||
([n3652](https://isocpp.org/files/papers/N3652.html))
|
||||
@@ -1186,6 +1108,10 @@ difficult to deal with and lead to surprises, as can destruction
|
||||
ordering. HotSpot doesn't generally try to cleanup on exit, and
|
||||
running destructors at exit can also lead to problems.
|
||||
|
||||
* `[[deprecated]]` attribute
|
||||
([n3760](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html)) —
|
||||
Not relevant in HotSpot code.
|
||||
|
||||
* Avoid most operator overloading, preferring named functions. When
|
||||
operator overloading is used, ensure the semantics conform to the
|
||||
normal expected behavior of the operation.
|
||||
@@ -1194,6 +1120,8 @@ normal expected behavior of the operation.
|
||||
conversion operators. (Note that conversion to `bool` isn't needed
|
||||
in HotSpot code because of the "no implicit boolean" guideline.)
|
||||
|
||||
* Avoid covariant return types.
|
||||
|
||||
* Avoid `goto` statements.
|
||||
|
||||
### Undecided Features
|
||||
@@ -1210,6 +1138,9 @@ features that have not yet been discussed.
|
||||
* Member initializers and aggregates
|
||||
([n3653](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html))
|
||||
|
||||
* `[[noreturn]]` attribute
|
||||
([n2761](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf))
|
||||
|
||||
* Rvalue references and move semantics
|
||||
|
||||
[ADL]: https://en.cppreference.com/w/cpp/language/adl
|
||||
|
||||
@@ -5,19 +5,11 @@
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Native/Unit Test Development Guidelines</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||
div.column{flex: auto; overflow-x: auto;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
ul.task-list{list-style: none;}
|
||||
ul.task-list li input[type="checkbox"] {
|
||||
width: 0.8em;
|
||||
margin: 0 0.8em 0.2em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
|
||||
<!--[if lt IE 9]>
|
||||
@@ -28,442 +20,174 @@
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">Native/Unit Test Development Guidelines</h1>
|
||||
</header>
|
||||
<nav id="TOC" role="doc-toc">
|
||||
<nav id="TOC">
|
||||
<ul>
|
||||
<li><a href="#good-test-properties" id="toc-good-test-properties">Good
|
||||
test properties</a>
|
||||
<ul>
|
||||
<li><a href="#lightness" id="toc-lightness">Lightness</a></li>
|
||||
<li><a href="#isolation" id="toc-isolation">Isolation</a></li>
|
||||
<li><a href="#atomicity-and-self-containment"
|
||||
id="toc-atomicity-and-self-containment">Atomicity and
|
||||
self-containment</a></li>
|
||||
<li><a href="#repeatability"
|
||||
id="toc-repeatability">Repeatability</a></li>
|
||||
<li><a href="#informativeness"
|
||||
id="toc-informativeness">Informativeness</a></li>
|
||||
<li><a href="#testing-instead-of-visiting"
|
||||
id="toc-testing-instead-of-visiting">Testing instead of
|
||||
visiting</a></li>
|
||||
<li><a href="#nearness" id="toc-nearness">Nearness</a></li>
|
||||
<li><a href="#good-test-properties">Good test properties</a><ul>
|
||||
<li><a href="#lightness">Lightness</a></li>
|
||||
<li><a href="#isolation">Isolation</a></li>
|
||||
<li><a href="#atomicity-and-self-containment">Atomicity and self-containment</a></li>
|
||||
<li><a href="#repeatability">Repeatability</a></li>
|
||||
<li><a href="#informativeness">Informativeness</a></li>
|
||||
<li><a href="#testing-instead-of-visiting">Testing instead of visiting</a></li>
|
||||
<li><a href="#nearness">Nearness</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#asserts" id="toc-asserts">Asserts</a>
|
||||
<ul>
|
||||
<li><a href="#several-checks" id="toc-several-checks">Several
|
||||
checks</a></li>
|
||||
<li><a href="#first-parameter-is-expected-value"
|
||||
id="toc-first-parameter-is-expected-value">First parameter is expected
|
||||
value</a></li>
|
||||
<li><a href="#floating-point-comparison"
|
||||
id="toc-floating-point-comparison">Floating-point comparison</a></li>
|
||||
<li><a href="#c-string-comparison" id="toc-c-string-comparison">C string
|
||||
comparison</a></li>
|
||||
<li><a href="#error-messages" id="toc-error-messages">Error
|
||||
messages</a></li>
|
||||
<li><a href="#uncluttered-output"
|
||||
id="toc-uncluttered-output">Uncluttered output</a></li>
|
||||
<li><a href="#failures-propagation"
|
||||
id="toc-failures-propagation">Failures propagation</a></li>
|
||||
<li><a href="#asserts">Asserts</a><ul>
|
||||
<li><a href="#several-checks">Several checks</a></li>
|
||||
<li><a href="#first-parameter-is-expected-value">First parameter is expected value</a></li>
|
||||
<li><a href="#floating-point-comparison">Floating-point comparison</a></li>
|
||||
<li><a href="#c-string-comparison">C string comparison</a></li>
|
||||
<li><a href="#error-messages">Error messages</a></li>
|
||||
<li><a href="#uncluttered-output">Uncluttered output</a></li>
|
||||
<li><a href="#failures-propagation">Failures propagation</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#naming-and-grouping" id="toc-naming-and-grouping">Naming
|
||||
and Grouping</a>
|
||||
<ul>
|
||||
<li><a href="#test-group-names" id="toc-test-group-names">Test group
|
||||
names</a></li>
|
||||
<li><a href="#filename" id="toc-filename">Filename</a></li>
|
||||
<li><a href="#file-location" id="toc-file-location">File
|
||||
location</a></li>
|
||||
<li><a href="#test-names" id="toc-test-names">Test names</a></li>
|
||||
<li><a href="#fixture-classes" id="toc-fixture-classes">Fixture
|
||||
classes</a></li>
|
||||
<li><a href="#friend-classes" id="toc-friend-classes">Friend
|
||||
classes</a></li>
|
||||
<li><a href="#oscpu-specific-tests" id="toc-oscpu-specific-tests">OS/CPU
|
||||
specific tests</a></li>
|
||||
<li><a href="#naming-and-grouping">Naming and Grouping</a><ul>
|
||||
<li><a href="#test-group-names">Test group names</a></li>
|
||||
<li><a href="#filename">Filename</a></li>
|
||||
<li><a href="#file-location">File location</a></li>
|
||||
<li><a href="#test-names">Test names</a></li>
|
||||
<li><a href="#fixture-classes">Fixture classes</a></li>
|
||||
<li><a href="#friend-classes">Friend classes</a></li>
|
||||
<li><a href="#oscpu-specific-tests">OS/CPU specific tests</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#miscellaneous" id="toc-miscellaneous">Miscellaneous</a>
|
||||
<ul>
|
||||
<li><a href="#hotspot-style" id="toc-hotspot-style">Hotspot
|
||||
style</a></li>
|
||||
<li><a href="#codetest-metrics" id="toc-codetest-metrics">Code/test
|
||||
metrics</a></li>
|
||||
<li><a href="#access-to-non-public-members"
|
||||
id="toc-access-to-non-public-members">Access to non-public
|
||||
members</a></li>
|
||||
<li><a href="#death-tests" id="toc-death-tests">Death tests</a></li>
|
||||
<li><a href="#external-flags" id="toc-external-flags">External
|
||||
flags</a></li>
|
||||
<li><a href="#test-specific-flags"
|
||||
id="toc-test-specific-flags">Test-specific flags</a></li>
|
||||
<li><a href="#flag-restoring" id="toc-flag-restoring">Flag
|
||||
restoring</a></li>
|
||||
<li><a href="#googletest-documentation"
|
||||
id="toc-googletest-documentation">GoogleTest documentation</a></li>
|
||||
<li><a href="#miscellaneous">Miscellaneous</a><ul>
|
||||
<li><a href="#hotspot-style">Hotspot style</a></li>
|
||||
<li><a href="#codetest-metrics">Code/test metrics</a></li>
|
||||
<li><a href="#access-to-non-public-members">Access to non-public members</a></li>
|
||||
<li><a href="#death-tests">Death tests</a></li>
|
||||
<li><a href="#external-flags">External flags</a></li>
|
||||
<li><a href="#test-specific-flags">Test-specific flags</a></li>
|
||||
<li><a href="#flag-restoring">Flag restoring</a></li>
|
||||
<li><a href="#googletest-documentation">GoogleTest documentation</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#todo" id="toc-todo">TODO</a></li>
|
||||
<li><a href="#todo">TODO</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<p>The purpose of these guidelines is to establish a shared vision on
|
||||
what kind of native tests and how we want to develop them for Hotspot
|
||||
using GoogleTest. Hence these guidelines include style items as well as
|
||||
test approach items.</p>
|
||||
<p>First section of this document describes properties of good tests
|
||||
which are common for almost all types of test regardless of language,
|
||||
framework, etc. Further sections provide recommendations to achieve
|
||||
those properties and other HotSpot and/or GoogleTest specific
|
||||
guidelines.</p>
|
||||
<p>The purpose of these guidelines is to establish a shared vision on what kind of native tests and how we want to develop them for Hotspot using GoogleTest. Hence these guidelines include style items as well as test approach items.</p>
|
||||
<p>First section of this document describes properties of good tests which are common for almost all types of test regardless of language, framework, etc. Further sections provide recommendations to achieve those properties and other HotSpot and/or GoogleTest specific guidelines.</p>
|
||||
<h2 id="good-test-properties">Good test properties</h2>
|
||||
<h3 id="lightness">Lightness</h3>
|
||||
<p>Use the most lightweight type of tests.</p>
|
||||
<p>In Hotspot, there are 3 different types of tests regarding their
|
||||
dependency on a JVM, each next level is slower than previous</p>
|
||||
<p>In Hotspot, there are 3 different types of tests regarding their dependency on a JVM, each next level is slower than previous</p>
|
||||
<ul>
|
||||
<li><p><code>TEST</code> : a test does not depend on a JVM</p></li>
|
||||
<li><p><code>TEST_VM</code> : a test does depend on an initialized JVM,
|
||||
but are supposed not to break a JVM, i.e. leave it in a workable
|
||||
state.</p></li>
|
||||
<li><p><code>TEST_OTHER_VM</code> : a test depends on a JVM and requires
|
||||
a freshly initialized JVM or leaves a JVM in non-workable state</p></li>
|
||||
<li><p><code>TEST_VM</code> : a test does depend on an initialized JVM, but are supposed not to break a JVM, i.e. leave it in a workable state.</p></li>
|
||||
<li><p><code>TEST_OTHER_VM</code> : a test depends on a JVM and requires a freshly initialized JVM or leaves a JVM in non-workable state</p></li>
|
||||
</ul>
|
||||
<h3 id="isolation">Isolation</h3>
|
||||
<p>Tests have to be isolated: not to have visible side-effects,
|
||||
influences on other tests results.</p>
|
||||
<p>Results of one test should not depend on test execution order, other
|
||||
tests, otherwise it is becoming almost impossible to find out why a test
|
||||
failed. Due to hotspot-specific, it is not so easy to get a full
|
||||
isolation, e.g. we share an initialized JVM between all
|
||||
<code>TEST_VM</code> tests, so if your test changes JVM's state too
|
||||
drastically and does not change it back, you had better consider
|
||||
<code>TEST_OTHER_VM</code>.</p>
|
||||
<h3 id="atomicity-and-self-containment">Atomicity and
|
||||
self-containment</h3>
|
||||
<p>Tests should be <em>atomic</em> and <em>self-contained</em> at the
|
||||
same time.</p>
|
||||
<p>One test should check a particular part of a class, subsystem,
|
||||
functionality, etc. Then it is quite easy to determine what parts of a
|
||||
product are broken basing on test failures. On the other hand, a test
|
||||
should test that part more-or-less entirely, because when one sees a
|
||||
test <code>FooTest::bar</code>, they assume all aspects of bar from
|
||||
<code>Foo</code> are tested.</p>
|
||||
<p>However, it is impossible to cover all aspects even of a method, not
|
||||
to mention a subsystem. In such cases, it is recommended to have several
|
||||
tests, one for each aspect of a thing under test. For example one test
|
||||
to tests how <code>Foo::bar</code> works if an argument is
|
||||
<code>null</code>, another test to test how it works if an argument is
|
||||
acceptable but <code>Foo</code> is not in the right state to accept it
|
||||
and so on. This helps not only to make tests atomic, self-contained but
|
||||
also makes test name self-descriptive (discussed in more details in <a
|
||||
href="#test-names">Test names</a>).</p>
|
||||
<p>Tests have to be isolated: not to have visible side-effects, influences on other tests results.</p>
|
||||
<p>Results of one test should not depend on test execution order, other tests, otherwise it is becoming almost impossible to find out why a test failed. Due to hotspot-specific, it is not so easy to get a full isolation, e.g. we share an initialized JVM between all <code>TEST_VM</code> tests, so if your test changes JVM's state too drastically and does not change it back, you had better consider <code>TEST_OTHER_VM</code>.</p>
|
||||
<h3 id="atomicity-and-self-containment">Atomicity and self-containment</h3>
|
||||
<p>Tests should be <em>atomic</em> and <em>self-contained</em> at the same time.</p>
|
||||
<p>One test should check a particular part of a class, subsystem, functionality, etc. Then it is quite easy to determine what parts of a product are broken basing on test failures. On the other hand, a test should test that part more-or-less entirely, because when one sees a test <code>FooTest::bar</code>, they assume all aspects of bar from <code>Foo</code> are tested.</p>
|
||||
<p>However, it is impossible to cover all aspects even of a method, not to mention a subsystem. In such cases, it is recommended to have several tests, one for each aspect of a thing under test. For example one test to tests how <code>Foo::bar</code> works if an argument is <code>null</code>, another test to test how it works if an argument is acceptable but <code>Foo</code> is not in the right state to accept it and so on. This helps not only to make tests atomic, self-contained but also makes test name self-descriptive (discussed in more details in <a href="#test-names">Test names</a>).</p>
|
||||
<h3 id="repeatability">Repeatability</h3>
|
||||
<p>Tests have to be repeatable.</p>
|
||||
<p>Reproducibility is very crucial for a test. No one likes sporadic
|
||||
test failures, they are hard to investigate, fix and verify a fix.</p>
|
||||
<p>In some cases, it is quite hard to write a 100% repeatable test,
|
||||
since besides a test there can be other moving parts, e.g. in case of
|
||||
<code>TEST_VM</code> there are several concurrently running threads.
|
||||
Despite this, we should try to make a test as reproducible as
|
||||
possible.</p>
|
||||
<p>Reproducibility is very crucial for a test. No one likes sporadic test failures, they are hard to investigate, fix and verify a fix.</p>
|
||||
<p>In some cases, it is quite hard to write a 100% repeatable test, since besides a test there can be other moving parts, e.g. in case of <code>TEST_VM</code> there are several concurrently running threads. Despite this, we should try to make a test as reproducible as possible.</p>
|
||||
<h3 id="informativeness">Informativeness</h3>
|
||||
<p>In case of a failure, a test should be as <em>informative</em> as
|
||||
possible.</p>
|
||||
<p>Having more information about a test failure than just compared
|
||||
values can be very useful for failure troubleshooting, it can reduce or
|
||||
even completely eliminate debugging hours. This is even more important
|
||||
in case of not 100% reproducible failures.</p>
|
||||
<p>Achieving this property, one can easily make a test too verbose, so
|
||||
it will be really hard to find useful information in the ocean of
|
||||
useless information. Hence they should not only think about how to
|
||||
provide <a href="#error-messages">good information</a>, but also <a
|
||||
href="#uncluttered-output">when to do it</a>.</p>
|
||||
<p>In case of a failure, a test should be as <em>informative</em> as possible.</p>
|
||||
<p>Having more information about a test failure than just compared values can be very useful for failure troubleshooting, it can reduce or even completely eliminate debugging hours. This is even more important in case of not 100% reproducible failures.</p>
|
||||
<p>Achieving this property, one can easily make a test too verbose, so it will be really hard to find useful information in the ocean of useless information. Hence they should not only think about how to provide <a href="#error-messages">good information</a>, but also <a href="#uncluttered-output">when to do it</a>.</p>
|
||||
<h3 id="testing-instead-of-visiting">Testing instead of visiting</h3>
|
||||
<p>Tests should <em>test</em>.</p>
|
||||
<p>It is not enough just to "visit" some code, a test should check that
|
||||
code does that it has to do, compare return values with expected values,
|
||||
check that desired side effects are done, and undesired are not, and so
|
||||
on. In other words, a test should contain at least one GoogleTest
|
||||
assertion and do not rely on JVM asserts.</p>
|
||||
<p>Generally speaking to write a good test, one should create a model of
|
||||
the system under tests, a model of possible bugs (or bugs which one
|
||||
wants to find) and design tests using those models.</p>
|
||||
<p>It is not enough just to "visit" some code, a test should check that code does that it has to do, compare return values with expected values, check that desired side effects are done, and undesired are not, and so on. In other words, a test should contain at least one GoogleTest assertion and do not rely on JVM asserts.</p>
|
||||
<p>Generally speaking to write a good test, one should create a model of the system under tests, a model of possible bugs (or bugs which one wants to find) and design tests using those models.</p>
|
||||
<h3 id="nearness">Nearness</h3>
|
||||
<p>Prefer having checks inside test code.</p>
|
||||
<p>Not only does having test logic outside, e.g. verification method,
|
||||
depending on asserts in product code contradict with several items above
|
||||
but also decreases test’s readability and stability. It is much easier
|
||||
to understand that a test is testing when all testing logic is located
|
||||
inside a test or nearby in shared test libraries. As a rule of thumb,
|
||||
the closer a check to a test, the better.</p>
|
||||
<p>Not only does having test logic outside, e.g. verification method, depending on asserts in product code contradict with several items above but also decreases test’s readability and stability. It is much easier to understand that a test is testing when all testing logic is located inside a test or nearby in shared test libraries. As a rule of thumb, the closer a check to a test, the better.</p>
|
||||
<h2 id="asserts">Asserts</h2>
|
||||
<h3 id="several-checks">Several checks</h3>
|
||||
<p>Prefer <code>EXPECT</code> over <code>ASSERT</code> if possible.</p>
|
||||
<p>This is related to the <a href="#informativeness">informativeness</a>
|
||||
property of tests, information for other checks can help to better
|
||||
localize a defect’s root-cause. One should use <code>ASSERT</code> if it
|
||||
is impossible to continue test execution or if it does not make much
|
||||
sense. Later in the text, <code>EXPECT</code> forms will be used to
|
||||
refer to both <code>ASSERT/EXPECT</code>.</p>
|
||||
<p>When it is possible to make several different checks, but impossible
|
||||
to continue test execution if at least one check fails, you can use
|
||||
<code>::testing::Test::HasNonfatalFailure()</code> function. The
|
||||
recommended way to express that is
|
||||
<code>ASSERT_FALSE(::testing::Test::HasNonfatalFailure())</code>.
|
||||
Besides making it clear why a test is aborted, it also allows you to
|
||||
provide more information about a failure.</p>
|
||||
<h3 id="first-parameter-is-expected-value">First parameter is expected
|
||||
value</h3>
|
||||
<p>In all equality assertions, expected values should be passed as the
|
||||
first parameter.</p>
|
||||
<p>This convention is adopted by GoogleTest, and there is a slight
|
||||
difference in how GoogleTest treats parameters, the most important one
|
||||
is <code>null</code> detection. Due to different reasons,
|
||||
<code>null</code> detection is enabled only for the first parameter,
|
||||
that is to said <code>EXPECT_EQ(NULL, object)</code> checks that object
|
||||
is <code>null</code>, while <code>EXPECT_EQ(object, NULL)</code> checks
|
||||
that object equals to <code>NULL</code>, GoogleTest is very strict
|
||||
regarding types of compared values so the latter will generates a
|
||||
compile-time error.</p>
|
||||
<p>This is related to the <a href="#informativeness">informativeness</a> property of tests, information for other checks can help to better localize a defect’s root-cause. One should use <code>ASSERT</code> if it is impossible to continue test execution or if it does not make much sense. Later in the text, <code>EXPECT</code> forms will be used to refer to both <code>ASSERT/EXPECT</code>.</p>
|
||||
<p>When it is possible to make several different checks, but impossible to continue test execution if at least one check fails, you can use <code>::testing::Test::HasNonfatalFailure()</code> function. The recommended way to express that is <code>ASSERT_FALSE(::testing::Test::HasNonfatalFailure())</code>. Besides making it clear why a test is aborted, it also allows you to provide more information about a failure.</p>
|
||||
<h3 id="first-parameter-is-expected-value">First parameter is expected value</h3>
|
||||
<p>In all equality assertions, expected values should be passed as the first parameter.</p>
|
||||
<p>This convention is adopted by GoogleTest, and there is a slight difference in how GoogleTest treats parameters, the most important one is <code>null</code> detection. Due to different reasons, <code>null</code> detection is enabled only for the first parameter, that is to said <code>EXPECT_EQ(NULL, object)</code> checks that object is <code>null</code>, while <code>EXPECT_EQ(object, NULL)</code> checks that object equals to <code>NULL</code>, GoogleTest is very strict regarding types of compared values so the latter will generates a compile-time error.</p>
|
||||
<h3 id="floating-point-comparison">Floating-point comparison</h3>
|
||||
<p>Use floating-point special macros to compare
|
||||
<code>float/double</code> values.</p>
|
||||
<p>Because of floating-point number representations and round-off
|
||||
errors, regular equality comparison will not return true in most cases.
|
||||
There are special <code>EXPECT_FLOAT_EQ/EXPECT_DOUBLE_EQ</code>
|
||||
assertions which check that the distance between compared values is not
|
||||
more than 4 ULPs, there is also <code>EXPECT_NEAR(v1, v2, eps)</code>
|
||||
which checks that the absolute value of the difference between
|
||||
<code>v1</code> and <code>v2</code> is not greater than
|
||||
<code>eps</code>.</p>
|
||||
<p>Use floating-point special macros to compare <code>float/double</code> values.</p>
|
||||
<p>Because of floating-point number representations and round-off errors, regular equality comparison will not return true in most cases. There are special <code>EXPECT_FLOAT_EQ/EXPECT_DOUBLE_EQ</code> assertions which check that the distance between compared values is not more than 4 ULPs, there is also <code>EXPECT_NEAR(v1, v2, eps)</code> which checks that the absolute value of the difference between <code>v1</code> and <code>v2</code> is not greater than <code>eps</code>.</p>
|
||||
<h3 id="c-string-comparison">C string comparison</h3>
|
||||
<p>Use string special macros for C strings comparisons.</p>
|
||||
<p><code>EXPECT_EQ</code> just compares pointers’ values, which is
|
||||
hardly what one wants comparing C strings. GoogleTest provides
|
||||
<code>EXPECT_STREQ</code> and <code>EXPECT_STRNE</code> macros to
|
||||
compare C string contents. There are also case-insensitive versions
|
||||
<code>EXPECT_STRCASEEQ</code>, <code>EXPECT_STRCASENE</code>.</p>
|
||||
<p><code>EXPECT_EQ</code> just compares pointers’ values, which is hardly what one wants comparing C strings. GoogleTest provides <code>EXPECT_STREQ</code> and <code>EXPECT_STRNE</code> macros to compare C string contents. There are also case-insensitive versions <code>EXPECT_STRCASEEQ</code>, <code>EXPECT_STRCASENE</code>.</p>
|
||||
<h3 id="error-messages">Error messages</h3>
|
||||
<p>Provide informative, but not too verbose error messages.</p>
|
||||
<p>All GoogleTest asserts print compared expressions and their values,
|
||||
so there is no need to have them in error messages. Asserts print only
|
||||
compared values, they do not print any of interim variables, e.g.
|
||||
<code>ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)</code>
|
||||
prints only one value. If you use some complex predicates, please
|
||||
consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code>
|
||||
assertions family, they check that a predicate returns true/success and
|
||||
print out all parameters values.</p>
|
||||
<p>However in some cases, default information is not enough, a commonly
|
||||
used example is an assert inside a loop, GoogleTest will not print
|
||||
iteration values (unless it is an assert's parameter). Other
|
||||
demonstrative examples are printing error code and a corresponding error
|
||||
message; printing internal states which might have an impact on results.
|
||||
One should add this information to assert message using
|
||||
<code><<</code> operator.</p>
|
||||
<p>All GoogleTest asserts print compared expressions and their values, so there is no need to have them in error messages. Asserts print only compared values, they do not print any of interim variables, e.g. <code>ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)</code> prints only one value. If you use some complex predicates, please consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code> assertions family, they check that a predicate returns true/success and print out all parameters values.</p>
|
||||
<p>However in some cases, default information is not enough, a commonly used example is an assert inside a loop, GoogleTest will not print iteration values (unless it is an assert's parameter). Other demonstrative examples are printing error code and a corresponding error message; printing internal states which might have an impact on results. One should add this information to assert message using <code><<</code> operator.</p>
|
||||
<h3 id="uncluttered-output">Uncluttered output</h3>
|
||||
<p>Print information only if it is needed.</p>
|
||||
<p>Too verbose tests which print all information even if they pass are
|
||||
very bad practice. They just pollute output, so it becomes harder to
|
||||
find useful information. In order not print information till it is
|
||||
really needed, one should consider saving it to a temporary buffer and
|
||||
pass to an assert. <a
|
||||
href="https://git.openjdk.org/jdk/blob/master/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp"
|
||||
class="uri">https://git.openjdk.org/jdk/blob/master/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp</a>
|
||||
has a good example how to do that.</p>
|
||||
<p>Too verbose tests which print all information even if they pass are very bad practice. They just pollute output, so it becomes harder to find useful information. In order not print information till it is really needed, one should consider saving it to a temporary buffer and pass to an assert. <a href="https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp" class="uri">https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp</a> has a good example how to do that.</p>
|
||||
<h3 id="failures-propagation">Failures propagation</h3>
|
||||
<p>Wrap a subroutine call into <code>EXPECT_NO_FATAL_FAILURE</code>
|
||||
macro to propagate failures.</p>
|
||||
<p><code>ASSERT</code> and <code>FAIL</code> abort only the current
|
||||
function, so if you have them in a subroutine, a test will not be
|
||||
aborted after the subroutine even if <code>ASSERT</code> or
|
||||
<code>FAIL</code> fails. You should call such subroutines in
|
||||
<code>ASSERT_NO_FATAL_FAILURE</code> macro to propagate fatal failures
|
||||
and abort a test. <code>(EXPECT|ASSERT)_NO_FATAL_FAILURE</code> can also
|
||||
be used to provide more information.</p>
|
||||
<p>Due to obvious reasons, there are no
|
||||
<code>(EXPECT|ASSERT)_NO_NONFATAL_FAILURE</code> macros. However, if you
|
||||
need to check if a subroutine generated a nonfatal failure (failed an
|
||||
<code>EXPECT</code>), you can use
|
||||
<code>::testing::Test::HasNonfatalFailure</code> function, or
|
||||
<code>::testing::Test::HasFailure</code> function to check if a
|
||||
subroutine generated any failures, see <a href="#several-checks">Several
|
||||
checks</a>.</p>
|
||||
<p>Wrap a subroutine call into <code>EXPECT_NO_FATAL_FAILURE</code> macro to propagate failures.</p>
|
||||
<p><code>ASSERT</code> and <code>FAIL</code> abort only the current function, so if you have them in a subroutine, a test will not be aborted after the subroutine even if <code>ASSERT</code> or <code>FAIL</code> fails. You should call such subroutines in <code>ASSERT_NO_FATAL_FAILURE</code> macro to propagate fatal failures and abort a test. <code>(EXPECT|ASSERT)_NO_FATAL_FAILURE</code> can also be used to provide more information.</p>
|
||||
<p>Due to obvious reasons, there are no <code>(EXPECT|ASSERT)_NO_NONFATAL_FAILURE</code> macros. However, if you need to check if a subroutine generated a nonfatal failure (failed an <code>EXPECT</code>), you can use <code>::testing::Test::HasNonfatalFailure</code> function, or <code>::testing::Test::HasFailure</code> function to check if a subroutine generated any failures, see <a href="#several-checks">Several checks</a>.</p>
|
||||
<h2 id="naming-and-grouping">Naming and Grouping</h2>
|
||||
<h3 id="test-group-names">Test group names</h3>
|
||||
<p>Test group names should be in CamelCase, start and end with a letter.
|
||||
A test group should be named after tested class, functionality,
|
||||
subsystem, etc.</p>
|
||||
<p>This naming scheme helps to find tests, filter them and simplifies
|
||||
test failure analysis. For example, class <code>Foo</code> - test group
|
||||
<code>Foo</code>, compiler logging subsystem - test group
|
||||
<code>CompilerLogging</code>, G1 GC — test group <code>G1GC</code>, and
|
||||
so forth.</p>
|
||||
<p>Test group names should be in CamelCase, start and end with a letter. A test group should be named after tested class, functionality, subsystem, etc.</p>
|
||||
<p>This naming scheme helps to find tests, filter them and simplifies test failure analysis. For example, class <code>Foo</code> - test group <code>Foo</code>, compiler logging subsystem - test group <code>CompilerLogging</code>, G1 GC — test group <code>G1GC</code>, and so forth.</p>
|
||||
<h3 id="filename">Filename</h3>
|
||||
<p>A test file must have <code>test_</code> prefix and <code>.cpp</code>
|
||||
suffix.</p>
|
||||
<p>Both are actually requirements from the current build system to
|
||||
recognize your tests.</p>
|
||||
<p>A test file must have <code>test_</code> prefix and <code>.cpp</code> suffix.</p>
|
||||
<p>Both are actually requirements from the current build system to recognize your tests.</p>
|
||||
<h3 id="file-location">File location</h3>
|
||||
<p>Test file location should reflect a location of the tested part of
|
||||
the product.</p>
|
||||
<p>Test file location should reflect a location of the tested part of the product.</p>
|
||||
<ul>
|
||||
<li><p>All unit tests for a class from <code>foo/bar/baz.cpp</code>
|
||||
should be placed <code>foo/bar/test_baz.cpp</code> in
|
||||
<code>hotspot/test/native/</code> directory. Having all tests for a
|
||||
class in one file is a common practice for unit tests, it helps to see
|
||||
all existing tests at once, share functions and/or resources without
|
||||
losing encapsulation.</p></li>
|
||||
<li><p>For tests which test more than one class, directory hierarchy
|
||||
should be the same as product hierarchy, and file name should reflect
|
||||
the name of the tested subsystem/functionality. For example, if a
|
||||
sub-system under tests belongs to <code>gc/g1</code>, tests should be
|
||||
placed in <code>gc/g1</code> directory.</p></li>
|
||||
<li><p>All unit tests for a class from <code>foo/bar/baz.cpp</code> should be placed <code>foo/bar/test_baz.cpp</code> in <code>hotspot/test/native/</code> directory. Having all tests for a class in one file is a common practice for unit tests, it helps to see all existing tests at once, share functions and/or resources without losing encapsulation.</p></li>
|
||||
<li><p>For tests which test more than one class, directory hierarchy should be the same as product hierarchy, and file name should reflect the name of the tested subsystem/functionality. For example, if a sub-system under tests belongs to <code>gc/g1</code>, tests should be placed in <code>gc/g1</code> directory.</p></li>
|
||||
</ul>
|
||||
<p>Please note that framework prepends directory name to a test group
|
||||
name. For example, if <code>TEST(foo, check_this)</code> and
|
||||
<code>TEST(bar, check_that)</code> are defined in
|
||||
<code>hotspot/test/native/gc/shared/test_foo.cpp</code> file, they will
|
||||
be reported as <code>gc/shared/foo::check_this</code> and
|
||||
<code>gc/shared/bar::check_that</code>.</p>
|
||||
<p>Please note that framework prepends directory name to a test group name. For example, if <code>TEST(foo, check_this)</code> and <code>TEST(bar, check_that)</code> are defined in <code>hotspot/test/native/gc/shared/test_foo.cpp</code> file, they will be reported as <code>gc/shared/foo::check_this</code> and <code>gc/shared/bar::check_that</code>.</p>
|
||||
<h3 id="test-names">Test names</h3>
|
||||
<p>Test names should be in small_snake_case, start and end with a
|
||||
letter. A test name should reflect that a test checks.</p>
|
||||
<p>Such naming makes tests self-descriptive and helps a lot during the
|
||||
whole test life cycle. It is easy to do test planning, test inventory,
|
||||
to see what things are not tested, to review tests, to analyze test
|
||||
failures, to evolve a test, etc. For example
|
||||
<code>foo_return_0_if_name_is_null</code> is better than
|
||||
<code>foo_sanity</code> or <code>foo_basic</code> or just
|
||||
<code>foo</code>,
|
||||
<code>humongous_objects_can_not_be_moved_by_young_gc</code> is better
|
||||
than <code>ho_young_gc</code>.</p>
|
||||
<p>Actually using underscore is against GoogleTest project convention,
|
||||
because it can lead to illegal identifiers, however, this is too strict.
|
||||
Restricting usage of underscore for test names only and prohibiting test
|
||||
name starts or ends with an underscore are enough to be safe.</p>
|
||||
<p>Test names should be in small_snake_case, start and end with a letter. A test name should reflect that a test checks.</p>
|
||||
<p>Such naming makes tests self-descriptive and helps a lot during the whole test life cycle. It is easy to do test planning, test inventory, to see what things are not tested, to review tests, to analyze test failures, to evolve a test, etc. For example <code>foo_return_0_if_name_is_null</code> is better than <code>foo_sanity</code> or <code>foo_basic</code> or just <code>foo</code>, <code>humongous_objects_can_not_be_moved_by_young_gc</code> is better than <code>ho_young_gc</code>.</p>
|
||||
<p>Actually using underscore is against GoogleTest project convention, because it can lead to illegal identifiers, however, this is too strict. Restricting usage of underscore for test names only and prohibiting test name starts or ends with an underscore are enough to be safe.</p>
|
||||
<h3 id="fixture-classes">Fixture classes</h3>
|
||||
<p>Fixture classes should be named after tested classes, subsystems, etc
|
||||
(follow <a href="#test-group-names">Test group names rule</a>) and have
|
||||
<code>Test</code> suffix to prevent class name conflicts.</p>
|
||||
<p>Fixture classes should be named after tested classes, subsystems, etc (follow <a href="#test-group-names">Test group names rule</a>) and have <code>Test</code> suffix to prevent class name conflicts.</p>
|
||||
<h3 id="friend-classes">Friend classes</h3>
|
||||
<p>All test purpose friends should have either <code>Test</code> or
|
||||
<code>Testable</code> suffix.</p>
|
||||
<p>It greatly simplifies understanding of friendship’s purpose and
|
||||
allows statically check that private members are not exposed
|
||||
unexpectedly. Having <code>FooTest</code> as a friend of
|
||||
<code>Foo</code> without any comments will be understood as a necessary
|
||||
evil to get testability.</p>
|
||||
<p>All test purpose friends should have either <code>Test</code> or <code>Testable</code> suffix.</p>
|
||||
<p>It greatly simplifies understanding of friendship’s purpose and allows statically check that private members are not exposed unexpectedly. Having <code>FooTest</code> as a friend of <code>Foo</code> without any comments will be understood as a necessary evil to get testability.</p>
|
||||
<h3 id="oscpu-specific-tests">OS/CPU specific tests</h3>
|
||||
<p>Guard OS/CPU specific tests by <code>#ifdef</code> and have OS/CPU
|
||||
name in filename.</p>
|
||||
<p>For the time being, we do not support separate directories for OS,
|
||||
CPU, OS-CPU specific tests, in case we will have lots of such tests, we
|
||||
will change directory layout and build system to support that in the
|
||||
same way it is done in hotspot.</p>
|
||||
<p>Guard OS/CPU specific tests by <code>#ifdef</code> and have OS/CPU name in filename.</p>
|
||||
<p>For the time being, we do not support separate directories for OS, CPU, OS-CPU specific tests, in case we will have lots of such tests, we will change directory layout and build system to support that in the same way it is done in hotspot.</p>
|
||||
<h2 id="miscellaneous">Miscellaneous</h2>
|
||||
<h3 id="hotspot-style">Hotspot style</h3>
|
||||
<p>Abide the norms and rules accepted in Hotspot style guide.</p>
|
||||
<p>Tests are a part of Hotspot, so everything (if applicable) we use for
|
||||
Hotspot, should be used for tests as well. Those guidelines cover
|
||||
test-specific things.</p>
|
||||
<p>Tests are a part of Hotspot, so everything (if applicable) we use for Hotspot, should be used for tests as well. Those guidelines cover test-specific things.</p>
|
||||
<h3 id="codetest-metrics">Code/test metrics</h3>
|
||||
<p>Coverage information and other code/test metrics are quite useful to
|
||||
decide what tests should be written, what tests should be improved and
|
||||
what can be removed.</p>
|
||||
<p>For unit tests, widely used and well-known coverage metric is branch
|
||||
coverage, which provides good quality of tests with relatively easy test
|
||||
development process. For other levels of testing, branch coverage is not
|
||||
as good, and one should consider others metrics, e.g. transaction flow
|
||||
coverage, data flow coverage.</p>
|
||||
<p>Coverage information and other code/test metrics are quite useful to decide what tests should be written, what tests should be improved and what can be removed.</p>
|
||||
<p>For unit tests, widely used and well-known coverage metric is branch coverage, which provides good quality of tests with relatively easy test development process. For other levels of testing, branch coverage is not as good, and one should consider others metrics, e.g. transaction flow coverage, data flow coverage.</p>
|
||||
<h3 id="access-to-non-public-members">Access to non-public members</h3>
|
||||
<p>Use explicit friend class to get access to non-public members.</p>
|
||||
<p>We do not use GoogleTest macro to declare friendship relation,
|
||||
because, from our point of view, it is less clear than an explicit
|
||||
declaration.</p>
|
||||
<p>Declaring a test fixture class as a friend class of a tested test is
|
||||
the easiest and the clearest way to get access. However, it has some
|
||||
disadvantages, here is some of them:</p>
|
||||
<p>We do not use GoogleTest macro to declare friendship relation, because, from our point of view, it is less clear than an explicit declaration.</p>
|
||||
<p>Declaring a test fixture class as a friend class of a tested test is the easiest and the clearest way to get access. However, it has some disadvantages, here is some of them:</p>
|
||||
<ul>
|
||||
<li>Each test has to be declared as a friend</li>
|
||||
<li>Subclasses do not inheritance friendship relation</li>
|
||||
</ul>
|
||||
<p>In other words, it is harder to share code between tests. Hence if
|
||||
you want to share code or expect it to be useful in other tests, you
|
||||
should consider making members in a tested class protected and introduce
|
||||
a shared test-only class which expose those members via public
|
||||
functions, or even making members publicly accessible right away in a
|
||||
product class. If it is not an option to change members visibility, one
|
||||
can create a friend class which exposes members.</p>
|
||||
<p>In other words, it is harder to share code between tests. Hence if you want to share code or expect it to be useful in other tests, you should consider making members in a tested class protected and introduce a shared test-only class which expose those members via public functions, or even making members publicly accessible right away in a product class. If it is not an option to change members visibility, one can create a friend class which exposes members.</p>
|
||||
<h3 id="death-tests">Death tests</h3>
|
||||
<p>You can not use death tests inside <code>TEST_OTHER_VM</code> and
|
||||
<code>TEST_VM_ASSERT*</code>.</p>
|
||||
<p>We tried to make Hotspot-GoogleTest integration as transparent as
|
||||
possible, however, due to the current implementation of
|
||||
<code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> tests, you
|
||||
cannot use death test functionality in them. These tests are implemented
|
||||
as GoogleTest death tests, and GoogleTest does not allow to have a death
|
||||
test inside another death test.</p>
|
||||
<p>You can not use death tests inside <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code>.</p>
|
||||
<p>We tried to make Hotspot-GoogleTest integration as transparent as possible, however, due to the current implementation of <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> tests, you cannot use death test functionality in them. These tests are implemented as GoogleTest death tests, and GoogleTest does not allow to have a death test inside another death test.</p>
|
||||
<h3 id="external-flags">External flags</h3>
|
||||
<p>Passing external flags to a tested JVM is not supported.</p>
|
||||
<p>The rationality of such design decision is to simplify both tests and
|
||||
a test framework and to avoid failures related to incompatible flags
|
||||
combination till there is a good solution for that. However there are
|
||||
cases when one wants to test a JVM with specific flags combination,
|
||||
<code>_JAVA_OPTIONS</code> environment variable can be used to do that.
|
||||
Flags from <code>_JAVA_OPTIONS</code> will be used in
|
||||
<code>TEST_VM</code>, <code>TEST_OTHER_VM</code> and
|
||||
<code>TEST_VM_ASSERT*</code> tests.</p>
|
||||
<p>The rationality of such design decision is to simplify both tests and a test framework and to avoid failures related to incompatible flags combination till there is a good solution for that. However there are cases when one wants to test a JVM with specific flags combination, <code>_JAVA_OPTIONS</code> environment variable can be used to do that. Flags from <code>_JAVA_OPTIONS</code> will be used in <code>TEST_VM</code>, <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> tests.</p>
|
||||
<h3 id="test-specific-flags">Test-specific flags</h3>
|
||||
<p>Passing flags to a tested JVM in <code>TEST_OTHER_VM</code> and
|
||||
<code>TEST_VM_ASSERT*</code> should be possible, but is not implemented
|
||||
yet.</p>
|
||||
<p>Facility to pass test-specific flags is needed for system, regression
|
||||
or other types of tests which require a fully initialized JVM in some
|
||||
particular configuration, e.g. with Serial GC selected. There is no
|
||||
support for such tests now, however, there is a plan to add that in
|
||||
upcoming releases.</p>
|
||||
<p>For now, if a test depends on flags values, it should have
|
||||
<code>if (!<flag>) { return }</code> guards in the very beginning
|
||||
and <code>@requires</code> comment similar to jtreg
|
||||
<code>@requires</code> directive right before test macros. <a
|
||||
href="https://git.openjdk.org/jdk/blob/master/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp"
|
||||
class="uri">https://git.openjdk.org/jdk/blob/master/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp</a>
|
||||
ha an example of this temporary workaround. It is important to follow
|
||||
that pattern as it allows us to easily find all such tests and update
|
||||
them as soon as there is an implementation of flag passing facility.</p>
|
||||
<p>In long-term, we expect jtreg to support GoogleTest tests as first
|
||||
class citizens, that is to say, jtreg will parse <span class="citation"
|
||||
data-cites="requires">@requires</span> comments and filter out
|
||||
inapplicable tests.</p>
|
||||
<p>Passing flags to a tested JVM in <code>TEST_OTHER_VM</code> and <code>TEST_VM_ASSERT*</code> should be possible, but is not implemented yet.</p>
|
||||
<p>Facility to pass test-specific flags is needed for system, regression or other types of tests which require a fully initialized JVM in some particular configuration, e.g. with Serial GC selected. There is no support for such tests now, however, there is a plan to add that in upcoming releases.</p>
|
||||
<p>For now, if a test depends on flags values, it should have <code>if (!<flag>) { return }</code> guards in the very beginning and <code>@requires</code> comment similar to jtreg <code>@requires</code> directive right before test macros. <a href="https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp" class="uri">https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp</a> ha an example of this temporary workaround. It is important to follow that pattern as it allows us to easily find all such tests and update them as soon as there is an implementation of flag passing facility.</p>
|
||||
<p>In long-term, we expect jtreg to support GoogleTest tests as first class citizens, that is to say, jtreg will parse <span class="citation" data-cites="requires">@requires</span> comments and filter out inapplicable tests.</p>
|
||||
<h3 id="flag-restoring">Flag restoring</h3>
|
||||
<p>Restore changed flags.</p>
|
||||
<p>It is quite common for tests to configure JVM in a certain way
|
||||
changing flags’ values. GoogleTest provides two ways to set up
|
||||
environment before a test and restore it afterward: using either
|
||||
constructor and destructor or <code>SetUp</code> and
|
||||
<code>TearDown</code> functions. Both ways require to use a test fixture
|
||||
class, which sometimes is too wordy. The simpler facilities like
|
||||
<code>FLAG_GUARD</code> macro or <code>*FlagSetting</code> classes could
|
||||
be used in such cases to restore/set values.</p>
|
||||
<p>It is quite common for tests to configure JVM in a certain way changing flags’ values. GoogleTest provides two ways to set up environment before a test and restore it afterward: using either constructor and destructor or <code>SetUp</code> and <code>TearDown</code> functions. Both ways require to use a test fixture class, which sometimes is too wordy. The simpler facilities like <code>FLAG_GUARD</code> macro or <code>*FlagSetting</code> classes could be used in such cases to restore/set values.</p>
|
||||
<p>Caveats:</p>
|
||||
<ul>
|
||||
<li><p>Changing a flag’s value could break the invariants between flags'
|
||||
values and hence could lead to unexpected/unsupported JVM
|
||||
state.</p></li>
|
||||
<li><p><code>FLAG_SET_*</code> macros can change more than one flag (in
|
||||
order to maintain invariants) so it is hard to predict what flags will
|
||||
be changed and it makes restoring all changed flags a nontrivial task.
|
||||
Thus in case one uses <code>FLAG_SET_*</code> macros, they should use
|
||||
<code>TEST_OTHER_VM</code> test type.</p></li>
|
||||
<li><p>Changing a flag’s value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.</p></li>
|
||||
<li><p><code>FLAG_SET_*</code> macros can change more than one flag (in order to maintain invariants) so it is hard to predict what flags will be changed and it makes restoring all changed flags a nontrivial task. Thus in case one uses <code>FLAG_SET_*</code> macros, they should use <code>TEST_OTHER_VM</code> test type.</p></li>
|
||||
</ul>
|
||||
<h3 id="googletest-documentation">GoogleTest documentation</h3>
|
||||
<p>In case you have any questions regarding GoogleTest itself, its
|
||||
asserts, test declaration macros, other macros, etc, please consult its
|
||||
documentation.</p>
|
||||
<p>In case you have any questions regarding GoogleTest itself, its asserts, test declaration macros, other macros, etc, please consult its documentation.</p>
|
||||
<h2 id="todo">TODO</h2>
|
||||
<p>Although this document provides guidelines on the most important
|
||||
parts of test development using GTest, it still misses a few items:</p>
|
||||
<p>Although this document provides guidelines on the most important parts of test development using GTest, it still misses a few items:</p>
|
||||
<ul>
|
||||
<li><p>Examples, esp for <a href="#access-to-non-public-members">access
|
||||
to non-public members</a></p></li>
|
||||
<li><p>test types: purpose, drawbacks, limitation</p>
|
||||
<li><p>Examples, esp for <a href="#access-to-non-public-members">access to non-public members</a></p></li>
|
||||
<li>test types: purpose, drawbacks, limitation
|
||||
<ul>
|
||||
<li><code>TEST_VM</code></li>
|
||||
<li><code>TEST_VM_F</code></li>
|
||||
@@ -471,7 +195,7 @@ to non-public members</a></p></li>
|
||||
<li><code>TEST_VM_ASSERT</code></li>
|
||||
<li><code>TEST_VM_ASSERT_MSG</code></li>
|
||||
</ul></li>
|
||||
<li><p>Miscellaneous</p>
|
||||
<li>Miscellaneous
|
||||
<ul>
|
||||
<li>Test libraries
|
||||
<ul>
|
||||
@@ -484,8 +208,7 @@ to non-public members</a></p></li>
|
||||
<li>how to run tests in random order</li>
|
||||
<li>how to run only specific tests</li>
|
||||
<li>how to run each test separately</li>
|
||||
<li>check that a test can find bugs it is supposed to by introducing
|
||||
them</li>
|
||||
<li>check that a test can find bugs it is supposed to by introducing them</li>
|
||||
</ul></li>
|
||||
<li>mocks/stubs/dependency injection</li>
|
||||
<li>setUp/tearDown
|
||||
|
||||
@@ -100,7 +100,7 @@ Generally speaking to write a good test, one should create a model of
|
||||
the system under tests, a model of possible bugs (or bugs which one
|
||||
wants to find) and design tests using those models.
|
||||
|
||||
### Nearness
|
||||
### Nearness
|
||||
|
||||
Prefer having checks inside test code.
|
||||
|
||||
@@ -156,7 +156,7 @@ that the distance between compared values is not more than 4 ULPs,
|
||||
there is also `EXPECT_NEAR(v1, v2, eps)` which checks that the absolute
|
||||
value of the difference between `v1` and `v2` is not greater than `eps`.
|
||||
|
||||
### C string comparison
|
||||
### C string comparison
|
||||
|
||||
Use string special macros for C strings comparisons.
|
||||
|
||||
@@ -194,7 +194,7 @@ very bad practice. They just pollute output, so it becomes harder to
|
||||
find useful information. In order not print information till it is
|
||||
really needed, one should consider saving it to a temporary buffer and
|
||||
pass to an assert.
|
||||
<https://git.openjdk.org/jdk/blob/master/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp>
|
||||
<https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp>
|
||||
has a good example how to do that.
|
||||
|
||||
### Failures propagation
|
||||
@@ -229,7 +229,7 @@ test failure analysis. For example, class `Foo` - test group `Foo`,
|
||||
compiler logging subsystem - test group `CompilerLogging`, G1 GC — test
|
||||
group `G1GC`, and so forth.
|
||||
|
||||
### Filename
|
||||
### Filename
|
||||
|
||||
A test file must have `test_` prefix and `.cpp` suffix.
|
||||
|
||||
@@ -283,7 +283,7 @@ Fixture classes should be named after tested classes, subsystems, etc
|
||||
(follow [Test group names rule](#test-group-names)) and have
|
||||
`Test` suffix to prevent class name conflicts.
|
||||
|
||||
### Friend classes
|
||||
### Friend classes
|
||||
|
||||
All test purpose friends should have either `Test` or `Testable` suffix.
|
||||
|
||||
@@ -303,7 +303,7 @@ the same way it is done in hotspot.
|
||||
|
||||
## Miscellaneous
|
||||
|
||||
### Hotspot style
|
||||
### Hotspot style
|
||||
|
||||
Abide the norms and rules accepted in Hotspot style guide.
|
||||
|
||||
@@ -383,7 +383,7 @@ upcoming releases.
|
||||
For now, if a test depends on flags values, it should have `if
|
||||
(!<flag>) { return }` guards in the very beginning and `@requires`
|
||||
comment similar to jtreg `@requires` directive right before test macros.
|
||||
<https://git.openjdk.org/jdk/blob/master/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp>
|
||||
<https://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/gtest/gc/g1/test_g1IHOPControl.cpp>
|
||||
ha an example of this temporary workaround. It is important to follow
|
||||
that pattern as it allows us to easily find all such tests and update
|
||||
them as soon as there is an implementation of flag passing facility.
|
||||
@@ -392,7 +392,7 @@ In long-term, we expect jtreg to support GoogleTest tests as first
|
||||
class citizens, that is to say, jtreg will parse @requires comments
|
||||
and filter out inapplicable tests.
|
||||
|
||||
### Flag restoring
|
||||
### Flag restoring
|
||||
|
||||
Restore changed flags.
|
||||
|
||||
@@ -404,7 +404,7 @@ require to use a test fixture class, which sometimes is too wordy. The
|
||||
simpler facilities like `FLAG_GUARD` macro or `*FlagSetting` classes could
|
||||
be used in such cases to restore/set values.
|
||||
|
||||
Caveats:
|
||||
Caveats:
|
||||
|
||||
* Changing a flag’s value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
|
||||
|
||||
|
||||
157
doc/ide.html
157
doc/ide.html
@@ -5,19 +5,11 @@
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>IDE support in the JDK</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||
div.column{flex: auto; overflow-x: auto;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
ul.task-list{list-style: none;}
|
||||
ul.task-list li input[type="checkbox"] {
|
||||
width: 0.8em;
|
||||
margin: 0 0.8em 0.2em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
|
||||
<!--[if lt IE 9]>
|
||||
@@ -28,144 +20,41 @@
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">IDE support in the JDK</h1>
|
||||
</header>
|
||||
<nav id="TOC" role="doc-toc">
|
||||
<nav id="TOC">
|
||||
<ul>
|
||||
<li><a href="#introduction" id="toc-introduction">Introduction</a>
|
||||
<ul>
|
||||
<li><a href="#ide-support-for-native-code"
|
||||
id="toc-ide-support-for-native-code">IDE support for native
|
||||
code</a></li>
|
||||
<li><a href="#ide-support-for-java-code"
|
||||
id="toc-ide-support-for-java-code">IDE support for Java code</a></li>
|
||||
<li><a href="#introduction">Introduction</a><ul>
|
||||
<li><a href="#ide-support-for-native-code">IDE support for native code</a></li>
|
||||
<li><a href="#ide-support-for-java-code">IDE support for Java code</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
<p>When you are familiar with building and testing the JDK, you may want
|
||||
to configure an IDE to work with the source code. The instructions
|
||||
differ a bit depending on whether you are interested in working with the
|
||||
native (C/C++) or the Java code.</p>
|
||||
<p>When you are familiar with building and testing the JDK, you may want to configure an IDE to work with the source code. The instructions differ a bit depending on whether you are interested in working with the native (C/C++) or the Java code.</p>
|
||||
<h3 id="ide-support-for-native-code">IDE support for native code</h3>
|
||||
<p>There are a few ways to generate IDE configuration for the native
|
||||
sources, depending on which IDE to use.</p>
|
||||
<p>There are a few ways to generate IDE configuration for the native sources, depending on which IDE to use.</p>
|
||||
<h4 id="visual-studio-code">Visual Studio Code</h4>
|
||||
<p>The make system can generate a <a
|
||||
href="https://code.visualstudio.com">Visual Studio Code</a> workspace
|
||||
that has C/C++ source indexing configured correctly, as well as launcher
|
||||
targets for tests and the Java launcher. After configuring, a workspace
|
||||
for the configuration can be generated using:</p>
|
||||
<p>The make system can generate a <a href="https://code.visualstudio.com">Visual Studio Code</a> workspace that has C/C++ source indexing configured correctly, as well as launcher targets for tests and the Java launcher. After configuring, a workspace for the configuration can be generated using:</p>
|
||||
<pre class="shell"><code>make vscode-project</code></pre>
|
||||
<p>This creates a file called <code>jdk.code-workspace</code> in the
|
||||
build output folder. The full location will be printed after the
|
||||
workspace has been generated. To use it, choose
|
||||
<code>File -> Open Workspace...</code> in Visual Studio Code.</p>
|
||||
<p>This creates a file called <code>jdk.code-workspace</code> in the build output folder. The full location will be printed after the workspace has been generated. To use it, choose <code>File -> Open Workspace...</code> in Visual Studio Code.</p>
|
||||
<h5 id="alternative-indexers">Alternative indexers</h5>
|
||||
<p>The main <code>vscode-project</code> target configures the default
|
||||
C++ support in Visual Studio Code. There are also other source indexers
|
||||
that can be installed, that may provide additional features. It's
|
||||
currently possible to generate configuration for two such indexers, <a
|
||||
href="https://clang.llvm.org/extra/clangd/">clangd</a> and <a
|
||||
href="https://github.com/Andersbakken/rtags">rtags</a>. These can be
|
||||
configured by appending the name of the indexer to the make target, such
|
||||
as:</p>
|
||||
<p>The main <code>vscode-project</code> target configures the default C++ support in Visual Studio Code. There are also other source indexers that can be installed, that may provide additional features. It's currently possible to generate configuration for two such indexers, <a href="https://clang.llvm.org/extra/clangd/">clangd</a> and <a href="https://github.com/Andersbakken/rtags">rtags</a>. These can be configured by appending the name of the indexer to the make target, such as:</p>
|
||||
<pre class="shell"><code>make vscode-project-clangd</code></pre>
|
||||
<p>Additional instructions for configuring the given indexer will be
|
||||
displayed after the workspace has been generated.</p>
|
||||
<p>Additional instructions for configuring the given indexer will be displayed after the workspace has been generated.</p>
|
||||
<h4 id="visual-studio">Visual Studio</h4>
|
||||
<p>The make system can generate a Visual Studio project for the Hotspot
|
||||
native source. After configuring, the project is generated using:</p>
|
||||
<p>The make system can generate a Visual Studio project for the Hotspot native source. After configuring, the project is generated using:</p>
|
||||
<pre class="shell"><code>make hotspot-ide-project</code></pre>
|
||||
<p>This creates a file named <code>jvm.vcxproj</code> in
|
||||
<code>ide\hotspot-visualstudio</code> subfolder of the build output
|
||||
folder. The file can be opened in Visual Studio via
|
||||
<code>File -> Open -> Project/Solution</code>.</p>
|
||||
<h4 id="eclipse-cdt">Eclipse CDT</h4>
|
||||
<p>The make system can generate an Eclipse CDT Workspace that enables
|
||||
Eclipse indexing for the C and C++ sources throughout the entire
|
||||
codebase, as well as registering all common make targets to be runnable
|
||||
from the Eclipse explorer. This can be done after configuring by
|
||||
running:</p>
|
||||
<pre><code>make eclipse-native-env</code></pre>
|
||||
<p>After this is run, simply open and import the workspace in Eclipse
|
||||
through
|
||||
<code>File -> Import -> Projects from Folder or Archive</code> and
|
||||
at <code>Import source</code> click on the directory
|
||||
<code>ide\eclipse</code>, which can be found in the build output
|
||||
folder.</p>
|
||||
<p>If this doesn't work, you can also try
|
||||
<code>File -> Import -> Existing Projects into Workspace</code>
|
||||
instead.</p>
|
||||
<p>Setting up an Eclipse Workspace is relatively lightweight compared to
|
||||
other supported IDEs, but requires that your CDT installation has Cross
|
||||
GCC support enabled at the moment, even if you aren't cross compiling.
|
||||
The Visual C++ compiler is, at present, not supported as an indexer.</p>
|
||||
<p>If desired, you can instead request make to only include indexing
|
||||
support for just the Java Virtual Machine instead of the entire native
|
||||
codebase, by running:</p>
|
||||
<pre><code>make eclipse-hotspot-env</code></pre>
|
||||
<p>If you think your particular Eclipse installation can handle the
|
||||
strain, the make system also supports generating a combined Java and
|
||||
C/C++ Workspace for Eclipse which can then conveniently switch between
|
||||
Java and C/C++ natures during development by running:</p>
|
||||
<pre><code>make eclipse-mixed-env</code></pre>
|
||||
<p>Do note that this generates all features that come with both Java and
|
||||
C/C++ natures.</p>
|
||||
<p>By default, the Eclipse Workspace is located in the ide subdirectory
|
||||
in the build output. To share the JDK's source directory with the
|
||||
Eclipse Workspace, you can instead run:</p>
|
||||
<pre><code>make eclipse-shared-<ENV>-env</code></pre>
|
||||
<p>Eclipse support in the JDK is relatively new, so do keep in mind that
|
||||
not everything may work at the moment. As such, the resulting Workspace
|
||||
also has compilation database parsing support enabled, so you can pass
|
||||
Eclipse the compile commands file (see below) if all else fails.</p>
|
||||
<p>This creates a file named <code>jvm.vcxproj</code> in <code>ide\hotspot-visualstudio</code> subfolder of the build output folder. The file can be opened in Visual Studio via <code>File -> Open -> Project/Solution</code>.</p>
|
||||
<h4 id="compilation-database">Compilation Database</h4>
|
||||
<p>The make system can generate generic native code indexing support in
|
||||
the form of a <a
|
||||
href="https://clang.llvm.org/docs/JSONCompilationDatabase.html">Compilation
|
||||
Database</a> that can be used by many different IDEs and source code
|
||||
indexers.</p>
|
||||
<p>The make system can generate generic native code indexing support in the form of a <a href="https://clang.llvm.org/docs/JSONCompilationDatabase.html">Compilation Database</a> that can be used by many different IDEs and source code indexers.</p>
|
||||
<pre class="shell"><code>make compile-commands</code></pre>
|
||||
<p>It's also possible to generate the Compilation Database for the
|
||||
HotSpot source code only, which is a bit faster as it includes less
|
||||
information.</p>
|
||||
<p>It's also possible to generate the Compilation Database for the HotSpot source code only, which is a bit faster as it includes less information.</p>
|
||||
<pre class="shell"><code>make compile-commands-hotspot</code></pre>
|
||||
<h3 id="ide-support-for-java-code">IDE support for Java code</h3>
|
||||
<h4 id="intellij-idea">IntelliJ IDEA</h4>
|
||||
<p>The JDK project has a script that can be used for indexing the
|
||||
project with IntelliJ. After configuring and building the JDK, an
|
||||
IntelliJ workspace can be generated by running the following command in
|
||||
the top-level folder of the cloned repository:</p>
|
||||
<p>The JDK project has a script that can be used for indexing the project with IntelliJ. After configuring and building the JDK, an IntelliJ workspace can be generated by running the following command in the top-level folder of the cloned repository:</p>
|
||||
<pre class="shell"><code>bash bin/idea.sh</code></pre>
|
||||
<p>To use it, choose <code>File -> Open...</code> in IntelliJ and
|
||||
select the folder where you ran the above script.</p>
|
||||
<p>Next, configure the project SDK in IntelliJ. Open
|
||||
<code>File -> Project Structure -> Project</code> and select
|
||||
<code>build/<config>/images/jdk</code> as the SDK to use.</p>
|
||||
<p>In order to run the tests from the IDE, you can use the JTReg plugin.
|
||||
Instructions for building and using the plugin can be found <a
|
||||
href="https://github.com/openjdk/jtreg/tree/master/plugins/idea">here</a>.</p>
|
||||
<h4 id="eclipse">Eclipse</h4>
|
||||
<p>Eclipse JDT is a widely used Java IDE and has been for a very long
|
||||
time, being a popular choice alongside IntelliJ IDEA for Java
|
||||
development. Likewise, the JDK now includes support for developing its
|
||||
Java sources with Eclipse, which can be achieved by setting up a Java
|
||||
Workspace by running:</p>
|
||||
<pre><code>make eclipse-java-env</code></pre>
|
||||
<p>After the workspace has been generated you can import it in the same
|
||||
way as you would with Eclipse CDT:</p>
|
||||
<p>Follow
|
||||
<code>File -> Import -> Projects from Folder or Archive</code> and
|
||||
select the <code>ide\eclipse</code> directory in the build output folder
|
||||
to import the newly created Java Workspace.</p>
|
||||
<p>If doing so results in an error, you can also import the JDK via
|
||||
<code>File -> Import -> Existing Projects into Workspace</code> as
|
||||
a last resort.</p>
|
||||
<p>Alternatively, if you want a Java Workspace inside the JDK's source
|
||||
directory, you can instead run:</p>
|
||||
<pre><code>make eclipse-shared-java-env</code></pre>
|
||||
<p>As mentioned above for Eclipse CDT, you can create a combined Java
|
||||
and C/C++ Workspace which can conveniently switch between Java and C/C++
|
||||
natures during development by running:</p>
|
||||
<pre><code>make eclipse-mixed-env</code></pre>
|
||||
<p>To use it, choose <code>File -> Open...</code> in IntelliJ and select the folder where you ran the above script.</p>
|
||||
<p>Next, configure the project SDK in IntelliJ. Open <code>File -> Project Structure -> Project</code> and select <code>build/<config>/images/jdk</code> as the SDK to use.</p>
|
||||
<p>In order to run the tests from the IDE, you can use the JTReg plugin. Instructions for building and using the plugin can be found <a href="https://github.com/openjdk/jtreg/tree/master/plugins/idea">here</a>.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
94
doc/ide.md
94
doc/ide.md
@@ -56,63 +56,6 @@ This creates a file named `jvm.vcxproj` in `ide\hotspot-visualstudio`
|
||||
subfolder of the build output folder. The file can be opened in Visual Studio
|
||||
via `File -> Open -> Project/Solution`.
|
||||
|
||||
#### Eclipse CDT
|
||||
|
||||
The make system can generate an Eclipse CDT Workspace that enables Eclipse
|
||||
indexing for the C and C++ sources throughout the entire codebase, as well as
|
||||
registering all common make targets to be runnable from the Eclipse explorer.
|
||||
This can be done after configuring by running:
|
||||
|
||||
```
|
||||
make eclipse-native-env
|
||||
```
|
||||
|
||||
After this is run, simply open and import the workspace in Eclipse through
|
||||
`File -> Import -> Projects from Folder or Archive` and at
|
||||
`Import source` click on the directory `ide\eclipse`, which can be
|
||||
found in the build output folder.
|
||||
|
||||
If this doesn't work, you can also try
|
||||
`File -> Import -> Existing Projects into Workspace`
|
||||
instead.
|
||||
|
||||
Setting up an Eclipse Workspace is relatively lightweight compared to other
|
||||
supported IDEs, but requires that your CDT installation has Cross GCC support
|
||||
enabled at the moment, even if you aren't cross compiling. The Visual C++
|
||||
compiler is, at present, not supported as an indexer.
|
||||
|
||||
If desired, you can instead request make to only include indexing support for
|
||||
just the Java Virtual Machine instead of the entire native codebase, by running:
|
||||
|
||||
```
|
||||
make eclipse-hotspot-env
|
||||
```
|
||||
|
||||
If you think your particular Eclipse installation can handle the strain, the
|
||||
make system also supports generating a combined Java and C/C++ Workspace for
|
||||
Eclipse which can then conveniently switch between Java and C/C++ natures
|
||||
during development by running:
|
||||
|
||||
```
|
||||
make eclipse-mixed-env
|
||||
```
|
||||
|
||||
Do note that this generates all features that come with both Java and C/C++
|
||||
natures.
|
||||
|
||||
By default, the Eclipse Workspace is located in the ide subdirectory in the
|
||||
build output. To share the JDK's source directory with the Eclipse Workspace,
|
||||
you can instead run:
|
||||
|
||||
```
|
||||
make eclipse-shared-<ENV>-env
|
||||
```
|
||||
|
||||
Eclipse support in the JDK is relatively new, so do keep in mind that not
|
||||
everything may work at the moment. As such, the resulting Workspace also
|
||||
has compilation database parsing support enabled, so you can pass Eclipse
|
||||
the compile commands file (see below) if all else fails.
|
||||
|
||||
#### Compilation Database
|
||||
|
||||
The make system can generate generic native code indexing support in the form of
|
||||
@@ -153,40 +96,3 @@ as the SDK to use.
|
||||
In order to run the tests from the IDE, you can use the JTReg plugin.
|
||||
Instructions for building and using the plugin can be found
|
||||
[here](https://github.com/openjdk/jtreg/tree/master/plugins/idea).
|
||||
|
||||
#### Eclipse
|
||||
|
||||
Eclipse JDT is a widely used Java IDE and has been for a very long time, being
|
||||
a popular choice alongside IntelliJ IDEA for Java development. Likewise, the
|
||||
JDK now includes support for developing its Java sources with Eclipse, which
|
||||
can be achieved by setting up a Java Workspace by running:
|
||||
|
||||
```
|
||||
make eclipse-java-env
|
||||
```
|
||||
|
||||
After the workspace has been generated you can import it in the same way as
|
||||
you would with Eclipse CDT:
|
||||
|
||||
Follow `File -> Import -> Projects from Folder or Archive` and select the
|
||||
`ide\eclipse` directory in the build output folder to import the newly created
|
||||
Java Workspace.
|
||||
|
||||
If doing so results in an error, you can also import the JDK via
|
||||
`File -> Import -> Existing Projects into Workspace`
|
||||
as a last resort.
|
||||
|
||||
Alternatively, if you want a Java Workspace inside the JDK's source directory,
|
||||
you can instead run:
|
||||
|
||||
```
|
||||
make eclipse-shared-java-env
|
||||
```
|
||||
|
||||
As mentioned above for Eclipse CDT, you can create a combined Java and C/C++
|
||||
Workspace which can conveniently switch between Java and C/C++ natures during
|
||||
development by running:
|
||||
|
||||
```
|
||||
make eclipse-mixed-env
|
||||
```
|
||||
|
||||
634
doc/testing.html
634
doc/testing.html
@@ -5,99 +5,53 @@
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Testing the JDK</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||
div.column{flex: auto; overflow-x: auto;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
ul.task-list{list-style: none;}
|
||||
ul.task-list li input[type="checkbox"] {
|
||||
width: 0.8em;
|
||||
margin: 0 0.8em 0.2em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
|
||||
<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
|
||||
</head>
|
||||
<body>
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">Testing the JDK</h1>
|
||||
</header>
|
||||
<nav id="TOC" role="doc-toc">
|
||||
<nav id="TOC">
|
||||
<ul>
|
||||
<li><a href="#overview" id="toc-overview">Overview</a></li>
|
||||
<li><a href="#running-tests-locally-with-make-test"
|
||||
id="toc-running-tests-locally-with-make-test">Running tests locally with
|
||||
<code>make test</code></a>
|
||||
<ul>
|
||||
<li><a href="#configuration"
|
||||
id="toc-configuration">Configuration</a></li>
|
||||
<li><a href="#using-make-test-the-run-test-framework">Using "make test" (the run-test framework)</a><ul>
|
||||
<li><a href="#configuration">Configuration</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#test-selection" id="toc-test-selection">Test selection</a>
|
||||
<ul>
|
||||
<li><a href="#common-test-groups" id="toc-common-test-groups">Common
|
||||
Test Groups</a></li>
|
||||
<li><a href="#jtreg" id="toc-jtreg">JTReg</a></li>
|
||||
<li><a href="#gtest" id="toc-gtest">Gtest</a></li>
|
||||
<li><a href="#microbenchmarks"
|
||||
id="toc-microbenchmarks">Microbenchmarks</a></li>
|
||||
<li><a href="#special-tests" id="toc-special-tests">Special
|
||||
tests</a></li>
|
||||
<li><a href="#test-selection">Test selection</a><ul>
|
||||
<li><a href="#common-test-groups">Common Test Groups</a></li>
|
||||
<li><a href="#jtreg">JTReg</a></li>
|
||||
<li><a href="#gtest">Gtest</a></li>
|
||||
<li><a href="#microbenchmarks">Microbenchmarks</a></li>
|
||||
<li><a href="#special-tests">Special tests</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#test-results-and-summary"
|
||||
id="toc-test-results-and-summary">Test results and summary</a></li>
|
||||
<li><a href="#test-suite-control" id="toc-test-suite-control">Test suite
|
||||
control</a>
|
||||
<ul>
|
||||
<li><a href="#general-keywords-test_opts"
|
||||
id="toc-general-keywords-test_opts">General keywords
|
||||
(TEST_OPTS)</a></li>
|
||||
<li><a href="#jtreg-keywords" id="toc-jtreg-keywords">JTReg
|
||||
keywords</a></li>
|
||||
<li><a href="#gtest-keywords" id="toc-gtest-keywords">Gtest
|
||||
keywords</a></li>
|
||||
<li><a href="#microbenchmark-keywords"
|
||||
id="toc-microbenchmark-keywords">Microbenchmark keywords</a></li>
|
||||
<li><a href="#test-results-and-summary">Test results and summary</a></li>
|
||||
<li><a href="#test-suite-control">Test suite control</a><ul>
|
||||
<li><a href="#general-keywords-test_opts">General keywords (TEST_OPTS)</a></li>
|
||||
<li><a href="#jtreg-keywords">JTReg keywords</a></li>
|
||||
<li><a href="#gtest-keywords">Gtest keywords</a></li>
|
||||
<li><a href="#microbenchmark-keywords">Microbenchmark keywords</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#notes-for-specific-tests"
|
||||
id="toc-notes-for-specific-tests">Notes for Specific Tests</a>
|
||||
<ul>
|
||||
<li><a href="#docker-tests" id="toc-docker-tests">Docker Tests</a></li>
|
||||
<li><a href="#non-us-locale" id="toc-non-us-locale">Non-US
|
||||
locale</a></li>
|
||||
<li><a href="#pkcs11-tests" id="toc-pkcs11-tests">PKCS11 Tests</a></li>
|
||||
<li><a href="#client-ui-tests" id="toc-client-ui-tests">Client UI
|
||||
Tests</a></li>
|
||||
<li><a href="#notes-for-specific-tests">Notes for Specific Tests</a><ul>
|
||||
<li><a href="#docker-tests">Docker Tests</a></li>
|
||||
<li><a href="#non-us-locale">Non-US locale</a></li>
|
||||
<li><a href="#pkcs11-tests">PKCS11 Tests</a></li>
|
||||
<li><a href="#client-ui-tests">Client UI Tests</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#editing-this-document"
|
||||
id="toc-editing-this-document">Editing this document</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h2 id="overview">Overview</h2>
|
||||
<p>The bulk of JDK tests use <a
|
||||
href="https://openjdk.org/jtreg/">jtreg</a>, a regression test framework
|
||||
and test runner built for the JDK's specific needs. Other test
|
||||
frameworks are also used. The different test frameworks can be executed
|
||||
directly, but there is also a set of make targets intended to simplify
|
||||
the interface, and figure out how to run your tests for you.</p>
|
||||
<h2 id="running-tests-locally-with-make-test">Running tests locally with
|
||||
<code>make test</code></h2>
|
||||
<p>This is the easiest way to get started. Assuming you've built the JDK
|
||||
locally, execute:</p>
|
||||
<pre><code>$ make test</code></pre>
|
||||
<p>This will run a default set of tests against the JDK, and present you
|
||||
with the results. <code>make test</code> is part of a family of
|
||||
test-related make targets which simplify running tests, because they
|
||||
invoke the various test frameworks for you. The "make test framework" is
|
||||
simple to start with, but more complex ad-hoc combination of tests is
|
||||
also possible. You can always invoke the test frameworks directly if you
|
||||
want even more control.</p>
|
||||
<h2 id="using-make-test-the-run-test-framework">Using "make test" (the run-test framework)</h2>
|
||||
<p>This new way of running tests is developer-centric. It assumes that you have built a JDK locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.</p>
|
||||
<p>The main target <code>test</code> uses the jdk-image as the tested product. There is also an alternate target <code>exploded-test</code> that uses the exploded image instead. Not all tests will run successfully on the exploded image, but using this target can greatly improve rebuild times for certain workflows.</p>
|
||||
<p>Previously, <code>make test</code> was used to invoke an old system for running tests, and <code>make run-test</code> was used for the new test framework. For backward compatibility with scripts and muscle memory, <code>run-test</code> (and variants like <code>exploded-run-test</code> or <code>run-test-tier1</code>) are kept as aliases.</p>
|
||||
<p>Some example command-lines:</p>
|
||||
<pre><code>$ make test-tier1
|
||||
$ make test-jdk_lang JTREG="JOBS=8"
|
||||
@@ -107,214 +61,48 @@ $ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTO
|
||||
$ make test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java"
|
||||
$ make test TEST="micro:java.lang.reflect" MICRO="FORK=1;WARMUP_ITER=2"
|
||||
$ make exploded-test TEST=tier2</code></pre>
|
||||
<p>"tier1" and "tier2" refer to tiered testing, see further down. "TEST"
|
||||
is a test selection argument which the make test framework will use to
|
||||
try to find the tests you want. It iterates over the available test
|
||||
frameworks, and if the test isn't present in one, it tries the next one.
|
||||
The main target <code>test</code> uses the jdk-image as the tested
|
||||
product. There is also an alternate target <code>exploded-test</code>
|
||||
that uses the exploded image instead. Not all tests will run
|
||||
successfully on the exploded image, but using this target can greatly
|
||||
improve rebuild times for certain workflows.</p>
|
||||
<p>Previously, <code>make test</code> was used to invoke an old system
|
||||
for running tests, and <code>make run-test</code> was used for the new
|
||||
test framework. For backward compatibility with scripts and muscle
|
||||
memory, <code>run-test</code> and variants like
|
||||
<code>exploded-run-test</code> or <code>run-test-tier1</code> are kept
|
||||
as aliases.</p>
|
||||
<h3 id="configuration">Configuration</h3>
|
||||
<p>To be able to run JTReg tests, <code>configure</code> needs to know
|
||||
where to find the JTReg test framework. If it is not picked up
|
||||
automatically by configure, use the
|
||||
<code>--with-jtreg=<path to jtreg home></code> option to point to
|
||||
the JTReg framework. Note that this option should point to the JTReg
|
||||
home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc.
|
||||
(An alternative is to set the <code>JT_HOME</code> environment variable
|
||||
to point to the JTReg home before running <code>configure</code>.)</p>
|
||||
<p>To be able to run microbenchmarks, <code>configure</code> needs to
|
||||
know where to find the JMH dependency. Use
|
||||
<code>--with-jmh=<path to JMH jars></code> to point to a directory
|
||||
containing the core JMH and transitive dependencies. The recommended
|
||||
dependencies can be retrieved by running
|
||||
<code>sh make/devkit/createJMHBundle.sh</code>, after which
|
||||
<code>--with-jmh=build/jmh/jars</code> should work.</p>
|
||||
<p>When tests fail or timeout, jtreg runs its failure handler to capture
|
||||
necessary data from the system where the test was run. This data can
|
||||
then be used to analyze the test failures. Collecting this data involves
|
||||
running various commands (which are listed in files residing in
|
||||
<code>test/failure_handler/src/share/conf</code>) and some of these
|
||||
commands use <code>sudo</code>. If the system's <code>sudoers</code>
|
||||
file isn't configured to allow running these commands, then it can
|
||||
result in password being prompted during the failure handler execution.
|
||||
Typically, when running locally, collecting this additional data isn't
|
||||
always necessary. To disable running the failure handler, use
|
||||
<code>--enable-jtreg-failure-handler=no</code> when running
|
||||
<code>configure</code>. If, however, you want to let the failure handler
|
||||
to run and don't want to be prompted for sudo password, then you can
|
||||
configure your <code>sudoers</code> file appropriately. Please read the
|
||||
necessary documentation of your operating system to see how to do that;
|
||||
here we only show one possible way of doing that - edit the
|
||||
<code>/etc/sudoers.d/sudoers</code> file to include the following
|
||||
line:</p>
|
||||
<pre><code>johndoe ALL=(ALL) NOPASSWD: /sbin/dmesg</code></pre>
|
||||
<p>This line configures <code>sudo</code> to <em>not</em> prompt for
|
||||
password for the <code>/sbin/dmesg</code> command (this is one of the
|
||||
commands that is listed in the files at
|
||||
<code>test/failure_handler/src/share/conf</code>), for the user
|
||||
<code>johndoe</code>. Here <code>johndoe</code> is the user account
|
||||
under which the jtreg tests are run. Replace the username with a
|
||||
relevant user account of your system.</p>
|
||||
<p>To be able to run JTReg tests, <code>configure</code> needs to know where to find the JTReg test framework. If it is not picked up automatically by configure, use the <code>--with-jtreg=<path to jtreg home></code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc. (An alternative is to set the <code>JT_HOME</code> environment variable to point to the JTReg home before running <code>configure</code>.)</p>
|
||||
<p>To be able to run microbenchmarks, <code>configure</code> needs to know where to find the JMH dependency. Use <code>--with-jmh=<path to JMH jars></code> to point to a directory containing the core JMH and transitive dependencies. The recommended dependencies can be retrieved by running <code>sh make/devkit/createJMHBundle.sh</code>, after which <code>--with-jmh=build/jmh/jars</code> should work.</p>
|
||||
<h2 id="test-selection">Test selection</h2>
|
||||
<p>All functionality is available using the <code>test</code> make
|
||||
target. In this use case, the test or tests to be executed is controlled
|
||||
using the <code>TEST</code> variable. To speed up subsequent test runs
|
||||
with no source code changes, <code>test-only</code> can be used instead,
|
||||
which do not depend on the source and test image build.</p>
|
||||
<p>For some common top-level tests, direct make targets have been
|
||||
generated. This includes all JTReg test groups, the hotspot gtest, and
|
||||
custom tests (if present). This means that <code>make test-tier1</code>
|
||||
is equivalent to <code>make test TEST="tier1"</code>, but the latter is
|
||||
more tab-completion friendly. For more complex test runs, the
|
||||
<code>test TEST="x"</code> solution needs to be used.</p>
|
||||
<p>The test specifications given in <code>TEST</code> is parsed into
|
||||
fully qualified test descriptors, which clearly and unambigously show
|
||||
which tests will be run. As an example, <code>:tier1</code> will expand
|
||||
to
|
||||
<code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>.
|
||||
You can always submit a list of fully qualified test descriptors in the
|
||||
<code>TEST</code> variable if you want to shortcut the parser.</p>
|
||||
<p>All functionality is available using the <code>test</code> make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, <code>test-only</code> can be used instead, which do not depend on the source and test image build.</p>
|
||||
<p>For some common top-level tests, direct make targets have been generated. This includes all JTReg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make test-tier1</code> is equivalent to <code>make test TEST="tier1"</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>test TEST="x"</code> solution needs to be used.</p>
|
||||
<p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
|
||||
<h3 id="common-test-groups">Common Test Groups</h3>
|
||||
<p>Ideally, all tests are run for every change but this may not be
|
||||
practical due to the limited testing resources, the scope of the change,
|
||||
etc.</p>
|
||||
<p>The source tree currently defines a few common test groups in the
|
||||
relevant <code>TEST.groups</code> files. There are test groups that
|
||||
cover a specific component, for example <code>hotspot_gc</code>. It is a
|
||||
good idea to look into <code>TEST.groups</code> files to get a sense
|
||||
what tests are relevant to a particular JDK component.</p>
|
||||
<p>Component-specific tests may miss some unintended consequences of a
|
||||
change, so other tests should also be run. Again, it might be
|
||||
impractical to run all tests, and therefore <em>tiered</em> test groups
|
||||
exist. Tiered test groups are not component-specific, but rather cover
|
||||
the significant parts of the entire JDK.</p>
|
||||
<p>Multiple tiers allow balancing test coverage and testing costs. Lower
|
||||
test tiers are supposed to contain the simpler, quicker and more stable
|
||||
tests. Higher tiers are supposed to contain progressively more thorough,
|
||||
slower, and sometimes less stable tests, or the tests that require
|
||||
special configuration.</p>
|
||||
<p>Contributors are expected to run the tests for the areas that are
|
||||
changed, and the first N tiers they can afford to run, but at least
|
||||
tier1.</p>
|
||||
<p>Ideally, all tests are run for every change but this may not be practical due to the limited testing resources, the scope of the change, etc.</p>
|
||||
<p>The source tree currently defines a few common test groups in the relevant <code>TEST.groups</code> files. There are test groups that cover a specific component, for example <code>hotspot_gc</code>. It is a good idea to look into <code>TEST.groups</code> files to get a sense what tests are relevant to a particular JDK component.</p>
|
||||
<p>Component-specific tests may miss some unintended consequences of a change, so other tests should also be run. Again, it might be impractical to run all tests, and therefore <em>tiered</em> test groups exist. Tiered test groups are not component-specific, but rather cover the significant parts of the entire JDK.</p>
|
||||
<p>Multiple tiers allow balancing test coverage and testing costs. Lower test tiers are supposed to contain the simpler, quicker and more stable tests. Higher tiers are supposed to contain progressively more thorough, slower, and sometimes less stable tests, or the tests that require special configuration.</p>
|
||||
<p>Contributors are expected to run the tests for the areas that are changed, and the first N tiers they can afford to run, but at least tier1.</p>
|
||||
<p>A brief description of the tiered test groups:</p>
|
||||
<ul>
|
||||
<li><p><code>tier1</code>: This is the lowest test tier. Multiple
|
||||
developers run these tests every day. Because of the widespread use, the
|
||||
tests in <code>tier1</code> are carefully selected and optimized to run
|
||||
fast, and to run in the most stable manner. The test failures in
|
||||
<code>tier1</code> are usually followed up on quickly, either with
|
||||
fixes, or adding relevant tests to problem list. GitHub Actions
|
||||
workflows, if enabled, run <code>tier1</code> tests.</p></li>
|
||||
<li><p><code>tier2</code>: This test group covers even more ground.
|
||||
These contain, among other things, tests that either run for too long to
|
||||
be at <code>tier1</code>, or may require special configuration, or tests
|
||||
that are less stable, or cover the broader range of non-core JVM and JDK
|
||||
features/components(for example, XML).</p></li>
|
||||
<li><p><code>tier3</code>: This test group includes more stressful
|
||||
tests, the tests for corner cases not covered by previous tiers, plus
|
||||
the tests that require GUIs. As such, this suite should either be run
|
||||
with low concurrency (<code>TEST_JOBS=1</code>), or without headful
|
||||
tests(<code>JTREG_KEYWORDS=\!headful</code>), or both.</p></li>
|
||||
<li><p><code>tier4</code>: This test group includes every other test not
|
||||
covered by previous tiers. It includes, for example,
|
||||
<code>vmTestbase</code> suites for Hotspot, which run for many hours
|
||||
even on large machines. It also runs GUI tests, so the same
|
||||
<code>TEST_JOBS</code> and <code>JTREG_KEYWORDS</code> caveats
|
||||
apply.</p></li>
|
||||
<li><p><code>tier1</code>: This is the lowest test tier. Multiple developers run these tests every day. Because of the widespread use, the tests in <code>tier1</code> are carefully selected and optimized to run fast, and to run in the most stable manner. The test failures in <code>tier1</code> are usually followed up on quickly, either with fixes, or adding relevant tests to problem list. GitHub Actions workflows, if enabled, run <code>tier1</code> tests.</p></li>
|
||||
<li><p><code>tier2</code>: This test group covers even more ground. These contain, among other things, tests that either run for too long to be at <code>tier1</code>, or may require special configuration, or tests that are less stable, or cover the broader range of non-core JVM and JDK features/components (for example, XML).</p></li>
|
||||
<li><p><code>tier3</code>: This test group includes more stressful tests, the tests for corner cases not covered by previous tiers, plus the tests that require GUIs. As such, this suite should either be run with low concurrency (<code>TEST_JOBS=1</code>), or without headful tests (<code>JTREG_KEYWORDS=\!headful</code>), or both.</p></li>
|
||||
<li><p><code>tier4</code>: This test group includes every other test not covered by previous tiers. It includes, for example, <code>vmTestbase</code> suites for Hotspot, which run for many hours even on large machines. It also runs GUI tests, so the same <code>TEST_JOBS</code> and <code>JTREG_KEYWORDS</code> caveats apply.</p></li>
|
||||
</ul>
|
||||
<h3 id="jtreg">JTReg</h3>
|
||||
<p>JTReg tests can be selected either by picking a JTReg test group, or
|
||||
a selection of files or directories containing JTReg tests.
|
||||
Documentation can be found at <a
|
||||
href="https://openjdk.org/jtreg/">https://openjdk.org/jtreg/</a>, note
|
||||
especially the extensive <a
|
||||
href="https://openjdk.org/jtreg/faq.html">FAQ</a>.</p>
|
||||
<p>JTReg test groups can be specified either without a test root, e.g.
|
||||
<code>:tier1</code> (or <code>tier1</code>, the initial colon is
|
||||
optional), or with, e.g. <code>hotspot:tier1</code>,
|
||||
<code>test/jdk:jdk_util</code> or
|
||||
<code>$(TOPDIR)/test/hotspot/jtreg:hotspot_all</code>. The test root can
|
||||
be specified either as an absolute path, or a path relative to the JDK
|
||||
top directory, or the <code>test</code> directory. For simplicity, the
|
||||
hotspot JTReg test root, which really is <code>hotspot/jtreg</code> can
|
||||
be abbreviated as just <code>hotspot</code>.</p>
|
||||
<p>When specified without a test root, all matching groups from all test
|
||||
roots will be added. Otherwise, only the group from the specified test
|
||||
root will be added.</p>
|
||||
<p>Individual JTReg tests or directories containing JTReg tests can also
|
||||
be specified, like
|
||||
<code>test/hotspot/jtreg/native_sanity/JniVersion.java</code> or
|
||||
<code>hotspot/jtreg/native_sanity</code>. Just like for test root
|
||||
selection, you can either specify an absolute path (which can even point
|
||||
to JTReg tests outside the source tree), or a path relative to either
|
||||
the JDK top directory or the <code>test</code> directory.
|
||||
<code>hotspot</code> can be used as an alias for
|
||||
<code>hotspot/jtreg</code> here as well.</p>
|
||||
<p>As long as the test groups or test paths can be uniquely resolved,
|
||||
you do not need to enter the <code>jtreg:</code> prefix. If this is not
|
||||
possible, or if you want to use a fully qualified test descriptor, add
|
||||
<code>jtreg:</code>, e.g.
|
||||
<code>jtreg:test/hotspot/jtreg/native_sanity</code>.</p>
|
||||
<p>JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.</p>
|
||||
<p>JTReg test groups can be specified either without a test root, e.g. <code>:tier1</code> (or <code>tier1</code>, the initial colon is optional), or with, e.g. <code>hotspot:tier1</code>, <code>test/jdk:jdk_util</code> or <code>$(TOPDIR)/test/hotspot/jtreg:hotspot_all</code>. The test root can be specified either as an absolute path, or a path relative to the JDK top directory, or the <code>test</code> directory. For simplicity, the hotspot JTReg test root, which really is <code>hotspot/jtreg</code> can be abbreviated as just <code>hotspot</code>.</p>
|
||||
<p>When specified without a test root, all matching groups from all test roots will be added. Otherwise, only the group from the specified test root will be added.</p>
|
||||
<p>Individual JTReg tests or directories containing JTReg tests can also be specified, like <code>test/hotspot/jtreg/native_sanity/JniVersion.java</code> or <code>hotspot/jtreg/native_sanity</code>. Just like for test root selection, you can either specify an absolute path (which can even point to JTReg tests outside the source tree), or a path relative to either the JDK top directory or the <code>test</code> directory. <code>hotspot</code> can be used as an alias for <code>hotspot/jtreg</code> here as well.</p>
|
||||
<p>As long as the test groups or test paths can be uniquely resolved, you do not need to enter the <code>jtreg:</code> prefix. If this is not possible, or if you want to use a fully qualified test descriptor, add <code>jtreg:</code>, e.g. <code>jtreg:test/hotspot/jtreg/native_sanity</code>.</p>
|
||||
<h3 id="gtest">Gtest</h3>
|
||||
<p><strong>Note:</strong> To be able to run the Gtest suite, you need to
|
||||
configure your build to be able to find a proper version of the gtest
|
||||
source. For details, see the section <a
|
||||
href="building.html#running-tests">"Running Tests" in the build
|
||||
documentation</a>.</p>
|
||||
<p>Since the Hotspot Gtest suite is so quick, the default is to run all
|
||||
tests. This is specified by just <code>gtest</code>, or as a fully
|
||||
qualified test descriptor <code>gtest:all</code>.</p>
|
||||
<p>If you want, you can single out an individual test or a group of
|
||||
tests, for instance <code>gtest:LogDecorations</code> or
|
||||
<code>gtest:LogDecorations.level_test_vm</code>. This can be
|
||||
particularly useful if you want to run a shaky test repeatedly.</p>
|
||||
<p>For Gtest, there is a separate test suite for each JVM variant. The
|
||||
JVM variant is defined by adding <code>/<variant></code> to the
|
||||
test descriptor, e.g. <code>gtest:Log/client</code>. If you specify no
|
||||
variant, gtest will run once for each JVM variant present (e.g. server,
|
||||
client). So if you only have the server JVM present, then
|
||||
<code>gtest:all</code> will be equivalent to
|
||||
<code>gtest:all/server</code>.</p>
|
||||
<p>Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just <code>gtest</code>, or as a fully qualified test descriptor <code>gtest:all</code>.</p>
|
||||
<p>If you want, you can single out an individual test or a group of tests, for instance <code>gtest:LogDecorations</code> or <code>gtest:LogDecorations.level_test_vm</code>. This can be particularly useful if you want to run a shaky test repeatedly.</p>
|
||||
<p>For Gtest, there is a separate test suite for each JVM variant. The JVM variant is defined by adding <code>/<variant></code> to the test descriptor, e.g. <code>gtest:Log/client</code>. If you specify no variant, gtest will run once for each JVM variant present (e.g. server, client). So if you only have the server JVM present, then <code>gtest:all</code> will be equivalent to <code>gtest:all/server</code>.</p>
|
||||
<h3 id="microbenchmarks">Microbenchmarks</h3>
|
||||
<p>Which microbenchmarks to run is selected using a regular expression
|
||||
following the <code>micro:</code> test descriptor, e.g.,
|
||||
<code>micro:java.lang.reflect</code>. This delegates the test selection
|
||||
to JMH, meaning package name, class name and even benchmark method names
|
||||
can be used to select tests.</p>
|
||||
<p>Using special characters like <code>|</code> in the regular
|
||||
expression is possible, but needs to be escaped multiple times:
|
||||
<code>micro:ArrayCopy\\\\\|reflect</code>.</p>
|
||||
<p>Which microbenchmarks to run is selected using a regular expression following the <code>micro:</code> test descriptor, e.g., <code>micro:java.lang.reflect</code>. This delegates the test selection to JMH, meaning package name, class name and even benchmark method names can be used to select tests.</p>
|
||||
<p>Using special characters like <code>|</code> in the regular expression is possible, but needs to be escaped multiple times: <code>micro:ArrayCopy\\\\\|reflect</code>.</p>
|
||||
<h3 id="special-tests">Special tests</h3>
|
||||
<p>A handful of odd tests that are not covered by any other testing
|
||||
framework are accessible using the <code>special:</code> test
|
||||
descriptor. Currently, this includes <code>failure-handler</code> and
|
||||
<code>make</code>.</p>
|
||||
<p>A handful of odd tests that are not covered by any other testing framework are accessible using the <code>special:</code> test descriptor. Currently, this includes <code>failure-handler</code> and <code>make</code>.</p>
|
||||
<ul>
|
||||
<li><p>Failure handler testing is run using
|
||||
<code>special:failure-handler</code> or just
|
||||
<code>failure-handler</code> as test descriptor.</p></li>
|
||||
<li><p>Tests for the build system, including both makefiles and related
|
||||
functionality, is run using <code>special:make</code> or just
|
||||
<code>make</code> as test descriptor. This is equivalent to
|
||||
<code>special:make:all</code>.</p>
|
||||
<p>A specific make test can be run by supplying it as argument, e.g.
|
||||
<code>special:make:idea</code>. As a special syntax, this can also be
|
||||
expressed as <code>make-idea</code>, which allows for command lines as
|
||||
<code>make test-make-idea</code>.</p></li>
|
||||
<li><p>Failure handler testing is run using <code>special:failure-handler</code> or just <code>failure-handler</code> as test descriptor.</p></li>
|
||||
<li><p>Tests for the build system, including both makefiles and related functionality, is run using <code>special:make</code> or just <code>make</code> as test descriptor. This is equivalent to <code>special:make:all</code>.</p>
|
||||
<p>A specific make test can be run by supplying it as argument, e.g. <code>special:make:idea</code>. As a special syntax, this can also be expressed as <code>make-idea</code>, which allows for command lines as <code>make test-make-idea</code>.</p></li>
|
||||
</ul>
|
||||
<h2 id="test-results-and-summary">Test results and summary</h2>
|
||||
<p>At the end of the test run, a summary of all tests run will be
|
||||
presented. This will have a consistent look, regardless of what test
|
||||
suites were used. This is a sample summary:</p>
|
||||
<p>At the end of the test run, a summary of all tests run will be presented. This will have a consistent look, regardless of what test suites were used. This is a sample summary:</p>
|
||||
<pre><code>==============================
|
||||
Test summary
|
||||
==============================
|
||||
@@ -324,61 +112,20 @@ Test summary
|
||||
jtreg:nashorn/test:tier1 133 133 0 0
|
||||
==============================
|
||||
TEST FAILURE</code></pre>
|
||||
<p>Tests where the number of TOTAL tests does not equal the number of
|
||||
PASSed tests will be considered a test failure. These are marked with
|
||||
the <code>>> ... <<</code> marker for easy
|
||||
identification.</p>
|
||||
<p>The classification of non-passed tests differs a bit between test
|
||||
suites. In the summary, ERROR is used as a catch-all for tests that
|
||||
neither passed nor are classified as failed by the framework. This might
|
||||
indicate test framework error, timeout or other problems.</p>
|
||||
<p>In case of test failures, <code>make test</code> will exit with a
|
||||
non-zero exit value.</p>
|
||||
<p>All tests have their result stored in
|
||||
<code>build/$BUILD/test-results/$TEST_ID</code>, where TEST_ID is a
|
||||
path-safe conversion from the fully qualified test descriptor, e.g. for
|
||||
<code>jtreg:jdk/test:tier1</code> the TEST_ID is
|
||||
<code>jtreg_jdk_test_tier1</code>. This path is also printed in the log
|
||||
at the end of the test run.</p>
|
||||
<p>Additional work data is stored in
|
||||
<code>build/$BUILD/test-support/$TEST_ID</code>. For some frameworks,
|
||||
this directory might contain information that is useful in determining
|
||||
the cause of a failed test.</p>
|
||||
<p>Tests where the number of TOTAL tests does not equal the number of PASSed tests will be considered a test failure. These are marked with the <code>>> ... <<</code> marker for easy identification.</p>
|
||||
<p>The classification of non-passed tests differs a bit between test suites. In the summary, ERROR is used as a catch-all for tests that neither passed nor are classified as failed by the framework. This might indicate test framework error, timeout or other problems.</p>
|
||||
<p>In case of test failures, <code>make test</code> will exit with a non-zero exit value.</p>
|
||||
<p>All tests have their result stored in <code>build/$BUILD/test-results/$TEST_ID</code>, where TEST_ID is a path-safe conversion from the fully qualified test descriptor, e.g. for <code>jtreg:jdk/test:tier1</code> the TEST_ID is <code>jtreg_jdk_test_tier1</code>. This path is also printed in the log at the end of the test run.</p>
|
||||
<p>Additional work data is stored in <code>build/$BUILD/test-support/$TEST_ID</code>. For some frameworks, this directory might contain information that is useful in determining the cause of a failed test.</p>
|
||||
<h2 id="test-suite-control">Test suite control</h2>
|
||||
<p>It is possible to control various aspects of the test suites using
|
||||
make control variables.</p>
|
||||
<p>These variables use a keyword=value approach to allow multiple values
|
||||
to be set. So, for instance,
|
||||
<code>JTREG="JOBS=1;TIMEOUT_FACTOR=8"</code> will set the JTReg
|
||||
concurrency level to 1 and the timeout factor to 8. This is equivalent
|
||||
to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8</code>, but using
|
||||
the keyword format means that the <code>JTREG</code> variable is parsed
|
||||
and verified for correctness, so <code>JTREG="TMIEOUT_FACTOR=8"</code>
|
||||
would give an error, while <code>JTREG_TMIEOUT_FACTOR=8</code> would
|
||||
just pass unnoticed.</p>
|
||||
<p>To separate multiple keyword=value pairs, use <code>;</code>
|
||||
(semicolon). Since the shell normally eats <code>;</code>, the
|
||||
recommended usage is to write the assignment inside qoutes, e.g.
|
||||
<code>JTREG="...;..."</code>. This will also make sure spaces are
|
||||
preserved, as in
|
||||
<code>JTREG="JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"</code>.</p>
|
||||
<p>(Other ways are possible, e.g. using backslash:
|
||||
<code>JTREG=JOBS=1\;TIMEOUT_FACTOR=8</code>. Also, as a special
|
||||
technique, the string <code>%20</code> will be replaced with space for
|
||||
certain options, e.g.
|
||||
<code>JTREG=JAVA_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>.
|
||||
This can be useful if you have layers of scripts and have trouble
|
||||
getting proper quoting of command line arguments through.)</p>
|
||||
<p>As far as possible, the names of the keywords have been standardized
|
||||
between test suites.</p>
|
||||
<p>It is possible to control various aspects of the test suites using make control variables.</p>
|
||||
<p>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG="JOBS=1;TIMEOUT_FACTOR=8"</code> will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG="TMIEOUT_FACTOR=8"</code> would give an error, while <code>JTREG_TMIEOUT_FACTOR=8</code> would just pass unnoticed.</p>
|
||||
<p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG="...;..."</code>. This will also make sure spaces are preserved, as in <code>JTREG="JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"</code>.</p>
|
||||
<p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT_FACTOR=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=JAVA_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
|
||||
<p>As far as possible, the names of the keywords have been standardized between test suites.</p>
|
||||
<h3 id="general-keywords-test_opts">General keywords (TEST_OPTS)</h3>
|
||||
<p>Some keywords are valid across different test suites. If you want to
|
||||
run tests from multiple test suites, or just don't want to care which
|
||||
test suite specific control variable to use, then you can use the
|
||||
general TEST_OPTS control variable.</p>
|
||||
<p>There are also some keywords that applies globally to the test runner
|
||||
system, not to any specific test suites. These are also available as
|
||||
TEST_OPTS keywords.</p>
|
||||
<p>Some keywords are valid across different test suites. If you want to run tests from multiple test suites, or just don't want to care which test suite specific control variable to use, then you can use the general TEST_OPTS control variable.</p>
|
||||
<p>There are also some keywords that applies globally to the test runner system, not to any specific test suites. These are also available as TEST_OPTS keywords.</p>
|
||||
<h4 id="jobs">JOBS</h4>
|
||||
<p>Currently only applies to JTReg.</p>
|
||||
<h4 id="timeout_factor">TIMEOUT_FACTOR</h4>
|
||||
@@ -390,57 +137,28 @@ TEST_OPTS keywords.</p>
|
||||
<h4 id="aot_modules">AOT_MODULES</h4>
|
||||
<p>Applies to JTReg and GTest.</p>
|
||||
<h4 id="jcov">JCOV</h4>
|
||||
<p>This keywords applies globally to the test runner system. If set to
|
||||
<code>true</code>, it enables JCov coverage reporting for all tests run.
|
||||
To be useful, the JDK under test must be run with a JDK built with JCov
|
||||
instrumentation
|
||||
(<code>configure --with-jcov=<path to directory containing lib/jcov.jar></code>,
|
||||
<code>make jcov-image</code>).</p>
|
||||
<p>The simplest way to run tests with JCov coverage report is to use the
|
||||
special target <code>jcov-test</code> instead of <code>test</code>, e.g.
|
||||
<code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov
|
||||
image is built, and that JCov reporting is enabled.</p>
|
||||
<p>The JCov report is stored in
|
||||
<code>build/$BUILD/test-results/jcov-output/report</code>.</p>
|
||||
<p>Please note that running with JCov reporting can be very memory
|
||||
intensive.</p>
|
||||
<p>This keywords applies globally to the test runner system. If set to <code>true</code>, it enables JCov coverage reporting for all tests run. To be useful, the JDK under test must be run with a JDK built with JCov instrumentation (<code>configure --with-jcov=<path to directory containing lib/jcov.jar></code>, <code>make jcov-image</code>).</p>
|
||||
<p>The simplest way to run tests with JCov coverage report is to use the special target <code>jcov-test</code> instead of <code>test</code>, e.g. <code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov image is built, and that JCov reporting is enabled.</p>
|
||||
<p>The JCov report is stored in <code>build/$BUILD/test-results/jcov-output/report</code>.</p>
|
||||
<p>Please note that running with JCov reporting can be very memory intensive.</p>
|
||||
<h4 id="jcov_diff_changeset">JCOV_DIFF_CHANGESET</h4>
|
||||
<p>While collecting code coverage with JCov, it is also possible to find
|
||||
coverage for only recently changed code. JCOV_DIFF_CHANGESET specifies a
|
||||
source revision. A textual report will be generated showing coverage of
|
||||
the diff between the specified revision and the repository tip.</p>
|
||||
<p>The report is stored in
|
||||
<code>build/$BUILD/test-results/jcov-output/diff_coverage_report</code>
|
||||
file.</p>
|
||||
<p>While collecting code coverage with JCov, it is also possible to find coverage for only recently changed code. JCOV_DIFF_CHANGESET specifies a source revision. A textual report will be generated showing coverage of the diff between the specified revision and the repository tip.</p>
|
||||
<p>The report is stored in <code>build/$BUILD/test-results/jcov-output/diff_coverage_report</code> file.</p>
|
||||
<h3 id="jtreg-keywords">JTReg keywords</h3>
|
||||
<h4 id="jobs-1">JOBS</h4>
|
||||
<p>The test concurrency (<code>-concurrency</code>).</p>
|
||||
<p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>),
|
||||
otherwise it defaults to JOBS, except for Hotspot, where the default is
|
||||
<em>number of CPU cores/2</em>, but never more than <em>memory size in
|
||||
GB/2</em>.</p>
|
||||
<p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>), otherwise it defaults to JOBS, except for Hotspot, where the default is <em>number of CPU cores/2</em>, but never more than <em>memory size in GB/2</em>.</p>
|
||||
<h4 id="timeout_factor-1">TIMEOUT_FACTOR</h4>
|
||||
<p>The timeout factor (<code>-timeoutFactor</code>).</p>
|
||||
<p>Defaults to 4.</p>
|
||||
<h4 id="failure_handler_timeout">FAILURE_HANDLER_TIMEOUT</h4>
|
||||
<p>Sets the argument <code>-timeoutHandlerTimeout</code> for JTReg. The
|
||||
default value is 0. This is only valid if the failure handler is
|
||||
built.</p>
|
||||
<h4 id="jtreg_test_thread_factory">JTREG_TEST_THREAD_FACTORY</h4>
|
||||
<p>Sets the <code>-testThreadFactory</code> for JTReg. It should be the
|
||||
fully qualified classname of a class which implements
|
||||
<code>java.util.concurrent.ThreadFactory</code>. One such implementation
|
||||
class, named Virtual, is currently part of the JDK build in the
|
||||
<code>test/jtreg_test_thread_factory/</code> directory. This class gets
|
||||
compiled during the test image build. The implementation of the Virtual
|
||||
class creates a new virtual thread for executing each test class.</p>
|
||||
<p>Sets the argument <code>-timeoutHandlerTimeout</code> for JTReg. The default value is 0. This is only valid if the failure handler is built.</p>
|
||||
<h4 id="test_mode">TEST_MODE</h4>
|
||||
<p>The test mode (<code>agentvm</code> or <code>othervm</code>).</p>
|
||||
<p>Defaults to <code>agentvm</code>.</p>
|
||||
<h4 id="assert">ASSERT</h4>
|
||||
<p>Enable asserts (<code>-ea -esa</code>, or none).</p>
|
||||
<p>Set to <code>true</code> or <code>false</code>. If true, adds
|
||||
<code>-ea -esa</code>. Defaults to true, except for hotspot.</p>
|
||||
<p>Set to <code>true</code> or <code>false</code>. If true, adds <code>-ea -esa</code>. Defaults to true, except for hotspot.</p>
|
||||
<h4 id="verbose">VERBOSE</h4>
|
||||
<p>The verbosity level (<code>-verbose</code>).</p>
|
||||
<p>Defaults to <code>fail,error,summary</code>.</p>
|
||||
@@ -448,200 +166,90 @@ class creates a new virtual thread for executing each test class.</p>
|
||||
<p>What test data to retain (<code>-retain</code>).</p>
|
||||
<p>Defaults to <code>fail,error</code>.</p>
|
||||
<h4 id="max_mem">MAX_MEM</h4>
|
||||
<p>Limit memory consumption (<code>-Xmx</code> and
|
||||
<code>-vmoption:-Xmx</code>, or none).</p>
|
||||
<p>Limit memory consumption for JTReg test framework and VM under test.
|
||||
Set to 0 to disable the limits.</p>
|
||||
<p>Defaults to 512m, except for hotspot, where it defaults to 0 (no
|
||||
limit).</p>
|
||||
<p>Limit memory consumption (<code>-Xmx</code> and <code>-vmoption:-Xmx</code>, or none).</p>
|
||||
<p>Limit memory consumption for JTReg test framework and VM under test. Set to 0 to disable the limits.</p>
|
||||
<p>Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).</p>
|
||||
<h4 id="max_output">MAX_OUTPUT</h4>
|
||||
<p>Set the property <code>javatest.maxOutputSize</code> for the
|
||||
launcher, to change the default JTReg log limit.</p>
|
||||
<p>Set the property <code>javatest.maxOutputSize</code> for the launcher, to change the default JTReg log limit.</p>
|
||||
<h4 id="keywords">KEYWORDS</h4>
|
||||
<p>JTReg keywords sent to JTReg using <code>-k</code>. Please be careful
|
||||
in making sure that spaces and special characters (like <code>!</code>)
|
||||
are properly quoted. To avoid some issues, the special value
|
||||
<code>%20</code> can be used instead of space.</p>
|
||||
<p>JTReg keywords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
|
||||
<h4 id="extra_problem_lists">EXTRA_PROBLEM_LISTS</h4>
|
||||
<p>Use additional problem lists file or files, in addition to the
|
||||
default ProblemList.txt located at the JTReg test roots.</p>
|
||||
<p>If multiple file names are specified, they should be separated by
|
||||
space (or, to help avoid quoting issues, the special value
|
||||
<code>%20</code>).</p>
|
||||
<p>The file names should be either absolute, or relative to the JTReg
|
||||
test root of the tests to be run.</p>
|
||||
<p>Use additional problem lists file or files, in addition to the default ProblemList.txt located at the JTReg test roots.</p>
|
||||
<p>If multiple file names are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
|
||||
<p>The file names should be either absolute, or relative to the JTReg test root of the tests to be run.</p>
|
||||
<h4 id="run_problem_lists">RUN_PROBLEM_LISTS</h4>
|
||||
<p>Use the problem lists to select tests instead of excluding them.</p>
|
||||
<p>Set to <code>true</code> or <code>false</code>. If <code>true</code>,
|
||||
JTReg will use <code>-match:</code> option, otherwise
|
||||
<code>-exclude:</code> will be used. Default is <code>false</code>.</p>
|
||||
<p>Set to <code>true</code> or <code>false</code>. If <code>true</code>, JTReg will use <code>-match:</code> option, otherwise <code>-exclude:</code> will be used. Default is <code>false</code>.</p>
|
||||
<h4 id="options">OPTIONS</h4>
|
||||
<p>Additional options to the JTReg test framework.</p>
|
||||
<p>Use <code>JTREG="OPTIONS=--help all"</code> to see all available
|
||||
JTReg options.</p>
|
||||
<p>Use <code>JTREG="OPTIONS=--help all"</code> to see all available JTReg options.</p>
|
||||
<h4 id="java_options-1">JAVA_OPTIONS</h4>
|
||||
<p>Additional Java options for running test classes (sent to JTReg as
|
||||
<code>-javaoption</code>).</p>
|
||||
<p>Additional Java options for running test classes (sent to JTReg as <code>-javaoption</code>).</p>
|
||||
<h4 id="vm_options-1">VM_OPTIONS</h4>
|
||||
<p>Additional Java options to be used when compiling and running classes
|
||||
(sent to JTReg as <code>-vmoption</code>).</p>
|
||||
<p>This option is only needed in special circumstances. To pass Java
|
||||
options to your test classes, use <code>JAVA_OPTIONS</code>.</p>
|
||||
<p>Additional Java options to be used when compiling and running classes (sent to JTReg as <code>-vmoption</code>).</p>
|
||||
<p>This option is only needed in special circumstances. To pass Java options to your test classes, use <code>JAVA_OPTIONS</code>.</p>
|
||||
<h4 id="launcher_options">LAUNCHER_OPTIONS</h4>
|
||||
<p>Additional Java options that are sent to the java launcher that
|
||||
starts the JTReg harness.</p>
|
||||
<p>Additional Java options that are sent to the java launcher that starts the JTReg harness.</p>
|
||||
<h4 id="aot_modules-1">AOT_MODULES</h4>
|
||||
<p>Generate AOT modules before testing for the specified module, or set
|
||||
of modules. If multiple modules are specified, they should be separated
|
||||
by space (or, to help avoid quoting issues, the special value
|
||||
<code>%20</code>).</p>
|
||||
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
|
||||
<h4 id="retry_count">RETRY_COUNT</h4>
|
||||
<p>Retry failed tests up to a set number of times, until they pass. This
|
||||
allows to pass the tests with intermittent failures. Defaults to 0.</p>
|
||||
<p>Retry failed tests up to a set number of times, until they pass. This allows to pass the tests with intermittent failures. Defaults to 0.</p>
|
||||
<h4 id="repeat_count">REPEAT_COUNT</h4>
|
||||
<p>Repeat the tests up to a set number of times, stopping at first
|
||||
failure. This helps to reproduce intermittent test failures. Defaults to
|
||||
0.</p>
|
||||
<h4 id="report">REPORT</h4>
|
||||
<p>Use this report style when reporting test results (sent to JTReg as
|
||||
<code>-report</code>). Defaults to <code>files</code>.</p>
|
||||
<p>Repeat the tests up to a set number of times, stopping at first failure. This helps to reproduce intermittent test failures. Defaults to 0.</p>
|
||||
<h3 id="gtest-keywords">Gtest keywords</h3>
|
||||
<h4 id="repeat">REPEAT</h4>
|
||||
<p>The number of times to repeat the tests
|
||||
(<code>--gtest_repeat</code>).</p>
|
||||
<p>Default is 1. Set to -1 to repeat indefinitely. This can be
|
||||
especially useful combined with
|
||||
<code>OPTIONS=--gtest_break_on_failure</code> to reproduce an
|
||||
intermittent problem.</p>
|
||||
<p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p>
|
||||
<p>Default is 1. Set to -1 to repeat indefinitely. This can be especially useful combined with <code>OPTIONS=--gtest_break_on_failure</code> to reproduce an intermittent problem.</p>
|
||||
<h4 id="options-1">OPTIONS</h4>
|
||||
<p>Additional options to the Gtest test framework.</p>
|
||||
<p>Use <code>GTEST="OPTIONS=--help"</code> to see all available Gtest
|
||||
options.</p>
|
||||
<p>Use <code>GTEST="OPTIONS=--help"</code> to see all available Gtest options.</p>
|
||||
<h4 id="aot_modules-2">AOT_MODULES</h4>
|
||||
<p>Generate AOT modules before testing for the specified module, or set
|
||||
of modules. If multiple modules are specified, they should be separated
|
||||
by space (or, to help avoid quoting issues, the special value
|
||||
<code>%20</code>).</p>
|
||||
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
|
||||
<h3 id="microbenchmark-keywords">Microbenchmark keywords</h3>
|
||||
<h4 id="fork">FORK</h4>
|
||||
<p>Override the number of benchmark forks to spawn. Same as specifying
|
||||
<code>-f <num></code>.</p>
|
||||
<p>Override the number of benchmark forks to spawn. Same as specifying <code>-f <num></code>.</p>
|
||||
<h4 id="iter">ITER</h4>
|
||||
<p>Number of measurement iterations per fork. Same as specifying
|
||||
<code>-i <num></code>.</p>
|
||||
<p>Number of measurement iterations per fork. Same as specifying <code>-i <num></code>.</p>
|
||||
<h4 id="time">TIME</h4>
|
||||
<p>Amount of time to spend in each measurement iteration, in seconds.
|
||||
Same as specifying <code>-r <num></code></p>
|
||||
<p>Amount of time to spend in each measurement iteration, in seconds. Same as specifying <code>-r <num></code></p>
|
||||
<h4 id="warmup_iter">WARMUP_ITER</h4>
|
||||
<p>Number of warmup iterations to run before the measurement phase in
|
||||
each fork. Same as specifying <code>-wi <num></code>.</p>
|
||||
<p>Number of warmup iterations to run before the measurement phase in each fork. Same as specifying <code>-wi <num></code>.</p>
|
||||
<h4 id="warmup_time">WARMUP_TIME</h4>
|
||||
<p>Amount of time to spend in each warmup iteration. Same as specifying
|
||||
<code>-w <num></code>.</p>
|
||||
<p>Amount of time to spend in each warmup iteration. Same as specifying <code>-w <num></code>.</p>
|
||||
<h4 id="results_format">RESULTS_FORMAT</h4>
|
||||
<p>Specify to have the test run save a log of the values. Accepts the
|
||||
same values as <code>-rff</code>, i.e., <code>text</code>,
|
||||
<code>csv</code>, <code>scsv</code>, <code>json</code>, or
|
||||
<code>latex</code>.</p>
|
||||
<p>Specify to have the test run save a log of the values. Accepts the same values as <code>-rff</code>, i.e., <code>text</code>, <code>csv</code>, <code>scsv</code>, <code>json</code>, or <code>latex</code>.</p>
|
||||
<h4 id="vm_options-2">VM_OPTIONS</h4>
|
||||
<p>Additional VM arguments to provide to forked off VMs. Same as
|
||||
<code>-jvmArgs <args></code></p>
|
||||
<p>Additional VM arguments to provide to forked off VMs. Same as <code>-jvmArgs <args></code></p>
|
||||
<h4 id="options-2">OPTIONS</h4>
|
||||
<p>Additional arguments to send to JMH.</p>
|
||||
<h2 id="notes-for-specific-tests">Notes for Specific Tests</h2>
|
||||
<h3 id="docker-tests">Docker Tests</h3>
|
||||
<p>Docker tests with default parameters may fail on systems with glibc
|
||||
versions not compatible with the one used in the default docker image
|
||||
(e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04
|
||||
but fail on Ubuntu 18.04 if run like this on x86:</p>
|
||||
<p>Docker tests with default parameters may fail on systems with glibc versions not compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:</p>
|
||||
<pre><code>$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker"</code></pre>
|
||||
<p>To run these tests correctly, additional parameters for the correct
|
||||
docker image are required on Ubuntu 18.04 by using
|
||||
<code>JAVA_OPTIONS</code>.</p>
|
||||
<p>To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using <code>JAVA_OPTIONS</code>.</p>
|
||||
<pre><code>$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" \
|
||||
JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu
|
||||
-Djdk.test.docker.image.version=latest"</code></pre>
|
||||
<h3 id="non-us-locale">Non-US locale</h3>
|
||||
<p>If your locale is non-US, some tests are likely to fail. To work
|
||||
around this you can set the locale to US. On Unix platforms simply
|
||||
setting <code>LANG="en_US"</code> in the environment before running
|
||||
tests should work. On Windows or MacOS, setting
|
||||
<code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code>
|
||||
helps for most, but not all test cases.</p>
|
||||
<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG="en_US"</code> in the environment before running tests should work. On Windows or MacOS, setting <code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code> helps for most, but not all test cases.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code>$ export LANG="en_US" && make test TEST=...
|
||||
$ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...</code></pre>
|
||||
<h3 id="pkcs11-tests">PKCS11 Tests</h3>
|
||||
<p>It is highly recommended to use the latest NSS version when running
|
||||
PKCS11 tests. Improper NSS version may lead to unexpected failures which
|
||||
are hard to diagnose. For example,
|
||||
sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04
|
||||
with the default NSS version in the system. To run these tests
|
||||
correctly, the system property <code>test.nss.lib.paths</code> is
|
||||
required on Ubuntu 18.04 to specify the alternative NSS lib
|
||||
directories.</p>
|
||||
<p>It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests correctly, the system property <code>test.nss.lib.paths</code> is required on Ubuntu 18.04 to specify the alternative NSS lib directories.</p>
|
||||
<p>For example:</p>
|
||||
<pre><code>$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
|
||||
JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"</code></pre>
|
||||
<p>For more notes about the PKCS11 tests, please refer to
|
||||
test/jdk/sun/security/pkcs11/README.</p>
|
||||
<p>For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.</p>
|
||||
<h3 id="client-ui-tests">Client UI Tests</h3>
|
||||
<h4 id="system-key-shortcuts">System key shortcuts</h4>
|
||||
<p>Some Client UI tests use key sequences which may be reserved by the
|
||||
operating system. Usually that causes the test failure. So it is highly
|
||||
recommended to disable system key shortcuts prior testing. The steps to
|
||||
access and disable system key shortcuts for various platforms are
|
||||
provided below.</p>
|
||||
<h5 id="macos">macOS</h5>
|
||||
<p>Choose Apple menu; System Preferences, click Keyboard, then click
|
||||
Shortcuts; select or deselect desired shortcut.</p>
|
||||
<p>For example,
|
||||
test/jdk/javax/swing/TooltipManager/JMenuItemToolTipKeyBindingsTest/JMenuItemToolTipKeyBindingsTest.java
|
||||
fails on MacOS because it uses <code>CTRL + F1</code> key sequence to
|
||||
show or hide tooltip message but the key combination is reserved by the
|
||||
operating system. To run the test correctly the default global key
|
||||
shortcut should be disabled using the steps described above, and then
|
||||
deselect "Turn keyboard access on or off" option which is responsible
|
||||
for <code>CTRL + F1</code> combination.</p>
|
||||
<h5 id="linux">Linux</h5>
|
||||
<p>Open the Activities overview and start typing Settings; Choose
|
||||
Settings, click Devices, then click Keyboard; set or override desired
|
||||
shortcut.</p>
|
||||
<h5 id="windows">Windows</h5>
|
||||
<p>Type <code>gpedit</code> in the Search and then click Edit group
|
||||
policy; navigate to User Configuration -> Administrative Templates
|
||||
-> Windows Components -> File Explorer; in the right-side pane
|
||||
look for "Turn off Windows key hotkeys" and double click on it; enable
|
||||
or disable hotkeys.</p>
|
||||
<p>Some Client UI tests use key sequences which may be reserved by the operating system. Usually that causes the test failure. So it is highly recommended to disable system key shortcuts prior testing. The steps to access and disable system key shortcuts for various platforms are provided below.</p>
|
||||
<h4 id="macos">MacOS</h4>
|
||||
<p>Choose Apple menu; System Preferences, click Keyboard, then click Shortcuts; select or deselect desired shortcut.</p>
|
||||
<p>For example, test/jdk/javax/swing/TooltipManager/JMenuItemToolTipKeyBindingsTest/JMenuItemToolTipKeyBindingsTest.java fails on MacOS because it uses <code>CTRL + F1</code> key sequence to show or hide tooltip message but the key combination is reserved by the operating system. To run the test correctly the default global key shortcut should be disabled using the steps described above, and then deselect "Turn keyboard access on or off" option which is responsible for <code>CTRL + F1</code> combination.</p>
|
||||
<h4 id="linux">Linux</h4>
|
||||
<p>Open the Activities overview and start typing Settings; Choose Settings, click Devices, then click Keyboard; set or override desired shortcut.</p>
|
||||
<h4 id="windows">Windows</h4>
|
||||
<p>Type <code>gpedit</code> in the Search and then click Edit group policy; navigate to User Configuration -> Administrative Templates -> Windows Components -> File Explorer; in the right-side pane look for "Turn off Windows key hotkeys" and double click on it; enable or disable hotkeys.</p>
|
||||
<p>Note: restart is required to make the settings take effect.</p>
|
||||
<h4 id="robot-api">Robot API</h4>
|
||||
<p>Most automated Client UI tests use <code>Robot</code> API to control
|
||||
the UI. Usually, the default operating system settings need to be
|
||||
adjusted for Robot to work correctly. The detailed steps how to access
|
||||
and update these settings for different platforms are provided
|
||||
below.</p>
|
||||
<h5 id="macos-1">macOS</h5>
|
||||
<p><code>Robot</code> is not permitted to control your Mac by default
|
||||
since macOS 10.15. To allow it, choose Apple menu -> System Settings,
|
||||
click Privacy & Security; then click Accessibility and ensure the
|
||||
following apps are allowed to control your computer: <em>Java</em> and
|
||||
<em>Terminal</em>. If the tests are run from an IDE, the IDE should be
|
||||
granted this permission too.</p>
|
||||
<h5 id="windows-1">Windows</h5>
|
||||
<p>On Windows if Cygwin terminal is used to run the tests, there is a
|
||||
delay in focus transfer. Usually it causes automated UI test failure. To
|
||||
disable the delay, type <code>regedit</code> in the Search and then
|
||||
select Registry Editor; navigate to the following key:
|
||||
<code>HKEY_CURRENT_USER\Control Panel\Desktop</code>; make sure the
|
||||
<code>ForegroundLockTimeout</code> value is set to 0.</p>
|
||||
<p>Additional information about Client UI tests configuration for
|
||||
various operating systems can be obtained at <a
|
||||
href="https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements">Automated
|
||||
client GUI testing system set up requirements</a></p>
|
||||
<h2 id="editing-this-document">Editing this document</h2>
|
||||
<p>If you want to contribute changes to this document, edit
|
||||
<code>doc/testing.md</code> and then run
|
||||
<code>make update-build-docs</code> to generate the same changes in
|
||||
<code>doc/testing.html</code>.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
204
doc/testing.md
204
doc/testing.md
@@ -1,26 +1,21 @@
|
||||
% Testing the JDK
|
||||
|
||||
## Overview
|
||||
## Using "make test" (the run-test framework)
|
||||
|
||||
The bulk of JDK tests use [jtreg](https://openjdk.org/jtreg/), a regression
|
||||
test framework and test runner built for the JDK's specific needs. Other test
|
||||
frameworks are also used. The different test frameworks can be executed
|
||||
directly, but there is also a set of make targets intended to simplify the
|
||||
interface, and figure out how to run your tests for you.
|
||||
This new way of running tests is developer-centric. It assumes that you have
|
||||
built a JDK locally and want to test it. Running common test targets is simple,
|
||||
and more complex ad-hoc combination of tests is possible. The user interface is
|
||||
forgiving, and clearly report errors it cannot resolve.
|
||||
|
||||
## Running tests locally with `make test`
|
||||
The main target `test` uses the jdk-image as the tested product. There is
|
||||
also an alternate target `exploded-test` that uses the exploded image
|
||||
instead. Not all tests will run successfully on the exploded image, but using
|
||||
this target can greatly improve rebuild times for certain workflows.
|
||||
|
||||
This is the easiest way to get started. Assuming you've built the JDK locally,
|
||||
execute:
|
||||
|
||||
$ make test
|
||||
|
||||
This will run a default set of tests against the JDK, and present you with the
|
||||
results. `make test` is part of a family of test-related make targets which
|
||||
simplify running tests, because they invoke the various test frameworks for
|
||||
you. The "make test framework" is simple to start with, but more complex
|
||||
ad-hoc combination of tests is also possible. You can always invoke the test
|
||||
frameworks directly if you want even more control.
|
||||
Previously, `make test` was used to invoke an old system for running tests, and
|
||||
`make run-test` was used for the new test framework. For backward compatibility
|
||||
with scripts and muscle memory, `run-test` (and variants like
|
||||
`exploded-run-test` or `run-test-tier1`) are kept as aliases.
|
||||
|
||||
Some example command-lines:
|
||||
|
||||
@@ -33,20 +28,6 @@ Some example command-lines:
|
||||
$ make test TEST="micro:java.lang.reflect" MICRO="FORK=1;WARMUP_ITER=2"
|
||||
$ make exploded-test TEST=tier2
|
||||
|
||||
"tier1" and "tier2" refer to tiered testing, see further down. "TEST" is a
|
||||
test selection argument which the make test framework will use to try to
|
||||
find the tests you want. It iterates over the available test frameworks, and
|
||||
if the test isn't present in one, it tries the next one. The main target
|
||||
`test` uses the jdk-image as the tested product. There is also an alternate
|
||||
target `exploded-test` that uses the exploded image instead. Not all tests
|
||||
will run successfully on the exploded image, but using this target can
|
||||
greatly improve rebuild times for certain workflows.
|
||||
|
||||
Previously, `make test` was used to invoke an old system for running tests,
|
||||
and `make run-test` was used for the new test framework. For backward
|
||||
compatibility with scripts and muscle memory, `run-test` and variants like
|
||||
`exploded-run-test` or `run-test-tier1` are kept as aliases.
|
||||
|
||||
### Configuration
|
||||
|
||||
To be able to run JTReg tests, `configure` needs to know where to find the
|
||||
@@ -62,31 +43,6 @@ containing the core JMH and transitive dependencies. The recommended
|
||||
dependencies can be retrieved by running `sh make/devkit/createJMHBundle.sh`,
|
||||
after which `--with-jmh=build/jmh/jars` should work.
|
||||
|
||||
When tests fail or timeout, jtreg runs its failure handler to capture necessary
|
||||
data from the system where the test was run. This data can then be used to
|
||||
analyze the test failures. Collecting this data involves running various commands
|
||||
(which are listed in files residing in `test/failure_handler/src/share/conf`)
|
||||
and some of these commands use `sudo`. If the system's `sudoers` file isn't
|
||||
configured to allow running these commands, then it can result in password being
|
||||
prompted during the failure handler execution. Typically, when running locally,
|
||||
collecting this additional data isn't always necessary. To disable running the
|
||||
failure handler, use `--enable-jtreg-failure-handler=no` when running `configure`.
|
||||
If, however, you want to let the failure handler to run and don't want to be
|
||||
prompted for sudo password, then you can configure your `sudoers` file
|
||||
appropriately. Please read the necessary documentation of your operating system
|
||||
to see how to do that; here we only show one possible way of doing that - edit
|
||||
the `/etc/sudoers.d/sudoers` file to include the following line:
|
||||
|
||||
```
|
||||
johndoe ALL=(ALL) NOPASSWD: /sbin/dmesg
|
||||
```
|
||||
|
||||
This line configures `sudo` to _not_ prompt for password for the `/sbin/dmesg`
|
||||
command (this is one of the commands that is listed in the files
|
||||
at `test/failure_handler/src/share/conf`), for the user `johndoe`. Here `johndoe`
|
||||
is the user account under which the jtreg tests are run. Replace the username
|
||||
with a relevant user account of your system.
|
||||
|
||||
## Test selection
|
||||
|
||||
All functionality is available using the `test` make target. In this use case,
|
||||
@@ -110,60 +66,54 @@ if you want to shortcut the parser.
|
||||
|
||||
### Common Test Groups
|
||||
|
||||
Ideally, all tests are run for every change but this may not be practical due
|
||||
to the limited testing resources, the scope of the change, etc.
|
||||
Ideally, all tests are run for every change but this may not be practical due to the limited
|
||||
testing resources, the scope of the change, etc.
|
||||
|
||||
The source tree currently defines a few common test groups in the relevant
|
||||
`TEST.groups` files. There are test groups that cover a specific component,
|
||||
for example `hotspot_gc`. It is a good idea to look into `TEST.groups` files
|
||||
to get a sense what tests are relevant to a particular JDK component.
|
||||
The source tree currently defines a few common test groups in the relevant `TEST.groups`
|
||||
files. There are test groups that cover a specific component, for example `hotspot_gc`.
|
||||
It is a good idea to look into `TEST.groups` files to get a sense what tests are relevant
|
||||
to a particular JDK component.
|
||||
|
||||
Component-specific tests may miss some unintended consequences of a change, so
|
||||
other tests should also be run. Again, it might be impractical to run all
|
||||
tests, and therefore
|
||||
_tiered_ test groups exist. Tiered test groups are not component-specific, but
|
||||
rather cover the significant parts of the entire JDK.
|
||||
Component-specific tests may miss some unintended consequences of a change, so other
|
||||
tests should also be run. Again, it might be impractical to run all tests, and therefore
|
||||
_tiered_ test groups exist. Tiered test groups are not component-specific, but rather cover
|
||||
the significant parts of the entire JDK.
|
||||
|
||||
Multiple tiers allow balancing test coverage and testing costs. Lower test
|
||||
tiers are supposed to contain the simpler, quicker and more stable tests.
|
||||
Higher tiers are supposed to contain progressively more thorough, slower, and
|
||||
sometimes less stable tests, or the tests that require special
|
||||
configuration.
|
||||
Multiple tiers allow balancing test coverage and testing costs. Lower test tiers are supposed to
|
||||
contain the simpler, quicker and more stable tests. Higher tiers are supposed to contain
|
||||
progressively more thorough, slower, and sometimes less stable tests, or the tests that require
|
||||
special configuration.
|
||||
|
||||
Contributors are expected to run the tests for the areas that are changed, and
|
||||
the first N tiers they can afford to run, but at least tier1.
|
||||
Contributors are expected to run the tests for the areas that are changed, and the first N tiers
|
||||
they can afford to run, but at least tier1.
|
||||
|
||||
A brief description of the tiered test groups:
|
||||
|
||||
- `tier1`: This is the lowest test tier. Multiple developers run these tests
|
||||
every day. Because of the widespread use, the tests in `tier1` are
|
||||
carefully selected and optimized to run fast, and to run in the most stable
|
||||
manner. The test failures in `tier1` are usually followed up on quickly,
|
||||
either with fixes, or adding relevant tests to problem list. GitHub Actions
|
||||
workflows, if enabled, run `tier1` tests.
|
||||
- `tier1`: This is the lowest test tier. Multiple developers run these tests every day.
|
||||
Because of the widespread use, the tests in `tier1` are carefully selected and optimized to run
|
||||
fast, and to run in the most stable manner. The test failures in `tier1` are usually followed up
|
||||
on quickly, either with fixes, or adding relevant tests to problem list. GitHub Actions workflows,
|
||||
if enabled, run `tier1` tests.
|
||||
|
||||
- `tier2`: This test group covers even more ground. These contain, among other
|
||||
things, tests that either run for too long to be at `tier1`, or may require
|
||||
special configuration, or tests that are less stable, or cover the broader
|
||||
range of non-core JVM and JDK features/components(for example, XML).
|
||||
- `tier2`: This test group covers even more ground. These contain, among other things,
|
||||
tests that either run for too long to be at `tier1`, or may require special configuration,
|
||||
or tests that are less stable, or cover the broader range of non-core JVM and JDK features/components
|
||||
(for example, XML).
|
||||
|
||||
- `tier3`: This test group includes more stressful tests, the tests for corner
|
||||
cases not covered by previous tiers, plus the tests that require GUIs. As
|
||||
such, this suite should either be run with low concurrency
|
||||
(`TEST_JOBS=1`), or without headful tests(`JTREG_KEYWORDS=\!headful`), or
|
||||
both.
|
||||
- `tier3`: This test group includes more stressful tests, the tests for corner cases
|
||||
not covered by previous tiers, plus the tests that require GUIs. As such, this suite
|
||||
should either be run with low concurrency (`TEST_JOBS=1`), or without headful tests
|
||||
(`JTREG_KEYWORDS=\!headful`), or both.
|
||||
|
||||
- `tier4`: This test group includes every other test not covered by previous
|
||||
tiers. It includes, for example, `vmTestbase` suites for Hotspot, which run
|
||||
for many hours even on large machines. It also runs GUI tests, so the same
|
||||
`TEST_JOBS` and `JTREG_KEYWORDS` caveats apply.
|
||||
- `tier4`: This test group includes every other test not covered by previous tiers. It includes,
|
||||
for example, `vmTestbase` suites for Hotspot, which run for many hours even on large
|
||||
machines. It also runs GUI tests, so the same `TEST_JOBS` and `JTREG_KEYWORDS` caveats
|
||||
apply.
|
||||
|
||||
### JTReg
|
||||
|
||||
JTReg tests can be selected either by picking a JTReg test group, or a selection
|
||||
of files or directories containing JTReg tests. Documentation can be found at
|
||||
[https://openjdk.org/jtreg/](https://openjdk.org/jtreg/), note especially the
|
||||
extensive [FAQ](https://openjdk.org/jtreg/faq.html).
|
||||
of files or directories containing JTReg tests.
|
||||
|
||||
JTReg test groups can be specified either without a test root, e.g. `:tier1`
|
||||
(or `tier1`, the initial colon is optional), or with, e.g. `hotspot:tier1`,
|
||||
@@ -192,11 +142,6 @@ use a fully qualified test descriptor, add `jtreg:`, e.g.
|
||||
|
||||
### Gtest
|
||||
|
||||
**Note:** To be able to run the Gtest suite, you need to configure your build to
|
||||
be able to find a proper version of the gtest source. For details, see the
|
||||
section ["Running Tests" in the build
|
||||
documentation](building.html#running-tests).
|
||||
|
||||
Since the Hotspot Gtest suite is so quick, the default is to run all tests.
|
||||
This is specified by just `gtest`, or as a fully qualified test descriptor
|
||||
`gtest:all`.
|
||||
@@ -378,15 +323,6 @@ Defaults to 4.
|
||||
Sets the argument `-timeoutHandlerTimeout` for JTReg. The default value is 0.
|
||||
This is only valid if the failure handler is built.
|
||||
|
||||
#### JTREG_TEST_THREAD_FACTORY
|
||||
|
||||
Sets the `-testThreadFactory` for JTReg. It should be the fully qualified classname
|
||||
of a class which implements `java.util.concurrent.ThreadFactory`.
|
||||
One such implementation class, named Virtual, is currently part of the JDK build
|
||||
in the `test/jtreg_test_thread_factory/` directory. This class gets compiled during
|
||||
the test image build. The implementation of the Virtual class creates a new virtual
|
||||
thread for executing each test class.
|
||||
|
||||
#### TEST_MODE
|
||||
|
||||
The test mode (`agentvm` or `othervm`).
|
||||
@@ -493,11 +429,6 @@ Repeat the tests up to a set number of times, stopping at first failure.
|
||||
This helps to reproduce intermittent test failures.
|
||||
Defaults to 0.
|
||||
|
||||
#### REPORT
|
||||
|
||||
Use this report style when reporting test results (sent to JTReg as `-report`).
|
||||
Defaults to `files`.
|
||||
|
||||
### Gtest keywords
|
||||
|
||||
#### REPEAT
|
||||
@@ -615,14 +546,12 @@ test/jdk/sun/security/pkcs11/README.
|
||||
|
||||
### Client UI Tests
|
||||
|
||||
#### System key shortcuts
|
||||
|
||||
Some Client UI tests use key sequences which may be reserved by the operating
|
||||
system. Usually that causes the test failure. So it is highly recommended to
|
||||
disable system key shortcuts prior testing. The steps to access and disable
|
||||
system key shortcuts for various platforms are provided below.
|
||||
|
||||
##### macOS
|
||||
#### MacOS
|
||||
|
||||
Choose Apple menu; System Preferences, click Keyboard, then click Shortcuts;
|
||||
select or deselect desired shortcut.
|
||||
@@ -635,12 +564,12 @@ test correctly the default global key shortcut should be disabled using the
|
||||
steps described above, and then deselect "Turn keyboard access on or off"
|
||||
option which is responsible for `CTRL + F1` combination.
|
||||
|
||||
##### Linux
|
||||
#### Linux
|
||||
|
||||
Open the Activities overview and start typing Settings; Choose Settings, click
|
||||
Devices, then click Keyboard; set or override desired shortcut.
|
||||
|
||||
##### Windows
|
||||
#### Windows
|
||||
|
||||
Type `gpedit` in the Search and then click Edit group policy; navigate to User
|
||||
Configuration -> Administrative Templates -> Windows Components -> File
|
||||
@@ -649,39 +578,6 @@ double click on it; enable or disable hotkeys.
|
||||
|
||||
Note: restart is required to make the settings take effect.
|
||||
|
||||
#### Robot API
|
||||
|
||||
Most automated Client UI tests use `Robot` API to control the UI. Usually,
|
||||
the default operating system settings need to be adjusted for Robot
|
||||
to work correctly. The detailed steps how to access and update these settings
|
||||
for different platforms are provided below.
|
||||
|
||||
##### macOS
|
||||
|
||||
`Robot` is not permitted to control your Mac by default since
|
||||
macOS 10.15. To allow it, choose Apple menu -> System Settings, click
|
||||
Privacy & Security; then click Accessibility and ensure the following apps are
|
||||
allowed to control your computer: *Java* and *Terminal*. If the tests are run
|
||||
from an IDE, the IDE should be granted this permission too.
|
||||
|
||||
##### Windows
|
||||
|
||||
On Windows if Cygwin terminal is used to run the tests, there is a delay in
|
||||
focus transfer. Usually it causes automated UI test failure. To disable the
|
||||
delay, type `regedit` in the Search and then select Registry Editor; navigate
|
||||
to the following key: `HKEY_CURRENT_USER\Control Panel\Desktop`; make sure
|
||||
the `ForegroundLockTimeout` value is set to 0.
|
||||
|
||||
Additional information about Client UI tests configuration for various operating
|
||||
systems can be obtained at [Automated client GUI testing system set up
|
||||
requirements](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements)
|
||||
|
||||
## Editing this document
|
||||
|
||||
If you want to contribute changes to this document, edit `doc/testing.md` and
|
||||
then run `make update-build-docs` to generate the same changes in
|
||||
`doc/testing.html`.
|
||||
|
||||
---
|
||||
# Override some definitions in the global css file that are not optimal for
|
||||
# this document.
|
||||
|
||||
238
jb/branchdiff.py
238
jb/branchdiff.py
@@ -1,238 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import os.path
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
|
||||
def fatal(msg):
|
||||
sys.stderr.write(f"[fatal] {msg}\n")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def verbose(options, *msg):
|
||||
if options.verbose:
|
||||
sys.stderr.write(f"[verbose] ")
|
||||
sys.stderr.write(*msg)
|
||||
sys.stderr.write('\n')
|
||||
|
||||
|
||||
def first_line(str):
|
||||
return "" if not str else str.splitlines()[0]
|
||||
|
||||
|
||||
class Options:
|
||||
def __init__(self):
|
||||
ap = argparse.ArgumentParser(description="Show commit differences between branches of JBR git repos",
|
||||
epilog="Example: %(prog)s --from origin/jbr17 --to jbr17.b469 --path "
|
||||
"src/hotspot --limit 200")
|
||||
ap.add_argument('--jbr', dest='jbrpath', help='path to JBR git root', required=True)
|
||||
ap.add_argument('--from', dest='frombranch', help='branch to take commits from', required=True)
|
||||
ap.add_argument('--to', dest='tobranch', help='branch to apply new commits to', required=True)
|
||||
ap.add_argument('--path', dest='path', help='limit to changes in this path (relative to git root)')
|
||||
ap.add_argument('--limit', dest='limit', help='limit to this many log entries in --jdk repo', type=int, default=-1)
|
||||
ap.add_argument('--html', dest="ishtml", help="print out HTML rather than plain text", action='store_true')
|
||||
ap.add_argument('-o', dest="output", help="print the list of missing commits to this file"
|
||||
" to be used as exclude list later")
|
||||
ap.add_argument('--exclude', dest='exclude', help='exclude commits listed in the given file '
|
||||
'(can use edited -o output file as input here)')
|
||||
ap.add_argument('-v', dest='verbose', help="verbose output", default=False, action='store_true')
|
||||
args = ap.parse_args()
|
||||
|
||||
if not os.path.isdir(args.jbrpath):
|
||||
fatal(f"{args.jbrpath} not a directory")
|
||||
|
||||
if not git_is_available():
|
||||
fatal("can't run git commands; make sure git is in PATH")
|
||||
|
||||
self.frombranch = args.frombranch
|
||||
self.tobranch = args.tobranch
|
||||
self.jbrpath = args.jbrpath
|
||||
self.path = args.path
|
||||
self.limit = args.limit
|
||||
self.exclude = args.exclude
|
||||
self.output = args.output
|
||||
self.ishtml = args.ishtml
|
||||
self.verbose = args.verbose
|
||||
|
||||
class GitRepo:
|
||||
def __init__(self, rootpath):
|
||||
self.rootpath = rootpath
|
||||
|
||||
def run_git_cmd(self, git_args):
|
||||
args = ["git", "-C", self.rootpath]
|
||||
args.extend(git_args)
|
||||
# print(f"Runnig git cmd '{' '.join(args)}'")
|
||||
p = subprocess.run(args, capture_output=True, text=True)
|
||||
if p.returncode != 0:
|
||||
fatal(f"git returned non-zero code in {self.rootpath} ({first_line(p.stderr)})")
|
||||
return p.stdout
|
||||
|
||||
def save_git_cmd(self, fname, git_args):
|
||||
args = ["git", "-C", self.rootpath]
|
||||
args.extend(git_args)
|
||||
# print(f"Runnig git cmd '{' '.join(args)}'")
|
||||
with open(fname, "w") as stdout_file:
|
||||
p = subprocess.run(args, stdout=stdout_file)
|
||||
if p.returncode != 0:
|
||||
fatal(f"git returned non-zero code in {self.rootpath} ({first_line(p.stderr)})")
|
||||
|
||||
def current_branch(self):
|
||||
branch_name = self.run_git_cmd(["branch", "--show-current"]).strip()
|
||||
return branch_name
|
||||
|
||||
def log(self, branch, path=None, limit=None):
|
||||
cmds = ["log", "--no-decorate", branch]
|
||||
if limit:
|
||||
cmds.extend(["-n", str(limit)])
|
||||
if path:
|
||||
cmds.append(path)
|
||||
full_log = self.run_git_cmd(cmds)
|
||||
return full_log
|
||||
|
||||
|
||||
class Commit:
|
||||
def __init__(self, lines):
|
||||
self.sha = lines[0].split()[1]
|
||||
self.message = ""
|
||||
self.bugid = ""
|
||||
|
||||
# Commit message starts after one blank line
|
||||
read_message = False
|
||||
for l in lines:
|
||||
if read_message:
|
||||
self.message = l.strip()
|
||||
t = self.message.split(' ')
|
||||
if len(t) > 1:
|
||||
bugid = t[0]
|
||||
if bugid.startswith("fixup"):
|
||||
bugid = t[1]
|
||||
bugid = bugid.strip(":")
|
||||
if bugid.startswith("JBR-") or bugid.isnumeric():
|
||||
self.bugid = bugid
|
||||
break
|
||||
if not read_message and l == "":
|
||||
read_message = True
|
||||
|
||||
|
||||
class History:
|
||||
def __init__(self, log):
|
||||
log_itr = iter(log.splitlines())
|
||||
self.commits = []
|
||||
commit_lines = []
|
||||
for line in log_itr:
|
||||
if line.startswith("commit ") and len(commit_lines) > 0:
|
||||
commit = Commit(commit_lines)
|
||||
self.commits.append(commit)
|
||||
commit_lines = []
|
||||
commit_lines.append(line)
|
||||
|
||||
if len(commit_lines) > 0:
|
||||
commit = Commit(commit_lines)
|
||||
self.commits.append(commit)
|
||||
|
||||
def contains(self, str):
|
||||
return any(str in commit.message for commit in self.commits)
|
||||
|
||||
def size(self):
|
||||
return len(self.commits)
|
||||
|
||||
|
||||
def print_explanation(options, jbr):
|
||||
verbose(options, f"Reading history from '{jbr.rootpath}'")
|
||||
if options.path:
|
||||
verbose(options, f"\t(only under '{options.path}')")
|
||||
if options.limit > 0:
|
||||
verbose(options, f"\t(up to '{options.limit}' commits)")
|
||||
verbose(options, f"Searching for missing fixes in '{options.tobranch}' compared with '{options.frombranch}'")
|
||||
|
||||
|
||||
def git_is_available():
|
||||
p = None
|
||||
try:
|
||||
p = subprocess.run(["git", "--help"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
except:
|
||||
pass
|
||||
return p is not None and p.returncode == 0
|
||||
|
||||
|
||||
def main():
|
||||
check_python_min_requirements()
|
||||
options = Options()
|
||||
jbr = GitRepo(options.jbrpath)
|
||||
print_explanation(options, jbr)
|
||||
|
||||
commits_to_save = []
|
||||
try:
|
||||
log_from = jbr.log(options.frombranch, options.path, options.limit)
|
||||
log_to = jbr.log(options.tobranch, options.path, options.limit)
|
||||
history_from = History(log_from)
|
||||
history_to = History(log_to)
|
||||
|
||||
verbose(options, f"Read {history_from.size()} commits from '{options.frombranch}', {history_to.size()} from {options.tobranch}")
|
||||
|
||||
exclude_list=[]
|
||||
if options.exclude:
|
||||
with open(options.exclude, "r") as exclude_file:
|
||||
l = exclude_file.read().split('\n')
|
||||
exclude_list = list(filter(lambda line: not line.startswith("#"), l))
|
||||
|
||||
for c in history_from.commits:
|
||||
if c.message:
|
||||
verbose(options, f"Looking for commit '{c.message}'")
|
||||
if c.message in exclude_list:
|
||||
verbose(options, "...nope, in exclude list")
|
||||
continue
|
||||
if not history_to.contains(c.message):
|
||||
commits_to_save.append(c)
|
||||
except KeyboardInterrupt:
|
||||
fatal("Interrupted")
|
||||
|
||||
print_out_commits(options, commits_to_save)
|
||||
save_commits_to_file(commits_to_save, options)
|
||||
|
||||
|
||||
def save_commits_to_file(commits_to_save, options):
|
||||
if len(commits_to_save) > 0 and options.output:
|
||||
print()
|
||||
with open(options.output, "w") as out:
|
||||
for i, c in enumerate(reversed(commits_to_save)):
|
||||
print(f"# {c.sha}", file=out)
|
||||
print(c.message, file=out)
|
||||
|
||||
|
||||
def print_out_commits(options, commits_to_save):
|
||||
if options.ishtml:
|
||||
print("<html><body>")
|
||||
print(f"<p><b>Commits on <code>{options.frombranch}</code>"
|
||||
f" missing from <code>{options.tobranch}</code></b></p></h1>")
|
||||
if len(commits_to_save) > 0:
|
||||
for c in sorted(commits_to_save, key=lambda commit: commit.bugid):
|
||||
if options.ishtml:
|
||||
msg = c.message
|
||||
bugurl = ""
|
||||
if c.bugid:
|
||||
if c.bugid.isnumeric():
|
||||
bugurl = f"https://bugs.openjdk.org/browse/JDK-{c.bugid}"
|
||||
elif c.bugid.startswith("JBR-"):
|
||||
bugurl = f"https://youtrack.jetbrains.com/issue/{c.bugid}"
|
||||
|
||||
if len(bugurl) > 0:
|
||||
msg = msg.replace(c.bugid, f"<a href='{bugurl}'>{c.bugid}</a>")
|
||||
|
||||
sha = f"<a href='https://jetbrains.team/p/jbre/repositories/jbr/commits?commits={c.sha}'>" \
|
||||
f"{c.sha[0:8]}</a>"
|
||||
print(f"<li>{msg} ({sha})</li>")
|
||||
else:
|
||||
print(f"{c.message} ({c.sha[0:8]})")
|
||||
if options.ishtml:
|
||||
print("</body></html>")
|
||||
|
||||
def check_python_min_requirements():
|
||||
if sys.version_info < (3, 6):
|
||||
fatal("Minimum version 3.6 is required to run this script")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
13
jb/project/docker/Dockerfile
Normal file
13
jb/project/docker/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
# jetbrains/runtime:jbr15env
|
||||
FROM centos:7
|
||||
RUN yum -y install centos-release-scl
|
||||
RUN yum -y install devtoolset-8
|
||||
RUN yum -y install zip bzip2 unzip tar wget make autoconf automake libtool gcc gcc-c++ libstdc++-devel alsa-devel cups-devel xorg-x11-devel libjpeg62-devel giflib-devel freetype-devel file which libXtst-devel libXt-devel libXrender-devel alsa-lib-devel fontconfig-devel libXrandr-devel libXi-devel git
|
||||
# Install Java 16
|
||||
RUN wget https://cdn.azul.com/zulu/bin/zulu17.28.13-ca-jdk17.0.0-linux_x64.tar.gz \
|
||||
-O - | tar xz -C /
|
||||
RUN mv /zulu17.28.13-ca-jdk17.0.0-linux_x64 /jdk17.0.0
|
||||
ENV PATH /opt/rh/devtoolset-8/root/usr/bin:$PATH
|
||||
RUN mkdir .git
|
||||
RUN git config user.email "teamcity@jetbrains.com"
|
||||
RUN git config user.name "builduser"
|
||||
@@ -5,42 +5,44 @@
|
||||
# image creation reproducible.
|
||||
# NB: this also means there may be no security-related fixes there, need to
|
||||
# move the version to the next manually.
|
||||
|
||||
# jetbrains/runtime:jbr17env_aarch64
|
||||
FROM arm64v8/centos:7
|
||||
FROM arm64v8/ubuntu:focal-20211006
|
||||
|
||||
# Install the necessary build tools
|
||||
RUN yum -y update; \
|
||||
yum -y install centos-release-scl; \
|
||||
yum -y install devtoolset-10-10.1-0.el7; \
|
||||
yum -y install \
|
||||
alsa-lib-devel-1.1.8-1.el7.aarch64 \
|
||||
autoconf-2.69-11.el7.noarch \
|
||||
automake-1.13.4-3.el7.noarch \
|
||||
bzip2-1.0.6-13.el7.aarch64 \
|
||||
cups-devel-1.6.3-51.el7.aarch64 \
|
||||
file-5.11-37.el7.aarch64 \
|
||||
fontconfig-devel-2.13.0-4.3.el7.aarch64 \
|
||||
freetype-devel-2.8-14.el7_9.1.aarch64 \
|
||||
giflib-devel-4.1.6-9.el7.aarch64 \
|
||||
git-1.8.3.1-24.el7_9.aarch64 \
|
||||
libtool-2.4.2-22.el7_3.aarch64 \
|
||||
libXi-devel-1.7.9-1.el7.aarch64 \
|
||||
libXrandr-devel-1.5.1-2.el7.aarch64 \
|
||||
libXrender-devel-0.9.10-1.el7.aarch64 \
|
||||
libXt-devel-1.1.5-3.el7.aarch64 \
|
||||
libXtst-devel-1.2.3-1.el7.aarch64 \
|
||||
make-3.82-24.el7.aarch64 \
|
||||
rsync-3.1.2-12.el7_9.aarch64 \
|
||||
tar-1.26-35.el7.aarch64 \
|
||||
unzip-6.0-24.el7_9.aarch64 \
|
||||
wayland-devel-1.15.0-1.el7 \
|
||||
zip-3.0-11.el7.aarch64; \
|
||||
yum -y clean all
|
||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
export DEBCONF_NONINTERACTIVE_SEEN=true && \
|
||||
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
|
||||
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
|
||||
apt-get update -qy && \
|
||||
apt-get install -qy \
|
||||
autoconf \
|
||||
build-essential \
|
||||
bzip2 \
|
||||
file \
|
||||
g++-10=10.3.0-1ubuntu1~20.04 \
|
||||
gcc-10=10.3.0-1ubuntu1~20.04 \
|
||||
git \
|
||||
libasound2-dev \
|
||||
libcups2-dev \
|
||||
libfontconfig1-dev \
|
||||
libx11-dev \
|
||||
libxext-dev \
|
||||
libxrandr-dev \
|
||||
libxrender-dev \
|
||||
libxt-dev \
|
||||
libxtst-dev \
|
||||
make \
|
||||
rsync \
|
||||
tar \
|
||||
unzip \
|
||||
zip && \
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 && \
|
||||
apt-get clean -qy && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ENV PATH="/opt/rh/devtoolset-10/root/usr/bin:${PATH}"
|
||||
ENV LD_LIBRARY_PATH="/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib"
|
||||
ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig"
|
||||
# Set up boot JDK for building
|
||||
COPY boot_jdk.tar.gz /jdk17/
|
||||
RUN cd /jdk17 && tar --strip-components=1 -xzf boot_jdk.tar.gz && rm /jdk17/boot_jdk.tar.gz
|
||||
ENV BOOT_JDK=/jdk17
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# image creation reproducible.
|
||||
# NB: this also means there may be no security-related fixes there, need to
|
||||
# move the version to the next manually.
|
||||
FROM alpine:3.14
|
||||
FROM alpine:3.5
|
||||
|
||||
# Install the necessary build tools
|
||||
RUN apk --no-cache add --update bash grep tar zip bzip2 rsync fontconfig build-base \
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# jetbrains/runtime:jbr17env_x86_64
|
||||
FROM centos:7
|
||||
RUN yum -y install centos-release-scl; \
|
||||
yum -y install devtoolset-10-10.1-0.el7; \
|
||||
yum -y install \
|
||||
alsa-lib-devel-1.1.8-1.el7 \
|
||||
autoconf-2.69-11.el7 \
|
||||
automake-1.13.4-3.el7 \
|
||||
bzip2-1.0.6-13.el7 \
|
||||
cups-devel-1.6.3-51.el7 \
|
||||
file-5.11-37.el7 \
|
||||
fontconfig-devel-2.13.0-4.3.el7 \
|
||||
freetype-devel-2.8-14.el7_9.1 \
|
||||
giflib-devel-4.1.6-9.el7 \
|
||||
git-1.8.3.1-24.el7_9 \
|
||||
libtool-2.4.2-22.el7_3 \
|
||||
libXi-devel-1.7.9-1.el7 \
|
||||
libXrandr-devel-1.5.1-2.el7 \
|
||||
libXrender-devel-0.9.10-1.el7 \
|
||||
libXt-devel-1.1.5-3.el7 \
|
||||
libXtst-devel-1.2.3-1.el7 \
|
||||
make-3.82-24.el7 \
|
||||
tar-1.26-35.el7 \
|
||||
unzip-6.0-24.el7_9 \
|
||||
wayland-devel-1.15.0-1.el7 \
|
||||
wget-1.14-18.el7_6.1 \
|
||||
which-2.20-7.el7 \
|
||||
zip-3.0-11.el7
|
||||
|
||||
RUN mkdir .git && \
|
||||
git config user.email "teamcity@jetbrains.com" && \
|
||||
git config user.name "builduser"
|
||||
|
||||
ENV LD_LIBRARY_PATH="/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib"
|
||||
ENV PATH="/opt/rh/devtoolset-10/root/usr/bin::${PATH}"
|
||||
ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig"
|
||||
@@ -0,0 +1,3 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="JetBrains" />
|
||||
</component>
|
||||
9
jb/project/idea-project-files/jdk-clion/.idea/copyright/JetBrains.xml
generated
Normal file
9
jb/project/idea-project-files/jdk-clion/.idea/copyright/JetBrains.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="notice" value="Copyright 2000-&#36;today.year JetBrains s.r.o. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="allowReplaceKeyword" value="JetBrains" />
|
||||
<option name="myName" value="JetBrains" />
|
||||
<option name="myLocal" value="true" />
|
||||
</copyright>
|
||||
</component>
|
||||
3
jb/project/idea-project-files/jdk-clion/.idea/copyright/profiles_settings.xml
generated
Normal file
3
jb/project/idea-project-files/jdk-clion/.idea/copyright/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="JetBrains" />
|
||||
</component>
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin//bash
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
@@ -37,13 +37,11 @@ architecture=${3:-x64} # aarch64 or x64
|
||||
check_bundle_type_maketest
|
||||
|
||||
tag_prefix="jdk-"
|
||||
OPENJDK_TAG=$(git log --simplify-by-decoration --decorate=short --pretty=short | grep "$tag_prefix" | cut -d "(" -f2 | cut -d ")" -f1 | awk '{print $2}' | tr -d ',' | sort -t "-" -k 2 -g | tail -n 1)
|
||||
OPENJDK_TAG=$(git log --simplify-by-decoration --decorate=short --pretty=short | grep "$tag_prefix" | cut -d "(" -f2 | cut -d ")" -f1 | awk '{print $2}' | sort -t "-" -k 2 -g | tail -n 1)
|
||||
VERSION_FEATURE=$(getVersionProp "DEFAULT_VERSION_FEATURE")
|
||||
VERSION_INTERIM=$(getVersionProp "DEFAULT_VERSION_INTERIM")
|
||||
VERSION_UPDATE=$(getVersionProp "DEFAULT_VERSION_UPDATE")
|
||||
VERSION_PATCH=$(getVersionProp "DEFAULT_VERSION_PATCH")
|
||||
[[ $VERSION_UPDATE = 0 ]] && JBSDK_VERSION="$VERSION_FEATURE" || JBSDK_VERSION="${VERSION_FEATURE}.${VERSION_INTERIM}.${VERSION_UPDATE}"
|
||||
[[ $VERSION_PATCH = 0 ]] || JBSDK_VERSION="${VERSION_FEATURE}.${VERSION_INTERIM}.${VERSION_UPDATE}.${VERSION_PATCH}"
|
||||
echo "##teamcity[setParameter name='env.JBSDK_VERSION' value='${JBSDK_VERSION}']"
|
||||
JDK_BUILD_NUMBER=${JDK_BUILD_NUMBER:=$(echo $OPENJDK_TAG | awk -F "-|[+]" '{print $3}')}
|
||||
[ -z $JDK_BUILD_NUMBER ] && JDK_BUILD_NUMBER=1
|
||||
@@ -94,7 +92,8 @@ esac
|
||||
|
||||
WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS="--with-native-debug-symbols=zipped"
|
||||
|
||||
REPRODUCIBLE_BUILD_OPTS="--with-source-date=$SOURCE_DATE_EPOCH
|
||||
REPRODUCIBLE_BUILD_OPTS="--enable-reproducible-build
|
||||
--with-source-date=$SOURCE_DATE_EPOCH
|
||||
--with-hotspot-build-time=$BUILD_TIME
|
||||
--with-copyright-year=$COPYRIGHT_YEAR
|
||||
--disable-absolute-paths-in-output
|
||||
@@ -102,18 +101,11 @@ REPRODUCIBLE_BUILD_OPTS="--with-source-date=$SOURCE_DATE_EPOCH
|
||||
|
||||
function zip_native_debug_symbols() {
|
||||
image_bundle_path=$(echo $1 | cut -d"/" -f-4)
|
||||
jdk_name=$(echo $1 | cut -d"/" -f5)
|
||||
jbr_diz_name=$2
|
||||
|
||||
[ -d "dizfiles" ] && rm -rf dizfiles
|
||||
mkdir dizfiles
|
||||
(cd $image_bundle_path && find . -name '*.diz' -exec rsync -R {} ../../../../dizfiles \; )
|
||||
|
||||
rsync_target="../../../../dizfiles"
|
||||
[ -z "$jdk_name" ] && rsync_target=$rsync_target"/"$jbr_diz_name
|
||||
(cd $image_bundle_path && find . -name '*.diz' -exec rsync -R {} $rsync_target \;)
|
||||
[ ! -z "$jdk_name" ] && mv dizfiles/$jdk_name dizfiles/$jbr_diz_name
|
||||
|
||||
(cd dizfiles && find $jbr_diz_name -print0 | COPYFILE_DISABLE=1 \
|
||||
(cd dizfiles && find . -print0 | COPYFILE_DISABLE=1 \
|
||||
tar --no-recursion --null -T - -czf ../"$jbr_diz_name".tar.gz) || do_exit $?
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ function create_image_bundle {
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix:-}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-${libc_type_suffix}aarch64-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
|
||||
echo Running jlink....
|
||||
@@ -135,7 +135,6 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
cat $JCEF_PATH/jcef.version >> $JSDK/release
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
@@ -155,8 +154,7 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-aarch64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
|
||||
@@ -63,7 +63,7 @@ function create_image_bundle {
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix:-}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-${libc_type_suffix}x64-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
echo Running jlink....
|
||||
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
@@ -93,7 +93,7 @@ function create_image_bundle {
|
||||
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
|
||||
touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
|
||||
gzip "$JBR".tar || do_exit $?
|
||||
#rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
}
|
||||
|
||||
WITH_DEBUG_LEVEL="--with-debug-level=release"
|
||||
@@ -134,7 +134,7 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
cat $JCEF_PATH/jcef.version >> $JSDK/release
|
||||
[ "$bundle_type" != "fd" ] && jbrsdk_name_postfix="_${bundle_type}"
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
@@ -154,8 +154,7 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
|
||||
@@ -52,7 +52,7 @@ function create_image_bundle {
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix:-}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-${libc_type_suffix}x86-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
echo Running jlink....
|
||||
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
|
||||
@@ -134,8 +134,7 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x86-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" >/dev/null && pwd)"
|
||||
|
||||
source "$SCRIPT_DIR/jetsign-common.sh" || exit 1
|
||||
|
||||
function isMacOsBinary() {
|
||||
file "$1" | grep -q 'Mach-O'
|
||||
}
|
||||
|
||||
function isSigned() {
|
||||
codesign --verify "$1" >/dev/null 2>&1 && ! grep -q Signature=adhoc < <(codesign --display --verbose "$1" 2>&1)
|
||||
}
|
||||
|
||||
# last argument is a path to be signed
|
||||
pathToBeSigned="$(pwd)/${*: -1}"
|
||||
jetSignArgs=("${@:1:$#-1}")
|
||||
if [[ ! -f "$pathToBeSigned" ]]; then
|
||||
echo "$pathToBeSigned is missing or not a file"
|
||||
exit 1
|
||||
elif isSigned "$pathToBeSigned" && ! isForced "${jetSignArgs[@]}" ; then
|
||||
echo "Already signed: $pathToBeSigned"
|
||||
elif [[ "$JETSIGN_CLIENT" == "null" ]]; then
|
||||
echo "JetSign client is missing, cannot proceed with signing"
|
||||
exit 1
|
||||
elif ! isMacOsBinary "$pathToBeSigned" && [[ "$pathToBeSigned" != *.sit ]] && [[ "$pathToBeSigned" != *.tar.gz ]]; then
|
||||
echo "$pathToBeSigned won't be signed, assumed not to be a macOS executable"
|
||||
else
|
||||
if isMacOsBinary "$pathToBeSigned" && ! isSigned "$pathToBeSigned" ; then
|
||||
echo "Unsigned macOS binary: $pathToBeSigned"
|
||||
fi
|
||||
workDir=$(dirname "$pathToBeSigned")
|
||||
pathSigned="$workDir/signed/${pathToBeSigned##*/}"
|
||||
jetSignExtensions=$(jetSignExtensions "${jetSignArgs[@]}")
|
||||
contentType=$(jetSignContentType "$pathToBeSigned")
|
||||
(
|
||||
cd "$workDir" || exit 1
|
||||
"$JETSIGN_CLIENT" -log-format text -denoted-content-type "$contentType" -extensions "$jetSignExtensions" "$pathToBeSigned"
|
||||
# SRE-1223 (Codesign removes execute bits in executable files) workaround
|
||||
chmod "$(stat -f %A "$pathToBeSigned")" "$pathSigned"
|
||||
if isMacOsBinary "$pathSigned"; then
|
||||
isSigned "$pathSigned"
|
||||
fi
|
||||
rm "$pathToBeSigned"
|
||||
mv "$pathSigned" "$pathToBeSigned"
|
||||
rm -rf "$workDir/signed"
|
||||
)
|
||||
fi
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
function isForced() {
|
||||
for arg in "$@"; do
|
||||
if [[ "$arg" == --force ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
function jetSignExtensions() {
|
||||
args=("$@")
|
||||
((lastElementIndex=${#args[@]}-1))
|
||||
for index in "${!args[@]}"; do
|
||||
arg=${args[$index]}
|
||||
case "$arg" in
|
||||
--sign | -s)
|
||||
echo -n 'mac_codesign_identity='
|
||||
continue
|
||||
;;
|
||||
--entitlements)
|
||||
echo -n 'mac_codesign_entitlements='
|
||||
continue
|
||||
;;
|
||||
--options=runtime)
|
||||
echo -n 'mac_codesign_options=runtime'
|
||||
;;
|
||||
--force)
|
||||
echo -n 'mac_codesign_force=true'
|
||||
;;
|
||||
--timestamp | --verbose | -v)
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
echo -n "$arg"
|
||||
;;
|
||||
esac
|
||||
if [[ $index != "$lastElementIndex" ]]; then
|
||||
echo -n ","
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# See jetbrains.sign.util.FileUtil.contentType
|
||||
function jetSignContentType() {
|
||||
case "${1##*/}" in
|
||||
*.sit)
|
||||
echo -n 'application/x-mac-app-zip'
|
||||
;;
|
||||
*.tar.gz)
|
||||
echo -n 'application/x-mac-app-targz'
|
||||
;;
|
||||
*.pkg)
|
||||
echo -n 'application/x-mac-pkg'
|
||||
;;
|
||||
*)
|
||||
echo -n 'application/x-mac-app-bin'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ function create_image_bundle {
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix:-}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix:-}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-${architecture}-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
JRE_CONTENTS=$tmp/$__root_dir/Contents
|
||||
mkdir -p "$JRE_CONTENTS" || do_exit $?
|
||||
@@ -81,10 +81,6 @@ function create_image_bundle {
|
||||
zip_native_debug_symbols $IMAGES_DIR/jdk-bundle/jdk-$JBSDK_VERSION.jdk "${JBR}_diz"
|
||||
fi
|
||||
|
||||
if [ "$bundle_type" == "jcef" ]; then
|
||||
cat $JCEF_PATH/jcef.version >> "$JRE_CONTENTS/Home/release"
|
||||
fi
|
||||
|
||||
cp -R "$JSDK"/../MacOS "$JRE_CONTENTS"
|
||||
cp "$JSDK"/../Info.plist "$JRE_CONTENTS"
|
||||
|
||||
@@ -162,8 +158,7 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-osx-test-${architecture}-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
COPYFILE_DISABLE=1 tar -pczf "$JBRSDK_TEST".tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
[[ "${SCRIPT_VERBOSE:-}" == "1" ]] && set -x
|
||||
set -x
|
||||
|
||||
APP_PATH=$1
|
||||
APP_DIRECTORY=$1
|
||||
APPL_USER=$2
|
||||
APPL_PASSWORD=$3
|
||||
APP_NAME=$4
|
||||
BUNDLE_ID=$5
|
||||
FAKE_ROOT="${6:-fake-root}"
|
||||
|
||||
if [[ -z "$APP_PATH" ]]; then
|
||||
echo "Usage: $0 AppPath"
|
||||
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$APPL_USER" ]] || [[ -z "$APPL_PASSWORD" ]]; then
|
||||
echo "Usage: $0 AppDirectory Username Password"
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -f "$APP_PATH" ]]; then
|
||||
echo "AppName '$APP_PATH' does not exist or not a file"
|
||||
if [[ ! -d "$APP_DIRECTORY" ]]; then
|
||||
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -19,22 +23,99 @@ function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
}
|
||||
|
||||
function publish-log() {
|
||||
id=$1
|
||||
file=$2
|
||||
curl -T "$file" "$ARTIFACTORY_URL/$id" || true
|
||||
}
|
||||
|
||||
# check required parameters
|
||||
: "${APPLE_ISSUER_ID}"
|
||||
: "${APPLE_KEY_ID}"
|
||||
: "${APPLE_PRIVATE_KEY}"
|
||||
function altool-upload() {
|
||||
# Since altool uses same file for upload token we have to trick it into using different folders for token file location
|
||||
# Also it copies zip into TMPDIR so we override it too, to simplify cleanup
|
||||
OLD_HOME="$HOME"
|
||||
export HOME="$FAKE_ROOT/home"
|
||||
export TMPDIR="$FAKE_ROOT/tmp"
|
||||
mkdir -p "$HOME"
|
||||
mkdir -p "$TMPDIR"
|
||||
export _JAVA_OPTIONS="-Duser.home=$HOME -Djava.io.tmpdir=$TMPDIR"
|
||||
# Reduce amount of downloads, cache transporter libraries
|
||||
shared_itmstransporter="$OLD_HOME/shared-itmstransporter"
|
||||
if [[ -f "$shared_itmstransporter" ]]; then
|
||||
cp -r "$shared_itmstransporter" "$HOME/.itmstransporter"
|
||||
fi
|
||||
# For some reason altool prints everything to stderr, not stdout
|
||||
set +e
|
||||
xcrun altool --notarize-app \
|
||||
--username "$APPL_USER" --password "$APPL_PASSWORD" \
|
||||
--primary-bundle-id "$BUNDLE_ID" \
|
||||
--asc-provider JetBrainssro --file "$1" 2>&1 | tee "altool.init.out"
|
||||
unset TMPDIR
|
||||
export HOME="$OLD_HOME"
|
||||
set -e
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -f \"$PWD/tmp_key\"" INT EXIT RETURN
|
||||
echo -n "${APPLE_PRIVATE_KEY}" > tmp_key
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
|
||||
log "Notarizing $APP_PATH..."
|
||||
xcrun notarytool submit --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" "$APP_PATH" 2>&1 | tee "notarytool.submit.out"
|
||||
REQUEST_ID="$(grep -e " id: " "notarytool.submit.out" | grep -oE '([0-9a-f-]{36})'| head -n1)"
|
||||
#file="$APP_NAME.zip"
|
||||
|
||||
xcrun notarytool wait "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" --timeout 6h ||:
|
||||
xcrun notarytool log "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" developer_log.json ||:
|
||||
xcrun notarytool info "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}"
|
||||
#log "Zipping $file..."
|
||||
#rm -rf "$file"
|
||||
#ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY" "$file"
|
||||
|
||||
log "Notarizing finished"
|
||||
log "Notarizing $APP_NAME..."
|
||||
rm -rf "altool.init.out" "altool.check.out"
|
||||
altool-upload "$APP_NAME"
|
||||
|
||||
notarization_info="$(grep -e "RequestUUID" "altool.init.out" | grep -oE '([0-9a-f-]{36})')"
|
||||
|
||||
if [ -z "$notarization_info" ]; then
|
||||
log "Faile to read RequestUUID from altool.init.out"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
PATH="$PATH:/usr/local/bin/"
|
||||
|
||||
log "Notarization request sent, awaiting response"
|
||||
spent=0
|
||||
|
||||
while true; do
|
||||
# For some reason altool prints everything to stderr, not stdout
|
||||
xcrun altool --username "$APPL_USER" --notarization-info "$notarization_info" --password "$APPL_PASSWORD" >"altool.check.out" 2>&1 || true
|
||||
status="$(grep -oe 'Status: .*' "altool.check.out" | cut -c 9- || true)"
|
||||
log "Current status: $status"
|
||||
if [ "$status" = "invalid" ]; then
|
||||
log "Notarization failed"
|
||||
ec=1
|
||||
elif [ "$status" = "success" ]; then
|
||||
log "Notarization succeeded"
|
||||
ec=0
|
||||
else
|
||||
if [ "$status" != "in progress" ]; then
|
||||
log "Unknown notarization status, waiting more, altool output:"
|
||||
cat "altool.check.out"
|
||||
fi
|
||||
if [[ $spent -gt 60 ]]; then
|
||||
log "Waiting time out (apx 60 minutes)"
|
||||
ec=2
|
||||
break
|
||||
fi
|
||||
sleep 60
|
||||
((spent += 1))
|
||||
continue
|
||||
fi
|
||||
developer_log="developer_log.json"
|
||||
log "Fetching $developer_log"
|
||||
# TODO: Replace cut with trim or something better
|
||||
url="$(grep -oe 'LogFileURL: .*' "altool.check.out" | cut -c 13-)"
|
||||
wget "$url" -O "$developer_log" && cat "$developer_log" || true
|
||||
if [ $ec != 0 ]; then
|
||||
log "Publishing $developer_log"
|
||||
publish-log "$notarization_info" "$developer_log"
|
||||
fi
|
||||
break
|
||||
done
|
||||
cat "altool.check.out"
|
||||
|
||||
rm -rf "altool.init.out" "altool.check.out"
|
||||
exit $ec
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" >/dev/null && pwd)"
|
||||
|
||||
source "$SCRIPT_DIR/jetsign-common.sh" || exit 1
|
||||
|
||||
function isSigned() {
|
||||
pkgutil --check-signature "$1" >/dev/null 2>&1 && grep -q "signed by a developer certificate" < <(pkgutil --check-signature "$1" 2>&1)
|
||||
}
|
||||
|
||||
# second last argument is a path to be signed
|
||||
pathToBeSigned="$(pwd)/${*:(-2):1}"
|
||||
# last argument is a path to signed file
|
||||
pathOut="$(pwd)/${*:(-1)}"
|
||||
jetSignArgs=("${@:1:$#-2}")
|
||||
if [[ ! -f "$pathToBeSigned" ]]; then
|
||||
echo "$pathToBeSigned is missing or not a file"
|
||||
exit 1
|
||||
elif isSigned "$pathToBeSigned" && ! isForced "${jetSignArgs[@]}" ; then
|
||||
echo "Already signed: $pathToBeSigned"
|
||||
elif [[ "$JETSIGN_CLIENT" == "null" ]]; then
|
||||
echo "JetSign client is missing, cannot proceed with signing"
|
||||
exit 1
|
||||
elif [[ "$pathToBeSigned" != *.pkg ]]; then
|
||||
echo "$pathToBeSigned won't be signed, assumed not to be a macOS package"
|
||||
else
|
||||
if ! isSigned "$pathToBeSigned" ; then
|
||||
echo "Unsigned macOS package: $pathToBeSigned"
|
||||
fi
|
||||
workDir=$(dirname "$pathToBeSigned")
|
||||
pathSigned="$workDir/signed/${pathToBeSigned##*/}"
|
||||
jetSignExtensions=$(jetSignExtensions "${jetSignArgs[@]}")
|
||||
contentType=$(jetSignContentType "$pathToBeSigned")
|
||||
(
|
||||
cd "$workDir" || exit 1
|
||||
"$JETSIGN_CLIENT" -log-format text -denoted-content-type "$contentType" -extensions "$jetSignExtensions" "$pathToBeSigned"
|
||||
isSigned "$pathSigned"
|
||||
rm -f "$pathOut"
|
||||
mv "$pathSigned" "$pathOut"
|
||||
rm -rf "$workDir/signed"
|
||||
)
|
||||
fi
|
||||
@@ -1,33 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
[[ "${SCRIPT_VERBOSE:-}" == "1" ]] && set -x
|
||||
|
||||
if [[ $# -lt 5 ]]; then
|
||||
echo "Usage: $0 AppDirectory AppName BundleId CertificateID InstallerCertificateID"
|
||||
exit 1
|
||||
fi
|
||||
set -x
|
||||
|
||||
APPLICATION_PATH=$1
|
||||
PKG_NAME=$2
|
||||
APP_NAME=$2
|
||||
BUNDLE_ID=$3
|
||||
JB_DEVELOPER_CERT=$4
|
||||
JB_INSTALLER_CERT=$5
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" >/dev/null && pwd)"
|
||||
|
||||
# Use JetBrains sign utility if it's available
|
||||
if [[ "${JETSIGN_CLIENT:=}" == "null" ]] || [[ "$JETSIGN_CLIENT" == "" ]]; then
|
||||
JB_SIGN=false
|
||||
SIGN_UTILITY="codesign"
|
||||
PRODUCTSIGN_UTILITY="productsign"
|
||||
else
|
||||
JB_SIGN=true
|
||||
SIGN_UTILITY="$SCRIPT_DIR/codesign.sh"
|
||||
PRODUCTSIGN_UTILITY="$SCRIPT_DIR/productsign.sh"
|
||||
if [[ -z "$APPLICATION_PATH" ]] || [[ -z "$JB_DEVELOPER_CERT" ]]; then
|
||||
echo "Usage: $0 AppDirectory CertificateID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$APPLICATION_PATH" ]]; then
|
||||
echo "AppDirectory '$APPLICATION_PATH' does not exist or not a directory"
|
||||
exit 1
|
||||
@@ -37,6 +22,9 @@ function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
}
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
|
||||
# Cleanup files left from previous sign attempt (if any)
|
||||
find "$APPLICATION_PATH" -name '*.cstemp' -exec rm '{}' \;
|
||||
|
||||
@@ -49,13 +37,13 @@ for f in \
|
||||
if [ -d "$APPLICATION_PATH/$f" ]; then
|
||||
find "$APPLICATION_PATH/$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -name "*.node" -o -perm +111 \) \
|
||||
-exec "$SIGN_UTILITY" --timestamp \
|
||||
-exec codesign --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime --force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
--entitlements entitlements.xml {} \;
|
||||
fi
|
||||
done
|
||||
|
||||
log "Signing libraries in jars in $APPLICATION_PATH"
|
||||
log "Signing libraries in jars in $PWD"
|
||||
|
||||
# todo: add set -euo pipefail; into the inner sh -c
|
||||
# `-e` prevents `grep -q && printf` loginc
|
||||
@@ -73,10 +61,10 @@ find "$APPLICATION_PATH" -name '*.jar' \
|
||||
|
||||
find jarfolder \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -name "jattach" \) \
|
||||
-exec "$SIGN_UTILITY" --timestamp \
|
||||
-exec codesign --timestamp \
|
||||
--force \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
--entitlements entitlements.xml {} \;
|
||||
|
||||
(cd jarfolder; zip -q -r -o -0 ../jar.jar .)
|
||||
mv jar.jar "$file"
|
||||
@@ -85,77 +73,44 @@ find "$APPLICATION_PATH" -name '*.jar' \
|
||||
rm -rf jarfolder jar.jar
|
||||
|
||||
log "Signing other files..."
|
||||
# shellcheck disable=SC2043
|
||||
for f in \
|
||||
"Contents/Home/bin"; do
|
||||
if [ -d "$APPLICATION_PATH/$f" ]; then
|
||||
find "$APPLICATION_PATH/$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -perm +111 \) \
|
||||
-exec "$SIGN_UTILITY" --timestamp \
|
||||
-exec codesign --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime --force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
--entitlements entitlements.xml {} \;
|
||||
fi
|
||||
done
|
||||
|
||||
log "Signing whole frameworks..."
|
||||
# shellcheck disable=SC2043
|
||||
if [ "$JB_SIGN" = true ]; then for f in \
|
||||
"Contents/Home/Frameworks" "Contents/Frameworks"; do
|
||||
if [ -d "$APPLICATION_PATH/$f" ]; then
|
||||
find "$APPLICATION_PATH/$f" \( -name '*.framework' -o -name '*.app' \) -maxdepth 1 | while read -r line
|
||||
do
|
||||
log "Signing '$line':"
|
||||
tar -pczf tmp-to-sign.tar.gz -C "$(dirname "$line")" "$(basename "$line")"
|
||||
"$SIGN_UTILITY" --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" tmp-to-sign.tar.gz
|
||||
rm -rf "$line"
|
||||
tar -xzf tmp-to-sign.tar.gz --directory "$(dirname "$line")"
|
||||
rm -f tmp-to-sign.tar.gz
|
||||
done
|
||||
fi
|
||||
done; fi
|
||||
|
||||
log "Checking framework signatures..."
|
||||
for f in \
|
||||
"Contents/Home/Frameworks" "Contents/Frameworks"; do
|
||||
if [ -d "$APPLICATION_PATH/$f" ]; then
|
||||
find "$APPLICATION_PATH/$f" -name '*.framework' -maxdepth 1 | while read -r line
|
||||
do
|
||||
log "Checking '$line':"
|
||||
codesign --verify --deep --strict --verbose=4 "$line"
|
||||
done
|
||||
fi
|
||||
done
|
||||
#log "Signing executable..."
|
||||
#codesign --timestamp \
|
||||
# -v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
# --force \
|
||||
# --entitlements entitlements.xml "$APPLICATION_PATH/Contents/MacOS/idea"
|
||||
|
||||
log "Signing whole app..."
|
||||
if [ "$JB_SIGN" = true ]; then
|
||||
tar -pczf tmp-to-sign.tar.gz --exclude='man' -C "$(dirname "$APPLICATION_PATH")" "$(basename "$APPLICATION_PATH")"
|
||||
"$SIGN_UTILITY" --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" tmp-to-sign.tar.gz
|
||||
rm -rf "$APPLICATION_PATH"
|
||||
tar -xzf tmp-to-sign.tar.gz --directory "$(dirname "$APPLICATION_PATH")"
|
||||
rm -f tmp-to-sign.tar.gz
|
||||
else
|
||||
"$SIGN_UTILITY" --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" "$APPLICATION_PATH"
|
||||
fi
|
||||
codesign --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements entitlements.xml "$APPLICATION_PATH"
|
||||
|
||||
BUILD_NAME="$(basename "$APPLICATION_PATH")"
|
||||
BUILD_NAME=$(echo $APPLICATION_PATH | awk -F"/" '{ print $2 }')
|
||||
|
||||
log "Creating $PKG_NAME..."
|
||||
rm -rf "$PKG_NAME"
|
||||
log "Creating $APP_NAME.pkg..."
|
||||
rm -rf "$APP_NAME.pkg"
|
||||
|
||||
mkdir -p unsigned
|
||||
pkgbuild --identifier $BUNDLE_ID --root $APPLICATION_PATH \
|
||||
--install-location /Library/Java/JavaVirtualMachines/${BUILD_NAME} unsigned/${PKG_NAME}
|
||||
log "Signing $PKG_NAME..."
|
||||
"$PRODUCTSIGN_UTILITY" --timestamp --sign "$JB_INSTALLER_CERT" unsigned/${PKG_NAME} ${PKG_NAME}
|
||||
--install-location /Library/Java/JavaVirtualMachines/${BUILD_NAME} unsigned/${APP_NAME}.pkg
|
||||
productsign --timestamp --sign "$JB_INSTALLER_CERT" unsigned/${APP_NAME}.pkg ${APP_NAME}.pkg
|
||||
|
||||
#log "Signing whole app..."
|
||||
#codesign --timestamp \
|
||||
# -v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
# --force \
|
||||
# --entitlements entitlements.xml $APP_NAME.pkg
|
||||
|
||||
log "Verifying java is not broken"
|
||||
find "$APPLICATION_PATH" \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#immediately exit script with an error if a command fails
|
||||
set -euo pipefail
|
||||
[[ "${SCRIPT_VERBOSE:-}" == "1" ]] && set -x
|
||||
set -x
|
||||
|
||||
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
|
||||
export COPYFILE_DISABLE=true
|
||||
@@ -17,7 +17,7 @@ JB_INSTALLER_CERT=$6
|
||||
NOTARIZE=$7
|
||||
BUNDLE_ID=$8
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" >/dev/null && pwd)"
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
function log() {
|
||||
echo "$(date '+[%H:%M:%S]') $*"
|
||||
@@ -44,8 +44,7 @@ fi
|
||||
|
||||
log "$INPUT_FILE extracted and removed"
|
||||
|
||||
APP_NAME=$(basename "$INPUT_FILE" | awk -F".tar" '{ print $1 }')
|
||||
PKG_NAME="$APP_NAME.pkg"
|
||||
APP_NAME=$(echo ${INPUT_FILE} | awk -F".tar" '{ print $1 }')
|
||||
APPLICATION_PATH=$EXPLODED/$(ls $EXPLODED)
|
||||
|
||||
find "$APPLICATION_PATH/Contents/Home/bin" \
|
||||
@@ -74,18 +73,16 @@ if [[ $non_plist -gt 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${JETSIGN_CLIENT:=}" == "null" ]] || [[ "$JETSIGN_CLIENT" == "" ]]; then
|
||||
log "Unlocking keychain..."
|
||||
# Make sure *.p12 is imported into local KeyChain
|
||||
security unlock-keychain -p "$PASSWORD" "/Users/$USERNAME/Library/Keychains/login.keychain"
|
||||
fi
|
||||
log "Unlocking keychain..."
|
||||
# Make sure *.p12 is imported into local KeyChain
|
||||
security unlock-keychain -p "$PASSWORD" "/Users/$USERNAME/Library/Keychains/login.keychain"
|
||||
|
||||
attempt=1
|
||||
limit=3
|
||||
set +e
|
||||
while [[ $attempt -le $limit ]]; do
|
||||
log "Signing (attempt $attempt) $APPLICATION_PATH ..."
|
||||
"$SCRIPT_DIR/sign.sh" "$APPLICATION_PATH" "$PKG_NAME" "$BUNDLE_ID" "$CODESIGN_STRING" "$JB_INSTALLER_CERT"
|
||||
./sign.sh "$APPLICATION_PATH" "$APP_NAME" "$BUNDLE_ID" "$CODESIGN_STRING" "$JB_INSTALLER_CERT"
|
||||
ec=$?
|
||||
if [[ $ec -ne 0 ]]; then
|
||||
((attempt += 1))
|
||||
@@ -107,10 +104,19 @@ set -e
|
||||
|
||||
if [ "$NOTARIZE" = "yes" ]; then
|
||||
log "Notarizing..."
|
||||
"$SCRIPT_DIR/notarize.sh" "$PKG_NAME"
|
||||
# shellcheck disable=SC1090
|
||||
source "$HOME/.notarize_token"
|
||||
# Since notarization tool uses same file for upload token we have to trick it into using different folders, hence fake root
|
||||
# Also it leaves copy of zip file in TMPDIR, so notarize.sh overrides it and uses FAKE_ROOT as location for temp TMPDIR
|
||||
FAKE_ROOT="$(pwd)/fake-root"
|
||||
mkdir -p "$FAKE_ROOT"
|
||||
echo "Notarization will use fake root: $FAKE_ROOT"
|
||||
./notarize.sh "$APPLICATION_PATH" "$APPLE_USERNAME" "$APPLE_PASSWORD" "$APP_NAME.pkg" "$BUNDLE_ID" "$FAKE_ROOT"
|
||||
rm -rf "$FAKE_ROOT"
|
||||
|
||||
set +e
|
||||
log "Stapling..."
|
||||
xcrun stapler staple "$APPLICATION_PATH" ||:
|
||||
xcrun stapler staple "$PKG_NAME" ||:
|
||||
xcrun stapler staple "$APPLICATION_PATH"
|
||||
else
|
||||
log "Notarization disabled"
|
||||
log "Stapling disabled"
|
||||
@@ -123,11 +129,7 @@ log "Zipping $BUILD_NAME to $INPUT_FILE ..."
|
||||
if test -d $BACKUP_JMODS/jmods; then
|
||||
mv $BACKUP_JMODS/jmods $APPLICATION_PATH/Contents/Home
|
||||
fi
|
||||
if [[ "$APPLICATION_PATH" != "$EXPLODED/$BUILD_NAME" ]]; then
|
||||
mv $APPLICATION_PATH $EXPLODED/$BUILD_NAME
|
||||
else
|
||||
echo "No move, source == destination: $APPLICATION_PATH"
|
||||
fi
|
||||
mv $APPLICATION_PATH $EXPLODED/$BUILD_NAME
|
||||
|
||||
tar -pczvf $INPUT_FILE --exclude='man' -C $EXPLODED $BUILD_NAME
|
||||
log "Finished zipping"
|
||||
|
||||
@@ -2,27 +2,20 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TC_PRINT=0
|
||||
# Always print TeamCity service messages if running under TeamCity
|
||||
[[ -n "${TEAMCITY_VERSION:-}" ]] && TC_PRINT=1
|
||||
|
||||
while getopts ":t" o; do
|
||||
case "${o}" in
|
||||
t) TC_PRINT=1 ;;
|
||||
*);;
|
||||
t)
|
||||
t="With Teamcity tests info"
|
||||
TC_PRINT=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
NEWFILEPATH="$1"
|
||||
CONFIGID="$2"
|
||||
BUILDID="$3"
|
||||
TOKEN="$4"
|
||||
|
||||
if [ ! -f "$NEWFILEPATH" ]; then
|
||||
echo "File not found: $NEWFILEPATH"
|
||||
exit 1
|
||||
fi
|
||||
NEWFILEPATH=$1
|
||||
CONFIGID=$2
|
||||
BUILDID=$3
|
||||
TOKEN=$4
|
||||
#
|
||||
# Get the size of new artifact
|
||||
#
|
||||
@@ -36,7 +29,11 @@ case "${unameOut}" in
|
||||
NEWFILESIZE=$(stat -f%z "$NEWFILEPATH")
|
||||
;;
|
||||
CYGWIN*)
|
||||
NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
|
||||
NEWFILESIZE=$(stat -c%s$4
|
||||
#
|
||||
# Get the size of new artifact
|
||||
#
|
||||
"$NEWFILEPATH")
|
||||
;;
|
||||
MINGW*)
|
||||
NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
|
||||
@@ -45,13 +42,13 @@ case "${unameOut}" in
|
||||
echo "Unknown machine: ${unameOut}"
|
||||
exit 1
|
||||
esac
|
||||
FILENAME=$(basename "${NEWFILEPATH}")
|
||||
FILENAME=$(basename ${NEWFILEPATH})
|
||||
|
||||
#
|
||||
# Get pattern of artifact name
|
||||
# Base filename pattern: <BUNDLE_TYPE>-<JDK_VERSION>-<OS>-<ARCH>-b<BUILD>.tar.gz: jbr_dcevm-17.0.2-osx-x64-b1234.tar.gz
|
||||
# BUNDLE_TYPE: jbr, jbrsdk, jbr_dcevm, jbrsdk_jcef etc.
|
||||
# OS_ARCH_PATTERN - <os_architecture>: osx-x64, linux-aarch64, linux-musl-x64, windows-x64 etc.
|
||||
# OS_ARCH_PATTERN - <os_architecture>: osx-x64, linux-aarch64, windows-x64 etc.
|
||||
|
||||
BUNDLE_TYPE=jbrsdk
|
||||
OS_ARCH_PATTERN=""
|
||||
@@ -62,37 +59,33 @@ if [[ $FILENAME =~ $re ]]; then
|
||||
BUNDLE_TYPE=${BASH_REMATCH[1]}
|
||||
OS_ARCH_PATTERN=${BASH_REMATCH[2]}
|
||||
FILE_EXTENSION=${BASH_REMATCH[3]}
|
||||
else
|
||||
echo "File name $FILENAME does not match regex $re"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function test_started_msg() {
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
echo "##teamcity[testStarted name='$1']"
|
||||
fi
|
||||
}
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
testname_file_ext=`echo $FILE_EXTENSION | sed 's/\./_/g'`
|
||||
testname=$BUNDLE_TYPE"_"$OS_ARCH_PATTERN$testname_file_ext
|
||||
echo \#\#teamcity[testStarted name=\'$testname\']
|
||||
fi
|
||||
|
||||
|
||||
echo "BUNDLE_TYPE: " $BUNDLE_TYPE
|
||||
echo "OS_ARCH_PATTERN: " $OS_ARCH_PATTERN
|
||||
echo "FILE_EXTENSION: " $FILE_EXTENSION
|
||||
echo "New size of $FILENAME = $NEWFILESIZE bytes."
|
||||
|
||||
|
||||
function test_failed_msg() {
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
echo "##teamcity[testFailed name='$1' message='$2']"
|
||||
if [ $3 -eq 1 ]; then
|
||||
echo \#\#teamcity[testFailed name=\'$1\' message=\'$2\']
|
||||
fi
|
||||
}
|
||||
|
||||
function test_finished_msg() {
|
||||
if [ $TC_PRINT -eq 1 ]; then
|
||||
echo "##teamcity[testFinished name='$1']"
|
||||
if [ $2 -eq 1 ]; then
|
||||
echo \#\#teamcity[testFinished name=\'$1\']
|
||||
fi
|
||||
}
|
||||
|
||||
test_name="${BUNDLE_TYPE}_${OS_ARCH_PATTERN//\-/_}${FILE_EXTENSION//\./_}"
|
||||
test_started_msg "$test_name"
|
||||
|
||||
echo "BUNDLE_TYPE: $BUNDLE_TYPE"
|
||||
echo "OS_ARCH_PATTERN: $OS_ARCH_PATTERN"
|
||||
echo "FILE_EXTENSION: $FILE_EXTENSION"
|
||||
echo "Size of $FILENAME is $NEWFILESIZE bytes"
|
||||
|
||||
#
|
||||
# Get previous successful build ID
|
||||
# Example:
|
||||
@@ -102,21 +95,20 @@ echo "Size of $FILENAME is $NEWFILESIZE bytes"
|
||||
# expected return value
|
||||
# id="123".number="567"
|
||||
#
|
||||
CURL_RESPONSE=$(curl -sSL --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
|
||||
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
|
||||
re='id=\"([0-9]+)\".+number=\"([0-9\.]+)\"'
|
||||
|
||||
# ID: Previous successful build id
|
||||
ID=0
|
||||
if [[ $CURL_RESPONSE =~ $re ]]; then
|
||||
ID=${BASH_REMATCH[1]}
|
||||
echo "Previous build ID: $ID"
|
||||
echo "Previous build number: ${BASH_REMATCH[2]}"
|
||||
echo "BUILD Number: ${BASH_REMATCH[2]}"
|
||||
else
|
||||
msg="ERROR: cannot find previous build"
|
||||
echo "$msg"
|
||||
echo "$CURL_RESPONSE"
|
||||
test_failed_msg "$test_name" "$msg"
|
||||
test_finished_msg "$test_name"
|
||||
msg="ERROR: can't find previous build"
|
||||
echo $msg
|
||||
echo $CURL_RESPONSE
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -126,37 +118,36 @@ fi
|
||||
# expected return value
|
||||
# name="jbrsdk_jcef*.tar.gz size="123'
|
||||
#
|
||||
CURL_RESPONSE=$(curl -sSL --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
|
||||
echo "Artifacts of the previous build:"
|
||||
echo "$CURL_RESPONSE"
|
||||
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
|
||||
echo "Atrifacts of previous build of $CONFIGID :"
|
||||
echo $CURL_RESPONSE
|
||||
|
||||
# Find binary size (in response) with reg exp
|
||||
re="name=\"(${BUNDLE_TYPE}[^\"]+${OS_ARCH_PATTERN}[^\"]+${FILE_EXTENSION})\" size=\"([0-9]+)\""
|
||||
re='name=\"('$BUNDLE_TYPE'[^\"]+'${OS_ARCH_PATTERN}'[^\"]+'${FILE_EXTENSION}')\" size=\"([0-9]+)\"'
|
||||
|
||||
if [[ $CURL_RESPONSE =~ $re ]]; then
|
||||
prevFileName=${BASH_REMATCH[1]}
|
||||
echo "Previous artifact name: $prevFileName"
|
||||
prevFileSize=${BASH_REMATCH[2]}
|
||||
echo "Previous artifact size: $prevFileSize"
|
||||
OLDFILENAME=${BASH_REMATCH[1]}
|
||||
echo "Prev artifact name: $OLDFILENAME"
|
||||
OLDFILESIZE=${BASH_REMATCH[2]}
|
||||
echo "Prev artifact size = $OLDFILESIZE"
|
||||
|
||||
((allowedSize=prevFileSize+prevFileSize/20)) # use 5% threshold
|
||||
echo "Allowed size: $allowedSize"
|
||||
let allowedSize=OLDFILESIZE+OLDFILESIZE/20 # use 5% threshold
|
||||
echo "Allowed size = $allowedSize"
|
||||
if [[ "$NEWFILESIZE" -gt "$allowedSize" ]]; then
|
||||
msg="ERROR: new size is significantly greater than previous size (need to investigate)"
|
||||
echo "$msg"
|
||||
test_failed_msg "$test_name" "$msg"
|
||||
test_finished_msg "$test_name"
|
||||
msg="ERROR: new size is significally greater than prev size (need to investigate)"
|
||||
echo $msg
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
exit 1
|
||||
else
|
||||
echo "PASSED"
|
||||
test_finished_msg "$test_name"
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
fi
|
||||
else
|
||||
msg="ERROR: cannot find string with size in xml response:"
|
||||
echo "Regex: $re"
|
||||
echo "$msg"
|
||||
echo "$CURL_RESPONSE"
|
||||
test_failed_msg "$test_name" "$msg"
|
||||
test_finished_msg "$test_name"
|
||||
msg="ERROR: can't find string with size in xml response:"
|
||||
echo $msg
|
||||
echo $CURL_RESPONSE
|
||||
test_failed_msg $testname $msg $TC_PRINT
|
||||
test_finished_msg $testname $TC_PRINT
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -30,11 +30,9 @@ source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
WORK_DIR=$(pwd)
|
||||
JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_aarch64}
|
||||
NVDA_PATH=${NVDA_PATH:=$WORK_DIR/nvda_controllerClient}
|
||||
|
||||
function do_configure {
|
||||
sh ./configure \
|
||||
--enable-option-checking=fatal \
|
||||
--openjdk-target=aarch64-unknown-cygwin \
|
||||
$WITH_DEBUG_LEVEL \
|
||||
--with-vendor-name="$VENDOR_NAME" \
|
||||
@@ -46,12 +44,9 @@ function do_configure {
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--with-build-jdk=$BUILD_JDK \
|
||||
--with-nvdacontrollerclient=$NVDA_PATH \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
|| do_exit $?
|
||||
--enable-cds=yes || do_exit $?
|
||||
}
|
||||
|
||||
function create_image_bundle {
|
||||
@@ -63,20 +58,19 @@ function create_image_bundle {
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-aarch64-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
echo Running jlink ...
|
||||
${BUILD_JDK}/bin/jlink \
|
||||
--module-path $__modules_path --no-man-pages --compress=2 \
|
||||
--add-modules $__modules --output $__root_dir || do_exit $?
|
||||
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
|
||||
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__arch_name/release
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $__root_dir/release > release
|
||||
mv release $__root_dir/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip $__root_dir/lib
|
||||
for dir in $(ls -d $IMAGES_DIR/jdk/*); do
|
||||
rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
|
||||
rsync -a --exclude demo --exclude sample $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
fi
|
||||
@@ -103,13 +97,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
@@ -131,7 +125,6 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not unchanged
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
cat $JCEF_PATH/jcef.version >> $JSDK/release
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
@@ -24,7 +24,6 @@ source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
WORK_DIR=$(pwd)
|
||||
JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_x64}
|
||||
NVDA_PATH=${NVDA_PATH:=$WORK_DIR/nvda_controllerClient}
|
||||
|
||||
function do_configure {
|
||||
sh ./configure \
|
||||
@@ -37,7 +36,6 @@ function do_configure {
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--with-nvdacontrollerclient=$NVDA_PATH \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
@@ -54,7 +52,7 @@ function create_image_bundle {
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-x64-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
echo Running jlink ...
|
||||
${JSDK}/bin/jlink \
|
||||
@@ -65,9 +63,8 @@ function create_image_bundle {
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $__root_dir/release > release
|
||||
mv release $__root_dir/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip $__root_dir/lib
|
||||
for dir in $(ls -d $IMAGES_DIR/jdk/*); do
|
||||
rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
|
||||
rsync -a --exclude demo --exclude sample $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
fi
|
||||
@@ -94,13 +91,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
@@ -122,7 +119,6 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
|
||||
cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
|
||||
|
||||
jbr_name_postfix="_${bundle_type}"
|
||||
cat $JCEF_PATH/jcef.version >> $JSDK/release
|
||||
else
|
||||
jbr_name_postfix=""
|
||||
fi
|
||||
|
||||
@@ -19,8 +19,6 @@ set -x
|
||||
source jb/project/tools/common/scripts/common.sh
|
||||
|
||||
WORK_DIR=$(pwd)
|
||||
NVDA_PATH=${NVDA_PATH:=$WORK_DIR/nvda_controllerClient}
|
||||
|
||||
|
||||
function do_configure {
|
||||
sh ./configure \
|
||||
@@ -33,7 +31,6 @@ function do_configure {
|
||||
--with-version-opt=b${build_number} \
|
||||
--with-toolchain-version=$TOOLCHAIN_VERSION \
|
||||
--with-boot-jdk=$BOOT_JDK \
|
||||
--with-nvdacontrollerclient=$NVDA_PATH \
|
||||
--disable-ccache \
|
||||
--enable-cds=yes \
|
||||
$STATIC_CONF_ARGS \
|
||||
@@ -50,7 +47,7 @@ function create_image_bundle {
|
||||
fastdebug_infix=''
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-x86-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
echo Running jlink ...
|
||||
${JSDK}/bin/jlink \
|
||||
@@ -61,9 +58,8 @@ function create_image_bundle {
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
|
||||
sed 's/JBR/JBRSDK/g' $__root_dir/release > release
|
||||
mv release $__root_dir/release
|
||||
cp $IMAGES_DIR/jdk/lib/src.zip $__root_dir/lib
|
||||
for dir in $(ls -d $IMAGES_DIR/jdk/*); do
|
||||
rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
|
||||
rsync -a --exclude demo --exclude sample $dir $__root_dir
|
||||
done
|
||||
copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
|
||||
fi
|
||||
@@ -89,13 +85,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
|
||||
@@ -26,7 +26,7 @@ function pack_jbr {
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-aarch64-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
|
||||
@@ -51,7 +51,6 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-aarch64-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -26,7 +26,7 @@ function pack_jbr {
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-x64-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
|
||||
@@ -51,7 +51,6 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x64-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -22,7 +22,7 @@ function pack_jbr {
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-x86-${fastdebug_infix:-}b${build_number%%.*}
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
|
||||
@@ -32,8 +32,6 @@ function pack_jbr {
|
||||
[ "$bundle_type" == "nomod" ] && bundle_type=""
|
||||
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
RELEASE_NAME=windows-x86_64-server-release
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
BASE_DIR=.
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
@@ -47,7 +45,6 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x86-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $BASE_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -278,7 +278,16 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
|
||||
$(SYMBOLS_EXCLUDE_PATTERN), \
|
||||
$(ALL_JRE_FILES))
|
||||
|
||||
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
|
||||
# On Macosx release builds, when there is a code signing certificate available,
|
||||
# the final bundle layout can be signed.
|
||||
SIGN_BUNDLE := false
|
||||
ifeq ($(call isTargetOs, macosx)+$(DEBUG_LEVEL), true+release)
|
||||
ifneq ($(CODESIGN), )
|
||||
SIGN_BUNDLE := true
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SIGN_BUNDLE), true)
|
||||
# Macosx release build and code signing available.
|
||||
|
||||
################################################################################
|
||||
@@ -449,7 +458,7 @@ ifneq ($(filter jcov-bundles, $(MAKECMDGOALS)), )
|
||||
BUNDLE_NAME := $(JCOV_BUNDLE_NAME), \
|
||||
FILES := $(JCOV_BUNDLE_FILES), \
|
||||
BASE_DIRS := $(JCOV_IMAGE_DIR), \
|
||||
SUBDIR := jdk-$(VERSION_NUMBER), \
|
||||
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
|
||||
))
|
||||
|
||||
JCOV_TARGETS += $(BUILD_JCOV_BUNDLE)
|
||||
|
||||
@@ -171,41 +171,41 @@ $(BUILD_DEMO_CodePointIM_JAR): $(CODEPOINT_METAINF_SERVICE_FILE)
|
||||
|
||||
$(eval $(call SetupBuildDemo, FileChooserDemo, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked this-escape, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, SwingSet2, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
EXTRA_COPY_TO_JAR := .java, \
|
||||
EXTRA_MANIFEST_ATTR := SplashScreen-Image: resources/images/splash.png, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked static serial cast this-escape, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked static serial cast, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Font2DTest, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked serial cast this-escape, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked serial cast, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, J2Ddemo, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
MAIN_CLASS := java2d.J2Ddemo, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked cast lossy-conversions this-escape, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked cast, \
|
||||
JAR_NAME := J2Ddemo, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Metalworks, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked this-escape, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Notepad, \
|
||||
DISABLED_WARNINGS := rawtypes this-escape, \
|
||||
DISABLED_WARNINGS := rawtypes, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Stylepad, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked this-escape, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked, \
|
||||
EXTRA_SRC_DIR := $(DEMO_SHARE_SRC)/jfc/Notepad, \
|
||||
EXCLUDE_FILES := $(DEMO_SHARE_SRC)/jfc/Notepad/README.txt, \
|
||||
))
|
||||
@@ -215,12 +215,11 @@ $(eval $(call SetupBuildDemo, SampleTree, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, TableExample, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked deprecation this-escape, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked deprecation, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, TransparentRuler, \
|
||||
DISABLED_WARNINGS := this-escape, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
MAIN_CLASS := transparentruler.Ruler, \
|
||||
))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -48,30 +48,6 @@ $(BUILDTOOLS_OUTPUTDIR)/gensrc/%.interim/module-info.java: \
|
||||
TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
|
||||
$(INTERIM_LANGTOOLS_MODULES))
|
||||
|
||||
################################################################################
|
||||
# Generate interim versions of the ToolProvider.java files for the interim
|
||||
# langtools modules, which will allow to load javac from the interim
|
||||
# jdk.compiler.
|
||||
|
||||
INTERIM_TOOL_PROVIDER_PATTERN := \
|
||||
$(foreach m, $(INTERIM_LANGTOOLS_BASE_MODULES), -e 's/"$m"/"$m.interim"/g')
|
||||
|
||||
$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java: \
|
||||
$(TOPDIR)/src/java.compiler/share/classes/javax/tools/ToolProvider.java
|
||||
$(call LogInfo, Generating ToolProvider.java for java.compiler.interim)
|
||||
$(call MakeDir, $(@D))
|
||||
$(SED) $(INTERIM_TOOL_PROVIDER_PATTERN) $< > $@
|
||||
|
||||
java.compiler.interim_EXTRA_FILES := \
|
||||
$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java
|
||||
|
||||
TARGETS += $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java
|
||||
|
||||
################################################################################
|
||||
# Use the up-to-date PreviewFeature.java and NoPreview.java from the current
|
||||
# sources, instead of the versions from the boot JDK, as javac may be referring
|
||||
# to constants from the up-to-date versions.
|
||||
|
||||
$(eval $(call SetupCopyFiles, COPY_PREVIEW_FEATURES, \
|
||||
FILES := $(TOPDIR)/src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java \
|
||||
$(TOPDIR)/src/java.base/share/classes/jdk/internal/javac/NoPreview.java, \
|
||||
@@ -97,11 +73,8 @@ define SetupInterimModule
|
||||
$(TOPDIR)/src/$1/share/classes, \
|
||||
EXCLUDES := sun javax/tools/snippet-files, \
|
||||
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
|
||||
$(TOPDIR)/src/$1/share/classes/javax/tools/ToolProvider.java \
|
||||
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/Main.java \
|
||||
Standard.java, \
|
||||
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
|
||||
$($1.interim_EXTRA_FILES), \
|
||||
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
|
||||
COPY := .gif .png .xml .css .svg .js .js.template .txt javax.tools.JavaCompilerTool, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
|
||||
DISABLED_WARNINGS := module options, \
|
||||
@@ -110,9 +83,7 @@ define SetupInterimModule
|
||||
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
|
||||
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
|
||||
--add-exports java.base/jdk.internal.javac=java.compiler.interim \
|
||||
--add-exports java.base/jdk.internal.javac=jdk.compiler.interim \
|
||||
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.compiler.interim \
|
||||
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.javadoc.interim, \
|
||||
--add-exports java.base/jdk.internal.javac=jdk.compiler.interim, \
|
||||
))
|
||||
|
||||
$1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \
|
||||
@@ -128,20 +99,5 @@ $(foreach m, $(INTERIM_LANGTOOLS_BASE_MODULES), \
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Setup the compilation of the javac server build tool. Technically, this is not
|
||||
# really "interim" langtools, but just like it, it is needed henceforth for all
|
||||
# java compilation using the interim compiler.
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JAVAC_SERVER, \
|
||||
COMPILER := bootjdk, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(TOPDIR)/make/langtools/tools, \
|
||||
INCLUDES := javacserver, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_javacserver_classes, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_JAVAC_SERVER)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
@@ -121,8 +121,8 @@ TARGETS += $($(MODULE))
|
||||
# Since the other modules are declared in different invocations of this file,
|
||||
# use the macro to find the correct target file to depend on.
|
||||
# Only the javac compilation actually depends on other modules so limit
|
||||
# dependency declaration to that by using the *_MODFILELIST variable.
|
||||
$($(MODULE)_MODFILELIST): $(foreach d, $(call FindDepsForModule, $(MODULE)), \
|
||||
# dependency declaration to that by using the *_COMPILE_TARGET variable.
|
||||
$($(MODULE)_COMPILE_TARGET): $(foreach d, $(call FindDepsForModule, $(MODULE)), \
|
||||
$(call SetupJavaCompilationApiTarget, $d, \
|
||||
$(if $($d_BIN), $($d_BIN), $(JDK_OUTPUTDIR)/modules/$d)))
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JIGSAW_TOOLS, \
|
||||
build/tools/jigsaw, \
|
||||
COPY := .properties .html, \
|
||||
BIN := $(TOOLS_CLASSES_DIR), \
|
||||
DISABLED_WARNINGS := fallthrough this-escape, \
|
||||
DISABLED_WARNINGS := fallthrough, \
|
||||
JAVAC_FLAGS := \
|
||||
--add-modules jdk.jdeps \
|
||||
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -57,9 +57,7 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
|
||||
JAVAC_FLAGS := \
|
||||
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
|
||||
--add-exports java.base/sun.text=ALL-UNNAMED \
|
||||
--add-exports java.base/sun.security.util=ALL-UNNAMED \
|
||||
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.compiler.interim \
|
||||
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.javadoc.interim, \
|
||||
--add-exports java.base/sun.security.util=ALL-UNNAMED, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_TOOLS_JDK)
|
||||
@@ -71,13 +69,6 @@ $(eval $(call SetupCopyFiles,COPY_NIMBUS_TEMPLATES, \
|
||||
|
||||
TARGETS += $(COPY_NIMBUS_TEMPLATES)
|
||||
|
||||
$(eval $(call SetupCopyFiles,COPY_CLDRCONVERTER_PROPERTIES, \
|
||||
SRC := $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter, \
|
||||
DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/cldrconverter, \
|
||||
FILES := $(wildcard $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter/*.properties)))
|
||||
|
||||
TARGETS += $(COPY_CLDRCONVERTER_PROPERTIES)
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
|
||||
@@ -86,15 +77,6 @@ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
|
||||
INCLUDES := build/tools/depend, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
JAVAC_FLAGS := \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
|
||||
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.compiler.interim \
|
||||
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.javadoc.interim, \
|
||||
))
|
||||
|
||||
DEPEND_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services/com.sun.source.util.Plugin
|
||||
|
||||
@@ -226,20 +226,6 @@ else
|
||||
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}'
|
||||
endif
|
||||
|
||||
# Unless we are creating a very large module, use the small tool JVM options
|
||||
JMOD_SMALL_FLAGS :=
|
||||
ifeq ($(findstring $(MODULE), java.base java.desktop jdk.localedata), )
|
||||
JMOD_SMALL_FLAGS += $(JAVA_TOOL_FLAGS_SMALL)
|
||||
endif
|
||||
|
||||
ifeq ($(INTERIM_JMOD), true)
|
||||
# Interim JMODs are not shipped anywhere, so there is no reason
|
||||
# to compress them at all.
|
||||
JMOD_FLAGS += --compress zip-0
|
||||
else
|
||||
JMOD_FLAGS += --compress $(JMOD_COMPRESS)
|
||||
endif
|
||||
|
||||
# Create jmods in the support dir and then move them into place to keep the
|
||||
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
|
||||
$(eval $(call SetupExecute, create_$(JMOD_FILE), \
|
||||
@@ -248,7 +234,7 @@ $(eval $(call SetupExecute, create_$(JMOD_FILE), \
|
||||
OUTPUT_FILE := $(JMODS_DIR)/$(JMOD_FILE), \
|
||||
SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
|
||||
PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
|
||||
COMMAND := $(JMOD) $(JMOD_SMALL_FLAGS) create --module-version $(VERSION_SHORT) \
|
||||
COMMAND := $(JMOD) create --module-version $(VERSION_SHORT) \
|
||||
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
|
||||
--module-path $(JMODS_DIR) $(JMOD_FLAGS) \
|
||||
--date $(SOURCE_DATE_ISO_8601) \
|
||||
|
||||
169
make/Docs.gmk
169
make/Docs.gmk
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -69,6 +69,8 @@ JAVADOC_TAGS := \
|
||||
-tag beaninfo:X \
|
||||
-tag revised:X \
|
||||
-tag since.unbundled:X \
|
||||
-tag spec:X \
|
||||
-tag specdefault:X \
|
||||
-tag Note:X \
|
||||
-tag ToDo:X \
|
||||
-tag 'apiNote:a:API Note:' \
|
||||
@@ -80,12 +82,10 @@ JAVADOC_TAGS := \
|
||||
-taglet build.tools.taglet.JSpec\$$JLS \
|
||||
-taglet build.tools.taglet.JSpec\$$JVMS \
|
||||
-taglet build.tools.taglet.ModuleGraph \
|
||||
-taglet build.tools.taglet.SealedGraph \
|
||||
-taglet build.tools.taglet.ToolGuide \
|
||||
-tag since \
|
||||
-tag serialData \
|
||||
-tag factory \
|
||||
-tag spec \
|
||||
-tag see \
|
||||
-taglet build.tools.taglet.ExtLink \
|
||||
-taglet build.tools.taglet.Incubating \
|
||||
@@ -102,23 +102,17 @@ REFERENCE_TAGS := $(JAVADOC_TAGS)
|
||||
JAVADOC_DISABLED_DOCLINT_WARNINGS := missing
|
||||
JAVADOC_DISABLED_DOCLINT_PACKAGES := org.w3c.* javax.smartcardio
|
||||
|
||||
# Allow overriding on the command line
|
||||
# (intentionally sharing name with the javac option)
|
||||
JAVA_WARNINGS_ARE_ERRORS ?= -Werror
|
||||
|
||||
# The initial set of options for javadoc
|
||||
JAVADOC_OPTIONS := -use -keywords -notimestamp \
|
||||
-encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
|
||||
-splitIndex --system none -javafx --expand-requires transitive \
|
||||
--override-methods=summary \
|
||||
--no-external-specs-page
|
||||
--override-methods=summary
|
||||
|
||||
# The reference options must stay stable to allow for comparisons across the
|
||||
# development cycle.
|
||||
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
|
||||
-encoding ISO-8859-1 -breakiterator -splitIndex --system none \
|
||||
-html5 -javafx --expand-requires transitive \
|
||||
--no-external-specs-page
|
||||
-html5 -javafx --expand-requires transitive
|
||||
|
||||
# Should we add DRAFT stamps to the generated javadoc?
|
||||
ifeq ($(VERSION_IS_GA), true)
|
||||
@@ -194,55 +188,25 @@ JAVASE_LONG_NAME := Java<sup>®</sup> Platform, Standard Edition
|
||||
# Functions
|
||||
|
||||
# Helper function for creating a svg file from a dot file generated by the
|
||||
# GenGraphs tool for a module.
|
||||
# GenGraphs tool.
|
||||
# param 1: SetupJavadocGeneration namespace ($1)
|
||||
# param 2: module name
|
||||
#
|
||||
define setup_module_graph_dot_to_svg
|
||||
$1_$2_DOT_SRC := $$($1_MODULE_GRAPHS_DIR)/$2.dot
|
||||
define setup_gengraph_dot_to_svg
|
||||
$1_$2_DOT_SRC := $$($1_GENGRAPHS_DIR)/$2.dot
|
||||
$1_$2_SVG_TARGET := $$($1_TARGET_DIR)/$2/module-graph.svg
|
||||
|
||||
# For each module needing a graph, create a svg file from the dot file
|
||||
# generated by the GenGraphs tool and store it in the target dir.
|
||||
$$(eval $$(call SetupExecute, module_graphs_svg_$1_$2, \
|
||||
$$(eval $$(call SetupExecute, gengraphs_svg_$1_$2, \
|
||||
INFO := Running dot for module graphs for $2, \
|
||||
DEPS := $$(module_graphs_dot_$1_TARGET), \
|
||||
DEPS := $$(gengraphs_$1_TARGET), \
|
||||
OUTPUT_FILE := $$($1_$2_SVG_TARGET), \
|
||||
SUPPORT_DIR := $$($1_MODULE_GRAPHS_DIR), \
|
||||
SUPPORT_DIR := $$($1_GENGRAPHS_DIR), \
|
||||
COMMAND := $$(DOT) -Tsvg -o $$($1_$2_SVG_TARGET) $$($1_$2_DOT_SRC), \
|
||||
))
|
||||
|
||||
$1_GRAPHS_TARGETS += $$($1_$2_SVG_TARGET)
|
||||
endef
|
||||
|
||||
# Helper function for creating a svg file for a class for which the SealedGraph
|
||||
# taglet has generated a dot file. The dot file has a special name which
|
||||
# encodes the module and class the graph belongs to.
|
||||
#
|
||||
# param 1: SetupJavadocGeneration namespace ($1)
|
||||
# param 2: dot file name
|
||||
#
|
||||
define setup_sealed_graph_dot_to_svg
|
||||
$1_$2_DOT_SRC := $$($1_SEALED_GRAPHS_DIR)/$2.dot
|
||||
$1_$2_TARGET_CLASS := $$(word 2, $$(subst _, , $2))
|
||||
$1_$2_SLASHED_NAME := $$(subst .,/, $$($1_$2_TARGET_CLASS))
|
||||
$1_$2_TARGET_MODULE := $$(word 1, $$(subst _, , $2))
|
||||
$1_$2_TARGET_PATH := $$($1_TARGET_DIR)/$$($1_$2_TARGET_MODULE)/$$(dir $$($1_$2_SLASHED_NAME))
|
||||
$1_$2_TARGET_NAME := $$(notdir $$($1_$2_SLASHED_NAME))
|
||||
$1_$2_SVG_TARGET := $$($1_$2_TARGET_PATH)/$$($1_$2_TARGET_NAME)-sealed-graph.svg
|
||||
$$(call MakeDir, $$($1_$2_TARGET_PATH))
|
||||
|
||||
# For each class needing a graph, create a svg file from the dot file
|
||||
# generated by the SealedGraph taglet and store it in the target dir.
|
||||
$$(eval $$(call SetupExecute, sealed_graphs_svg_$1_$2, \
|
||||
INFO := Running dot for sealed graphs for $$($1_$2_TARGET_MODULE)/$$($1_$2_TARGET_CLASS), \
|
||||
DEPS := $$($1_$2_DOT_SRC), \
|
||||
OUTPUT_FILE := $$($1_$2_SVG_TARGET), \
|
||||
SUPPORT_DIR := $$($1_SEALED_GRAPHS_DIR), \
|
||||
COMMAND := $$(DOT) -Tsvg -o $$($1_$2_SVG_TARGET) $$($1_$2_DOT_SRC), \
|
||||
))
|
||||
|
||||
$1_GRAPHS_TARGETS += $$($1_$2_SVG_TARGET)
|
||||
$1_MODULEGRAPH_TARGETS += $$($1_$2_SVG_TARGET)
|
||||
endef
|
||||
|
||||
# Helper function to create the overview.html file to use with the -overview
|
||||
@@ -290,7 +254,7 @@ endef
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix.
|
||||
# Targets generated are returned as $1_JAVADOC_TARGETS and
|
||||
# $1_GRAPHS_TARGETS. Note that the index.html file will work as a "touch
|
||||
# $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
|
||||
# file" for all the magnitude of files that are generated by javadoc.
|
||||
#
|
||||
# Remaining parameters are named arguments. These include:
|
||||
@@ -313,12 +277,9 @@ define SetupApiDocsGenerationBody
|
||||
-Djspec.version=$$(VERSION_SPECIFICATION)
|
||||
|
||||
ifeq ($$(ENABLE_FULL_DOCS), true)
|
||||
$1_SEALED_GRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-sealed-graphs
|
||||
|
||||
# Tell the ModuleGraph and SealedGraph taglets to generate html links to
|
||||
# soon-to-be-created svg files with module/sealed graphs.
|
||||
$1_JAVA_ARGS += -DenableModuleGraph=true -DsealedDotOutputDir=$$($1_SEALED_GRAPHS_DIR)
|
||||
$$(call MakeDir, $$($1_SEALED_GRAPHS_DIR))
|
||||
# Tell the ModuleGraph taglet to generate html links to soon-to-be-created
|
||||
# svg files with module graphs.
|
||||
$1_JAVA_ARGS += -DenableModuleGraph=true
|
||||
endif
|
||||
|
||||
# Start with basic options and tags
|
||||
@@ -339,7 +300,6 @@ define SetupApiDocsGenerationBody
|
||||
# Ignore the doclint warnings in certain packages
|
||||
$1_OPTIONS += -Xdoclint/package:$$(call CommaList, $$(addprefix -, \
|
||||
$$(JAVADOC_DISABLED_DOCLINT_PACKAGES)))
|
||||
$1_OPTIONS += $$(JAVA_WARNINGS_ARE_ERRORS)
|
||||
|
||||
$1_DOC_TITLE := $$($1_LONG_NAME)<br>Version $$(VERSION_SPECIFICATION) API \
|
||||
Specification
|
||||
@@ -425,46 +385,30 @@ define SetupApiDocsGenerationBody
|
||||
|
||||
# First we run the GenGraph tool. It will query the module structure of the
|
||||
# running JVM and output .dot files for all existing modules.
|
||||
MODULE_GRAPHS_PROPS := \
|
||||
GENGRAPHS_PROPS := \
|
||||
$$(TOPDIR)/make/jdk/src/classes/build/tools/jigsaw/javadoc-graphs.properties
|
||||
|
||||
$1_MODULE_GRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-module-graphs
|
||||
$1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
|
||||
|
||||
$$(eval $$(call SetupExecute, module_graphs_dot_$1, \
|
||||
INFO := Generating module graphs for $1 documentation, \
|
||||
DEPS := $$(BUILD_JIGSAW_TOOLS) $$(MODULE_GRAPHS_PROPS), \
|
||||
OUTPUT_DIR := $$($1_MODULE_GRAPHS_DIR), \
|
||||
COMMAND := $$(TOOL_GENGRAPHS) --spec --output $$($1_MODULE_GRAPHS_DIR) \
|
||||
--dot-attributes $$(MODULE_GRAPHS_PROPS), \
|
||||
$$(eval $$(call SetupExecute, gengraphs_$1, \
|
||||
INFO := Running gengraphs for $1 documentation, \
|
||||
DEPS := $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS), \
|
||||
OUTPUT_DIR := $$($1_GENGRAPHS_DIR), \
|
||||
COMMAND := $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
|
||||
--dot-attributes $$(GENGRAPHS_PROPS), \
|
||||
))
|
||||
|
||||
# For each module needing a graph, create a svg file from the dot file
|
||||
# generated by the GenGraphs tool and store it in the target dir.
|
||||
# They will depend on module_graphs_dot_$1_TARGET, and will be added to
|
||||
# $1_GRAPHS_TARGETS.
|
||||
# They will depend on gengraphs_$1_TARGET, and will be added to $1.
|
||||
$$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
|
||||
$$(eval $$(call setup_module_graph_dot_to_svg,$1,$$m)) \
|
||||
)
|
||||
|
||||
# We have asked SealedGraph to generate dot files and links to svg files.
|
||||
# Now we must produce the svg files from the dot files.
|
||||
|
||||
# Get a list of classes for which SealedGraph has generated dot files
|
||||
$1_SEALED_CLASSES := $$(patsubst %.dot,%,$$(patsubst \
|
||||
$$($1_SEALED_GRAPHS_DIR)/%,%, \
|
||||
$$(wildcard $$($1_SEALED_GRAPHS_DIR)/*.dot)))
|
||||
|
||||
# For each class needing a graph, create a svg file from the dot file
|
||||
# generated by the SealedGraph taglet and store it in the target dir.
|
||||
# They will will be added to $1_GRAPHS_TARGETS.
|
||||
$$(foreach c, $$($1_SEALED_CLASSES), \
|
||||
$$(eval $$(call setup_sealed_graph_dot_to_svg,$1,$$c)) \
|
||||
$$(eval $$(call setup_gengraph_dot_to_svg,$1,$$m)) \
|
||||
)
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Setup generation of the JDK API documentation (javadoc + graphs)
|
||||
# Setup generation of the JDK API documentation (javadoc + modulegraph)
|
||||
|
||||
# Define the groups of the JDK API documentation
|
||||
JavaSE_GROUP_NAME := Java SE
|
||||
@@ -513,10 +457,10 @@ $(eval $(call SetupApiDocsGeneration, JDK_API, \
|
||||
))
|
||||
|
||||
# Targets generated are returned in JDK_API_JAVADOC_TARGETS and
|
||||
# JDK_API_GRAPHS_TARGETS.
|
||||
# JDK_API_MODULEGRAPH_TARGETS.
|
||||
|
||||
################################################################################
|
||||
# Setup generation of the Java SE API documentation (javadoc + graphs)
|
||||
# Setup generation of the Java SE API documentation (javadoc + modulegraph)
|
||||
|
||||
# The Java SE module scope is just java.se and its transitive indirect
|
||||
# exports.
|
||||
@@ -530,10 +474,10 @@ $(eval $(call SetupApiDocsGeneration, JAVASE_API, \
|
||||
))
|
||||
|
||||
# Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
|
||||
# JAVASE_API_GRAPHS_TARGETS.
|
||||
# JAVASE_API_MODULEGRAPH_TARGETS.
|
||||
|
||||
################################################################################
|
||||
# Setup generation of the reference Java SE API documentation (javadoc + graphs)
|
||||
# Setup generation of the reference Java SE API documentation (javadoc + modulegraph)
|
||||
|
||||
# The reference javadoc is just the same as javase, but using the BootJDK javadoc
|
||||
# and a stable set of javadoc options. Typically it is used for generating
|
||||
@@ -551,7 +495,7 @@ $(eval $(call SetupApiDocsGeneration, REFERENCE_API, \
|
||||
))
|
||||
|
||||
# Targets generated are returned in REFERENCE_API_JAVADOC_TARGETS and
|
||||
# REFERENCE_API_GRAPHS_TARGETS.
|
||||
# REFERENCE_API_MODULEGRAPH_TARGETS.
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -621,7 +565,7 @@ $(foreach n, 0 1 2, \
|
||||
$(eval specs_bottom_rel_path := $(specs_bottom_rel_path)../) \
|
||||
)
|
||||
|
||||
SPECS_TOP := $(if $(filter true, $(IS_DRAFT)), <header class="draft-header" role="banner">$(DRAFT_TEXT)</header>)
|
||||
SPECS_TOP := $(if $(filter true, $(IS_DRAFT)), <header class="draft-header">$(DRAFT_TEXT)</header>)
|
||||
|
||||
# For all html files in $module/share/specs directories, copy and add the
|
||||
# copyright footer.
|
||||
@@ -650,9 +594,6 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
# html, if we have pandoc (otherwise we'll just skip this).
|
||||
|
||||
GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
|
||||
# Unset the following to suppress the link to the tool guides
|
||||
NAV_LINK_GUIDES := --nav-link-guides
|
||||
HEADER_RIGHT_SIDE_INFO := <strong>$(subst &,&,$(JDK_SHORT_NAME))$(DRAFT_MARKER_STR)</strong>
|
||||
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
|
||||
@@ -669,8 +610,7 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
REPLACEMENTS := \
|
||||
@@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION) ; \
|
||||
@@VERSION_STRING@@ => $(VERSION_STRING), \
|
||||
POST_PROCESS := $(TOOL_FIXUPPANDOC) --insert-nav --nav-right-info '$(HEADER_RIGHT_SIDE_INFO)' \
|
||||
--nav-subdirs $($m_$f_NOF_SUBDIRS) $(NAV_LINK_GUIDES), \
|
||||
POST_PROCESS := $(TOOL_FIXUPPANDOC), \
|
||||
)) \
|
||||
$(eval JDK_SPECS_TARGETS += $($($m_$f_NAME))) \
|
||||
) \
|
||||
@@ -704,8 +644,7 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
@@VERSION_SHORT@@ => $(VERSION_SHORT) ; \
|
||||
@@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION), \
|
||||
OPTIONS := --toc -V include-before='$(SPECS_TOP)' -V include-after='$(SPECS_BOTTOM_1)', \
|
||||
POST_PROCESS := $(TOOL_FIXUPPANDOC) --insert-nav --nav-right-info '$(HEADER_RIGHT_SIDE_INFO)' \
|
||||
--nav-subdirs 1 --nav-link-guides, \
|
||||
POST_PROCESS := $(TOOL_FIXUPPANDOC), \
|
||||
EXTRA_DEPS := $(PANDOC_HTML_MANPAGE_FILTER) \
|
||||
$(PANDOC_HTML_MANPAGE_FILTER_SOURCE), \
|
||||
)) \
|
||||
@@ -720,25 +659,13 @@ endif
|
||||
|
||||
# Special treatment for generated documentation
|
||||
|
||||
SPEC_HEADER_BLOCK := \
|
||||
<header id="title-block-header"> \
|
||||
<div class="navbar"> \
|
||||
<div>$(HEADER_RIGHT_SIDE_INFO)</div> \
|
||||
<nav><ul><li><a href="PATH_TO_SPECS/../api/index.html">API</a> \
|
||||
<li><a href="PATH_TO_SPECS/index.html">OTHER SPECIFICATIONS \
|
||||
<li><a href="PATH_TO_SPECS/man/index.html">TOOL GUIDES</a></ul></nav> \
|
||||
</div> \
|
||||
</header>
|
||||
|
||||
JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
|
||||
ifneq ($(call ApplySpecFilter, $(JDWP_PROTOCOL)), )
|
||||
JDWP_HEADER_BLOCK := $(subst PATH_TO_SPECS,..,$(SPEC_HEADER_BLOCK))
|
||||
$(eval $(call SetupTextFileProcessing, PROCESS_JDWP_PROTOCOL, \
|
||||
SOURCE_FILES := $(JDWP_PROTOCOL), \
|
||||
OUTPUT_DIR := $(DOCS_OUTPUTDIR)/specs/jdwp, \
|
||||
REPLACEMENTS := \
|
||||
<style> => <link rel="stylesheet" href="../../resources/jdk-default.css"/><style> ; \
|
||||
<body> => <body>$(SPECS_TOP)$(JDWP_HEADER_BLOCK) ; \
|
||||
<body> => <body>$(SPECS_TOP) ; \
|
||||
</body> => $(SPECS_BOTTOM_1)</body>, \
|
||||
))
|
||||
JDK_SPECS_TARGETS += $(PROCESS_JDWP_PROTOCOL)
|
||||
@@ -747,13 +674,11 @@ endif
|
||||
# Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
|
||||
JVMTI_HTML ?= $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
|
||||
ifneq ($(call ApplySpecFilter, $(JVMTI_HTML)), )
|
||||
JVMTI_HEADER_BLOCK := $(subst PATH_TO_SPECS,.,$(SPEC_HEADER_BLOCK))
|
||||
$(eval $(call SetupTextFileProcessing, PROCESS_JVMTI_HTML, \
|
||||
SOURCE_FILES := $(JVMTI_HTML), \
|
||||
OUTPUT_DIR := $(DOCS_OUTPUTDIR)/specs/, \
|
||||
REPLACEMENTS := \
|
||||
<style> => <link rel="stylesheet" href="../resources/jdk-default.css"/><style> ; \
|
||||
<body> => <body>$(SPECS_TOP)$(JVMTI_HEADER_BLOCK) ; \
|
||||
<body> => <body>$(SPECS_TOP) ; \
|
||||
</body> => $(SPECS_BOTTOM_0)</body>, \
|
||||
))
|
||||
JDK_SPECS_TARGETS += $(PROCESS_JVMTI_HTML)
|
||||
@@ -768,7 +693,7 @@ JAVADOC_ZIP_FILE := $(OUTPUTDIR)/bundles/$(JAVADOC_ZIP_NAME)
|
||||
$(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
|
||||
SRC := $(DOCS_OUTPUTDIR), \
|
||||
ZIP := $(JAVADOC_ZIP_FILE), \
|
||||
EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_GRAPHS_TARGETS) \
|
||||
EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
|
||||
$(JDK_SPECS_TARGETS), \
|
||||
))
|
||||
|
||||
@@ -796,15 +721,15 @@ SPECS_ZIP_TARGETS += $(BUILD_SPECS_ZIP)
|
||||
|
||||
docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS) $(JDK_API_CUSTOM_TARGETS)
|
||||
|
||||
docs-jdk-api-graphs: $(JDK_API_GRAPHS_TARGETS)
|
||||
docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
|
||||
|
||||
docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS) $(JAVASE_API_CUSTOM_TARGETS)
|
||||
|
||||
docs-javase-api-graphs: $(JAVASE_API_GRAPHS_TARGETS)
|
||||
docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
|
||||
|
||||
docs-reference-api-javadoc: $(REFERENCE_API_JAVADOC_TARGETS) $(REFERENCE_API_CUSTOM_TARGETS)
|
||||
|
||||
docs-reference-api-graphs: $(REFERENCE_API_GRAPHS_TARGETS)
|
||||
docs-reference-api-modulegraph: $(REFERENCE_API_MODULEGRAPH_TARGETS)
|
||||
|
||||
docs-jdk-specs: $(JDK_SPECS_TARGETS)
|
||||
|
||||
@@ -814,12 +739,12 @@ docs-zip: $(ZIP_TARGETS)
|
||||
|
||||
docs-specs-zip: $(SPECS_ZIP_TARGETS)
|
||||
|
||||
all: docs-jdk-api-javadoc docs-jdk-api-graphs docs-javase-api-javadoc \
|
||||
docs-javase-api-graphs docs-reference-api-javadoc \
|
||||
docs-reference-api-graphs docs-jdk-specs docs-jdk-index docs-zip \
|
||||
all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
|
||||
docs-javase-api-modulegraph docs-reference-api-javadoc \
|
||||
docs-reference-api-modulegraph docs-jdk-specs docs-jdk-index docs-zip \
|
||||
docs-specs-zip
|
||||
|
||||
.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-graphs \
|
||||
docs-javase-api-javadoc docs-javase-api-graphs \
|
||||
docs-reference-api-javadoc docs-reference-api-graphs docs-jdk-specs \
|
||||
.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
|
||||
docs-javase-api-javadoc docs-javase-api-modulegraph \
|
||||
docs-reference-api-javadoc docs-reference-api-modulegraph docs-jdk-specs \
|
||||
docs-jdk-index docs-zip docs-specs-zip
|
||||
|
||||
@@ -134,7 +134,7 @@ epilogue: check-bad-file-names
|
||||
$(ECHO) '* The build README (doc/building.md) is a great source of information,'
|
||||
$(ECHO) 'especially the chapter "Fixing Unexpected Build Failures". Check it out!'
|
||||
$(ECHO)
|
||||
$(ECHO) '* If you still need assistance please contact build-dev@openjdk.org.'
|
||||
$(ECHO) '* If you still need assistance please contact build-dev@openjdk.java.net.'
|
||||
$(ECHO)
|
||||
|
||||
TARGETS += epilogue
|
||||
|
||||
@@ -125,11 +125,6 @@ test-prebuilt:
|
||||
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
|
||||
test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
|
||||
|
||||
test-prebuilt-with-exit-code:
|
||||
@( cd $(topdir) && \
|
||||
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
|
||||
test-prebuilt-with-exit-code CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
|
||||
|
||||
# Alias for backwards compatibility
|
||||
run-test-prebuilt: test-prebuilt
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -114,66 +114,67 @@ $(eval $(call SetupExecute, jlink_jre, \
|
||||
|
||||
JLINK_JRE_TARGETS := $(jlink_jre)
|
||||
|
||||
# Optimize CDS shared heap for small heap sizes, which are typically used
|
||||
# for small cloud-based apps that have the most critical start-up requirement.
|
||||
# The trade-off is that when larger heap sizes are used, the shared heap
|
||||
# may need to be relocated at runtime.
|
||||
CDS_DUMP_FLAGS = -Xmx128M -Xms128M
|
||||
|
||||
# Helper function for creating the CDS archives for the JDK and JRE
|
||||
#
|
||||
# Param1 - VM variant (e.g., server, client, zero, ...)
|
||||
# Param2 - _nocoops, or empty
|
||||
define CreateCDSArchive
|
||||
$1_$2_DUMP_EXTRA_ARG := $(if $(filter _nocoops, $2),-XX:-UseCompressedOops,)
|
||||
$1_$2_DUMP_TYPE := $(if $(filter _nocoops, $2),-NOCOOPS,)
|
||||
|
||||
# Only G1 supports dumping the shared heap, so explicitly use G1 if the JVM supports it.
|
||||
$1_$2_CDS_DUMP_FLAGS := $(CDS_DUMP_FLAGS) $(if $(filter g1gc, $(JVM_FEATURES_$1)),-XX:+UseG1GC)
|
||||
|
||||
ifeq ($(BUILD_CDS_ARCHIVE), true)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1_$2_CDS_ARCHIVE := bin/$1/classes$2.jsa
|
||||
CDS_ARCHIVE := bin/server/classes.jsa
|
||||
CDS_NOCOOPS_ARCHIVE := bin/server/classes_nocoops.jsa
|
||||
else
|
||||
$1_$2_CDS_ARCHIVE := lib/$1/classes$2.jsa
|
||||
CDS_ARCHIVE := lib/server/classes.jsa
|
||||
CDS_NOCOOPS_ARCHIVE := lib/server/classes_nocoops.jsa
|
||||
endif
|
||||
|
||||
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jdk, \
|
||||
WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jdk image for $1, \
|
||||
INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
|
||||
DEPS := $$(jlink_jdk), \
|
||||
OUTPUT_FILE := $$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE), \
|
||||
SUPPORT_DIR := $$(SUPPORT_OUTPUTDIR)/images/jdk, \
|
||||
COMMAND := $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE) \
|
||||
-$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
|
||||
$(eval $(call SetupExecute, gen_cds_archive_jdk, \
|
||||
WARN := Creating CDS archive for jdk image, \
|
||||
DEPS := $(jlink_jdk), \
|
||||
OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_ARCHIVE), \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
|
||||
COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$(JDK_IMAGE_DIR)/$(CDS_ARCHIVE) \
|
||||
-Xmx128M -Xms128M $(LOG_INFO), \
|
||||
))
|
||||
|
||||
JDK_TARGETS += $$($1_$2_gen_cds_archive_jdk)
|
||||
JDK_TARGETS += $(gen_cds_archive_jdk)
|
||||
|
||||
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jre, \
|
||||
WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jre image for $1, \
|
||||
INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
|
||||
DEPS := $$(jlink_jre), \
|
||||
OUTPUT_FILE := $$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE), \
|
||||
SUPPORT_DIR := $$(SUPPORT_OUTPUTDIR)/images/jre, \
|
||||
COMMAND := $$(FIXPATH) $$(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE) \
|
||||
-$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
|
||||
$(eval $(call SetupExecute, gen_cds_archive_jre, \
|
||||
WARN := Creating CDS archive for jre image, \
|
||||
DEPS := $(jlink_jre), \
|
||||
OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_ARCHIVE), \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
|
||||
COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$(JRE_IMAGE_DIR)/$(CDS_ARCHIVE) \
|
||||
-Xmx128M -Xms128M $(LOG_INFO), \
|
||||
))
|
||||
|
||||
JRE_TARGETS += $$($1_$2_gen_cds_archive_jre)
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_CDS_ARCHIVE), true)
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval $(call CreateCDSArchive,$v,)) \
|
||||
)
|
||||
JRE_TARGETS += $(gen_cds_archive_jre)
|
||||
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval $(call CreateCDSArchive,$v,_nocoops)) \
|
||||
)
|
||||
$(eval $(call SetupExecute, gen_cds_nocoops_archive_jdk, \
|
||||
WARN := Creating CDS-NOCOOPS archive for jdk image, \
|
||||
DEPS := $(jlink_jdk), \
|
||||
OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE), \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
|
||||
COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$(JDK_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE) \
|
||||
-XX:-UseCompressedOops \
|
||||
-Xmx128M -Xms128M $(LOG_INFO), \
|
||||
))
|
||||
|
||||
JDK_TARGETS += $(gen_cds_nocoops_archive_jdk)
|
||||
|
||||
$(eval $(call SetupExecute, gen_cds_nocoops_archive_jre, \
|
||||
WARN := Creating CDS-NOCOOPS archive for jre image, \
|
||||
DEPS := $(jlink_jre), \
|
||||
OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE), \
|
||||
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
|
||||
COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
|
||||
-XX:SharedArchiveFile=$(JRE_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE) \
|
||||
-XX:-UseCompressedOops \
|
||||
-Xmx128M -Xms128M $(LOG_INFO), \
|
||||
))
|
||||
|
||||
JRE_TARGETS += $(gen_cds_nocoops_archive_jre)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -277,20 +277,15 @@ else # HAS_SPEC=true
|
||||
$(ECHO) $(CONFIGURE_COMMAND_LINE)
|
||||
|
||||
reconfigure:
|
||||
ifneq ($(REAL_CONFIGURE_COMMAND_EXEC_FULL), )
|
||||
$(ECHO) "Re-running configure using original command line '$(REAL_CONFIGURE_COMMAND_EXEC_SHORT) $(REAL_CONFIGURE_COMMAND_LINE)'"
|
||||
$(eval RECONFIGURE_COMMAND := $(REAL_CONFIGURE_COMMAND_EXEC_FULL) $(REAL_CONFIGURE_COMMAND_LINE))
|
||||
else ifneq ($(CONFIGURE_COMMAND_LINE), )
|
||||
ifneq ($(CONFIGURE_COMMAND_LINE), )
|
||||
$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
|
||||
$(eval RECONFIGURE_COMMAND := $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE))
|
||||
else
|
||||
$(ECHO) "Re-running configure using default settings"
|
||||
$(eval RECONFIGURE_COMMAND := $(BASH) $(TOPDIR)/configure)
|
||||
endif
|
||||
( cd $(CONFIGURE_START_DIR) && PATH="$(ORIGINAL_PATH)" AUTOCONF="$(AUTOCONF)" \
|
||||
CUSTOM_ROOT="$(CUSTOM_ROOT)" \
|
||||
CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \
|
||||
$(RECONFIGURE_COMMAND) )
|
||||
$(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
|
||||
|
||||
##############################################################################
|
||||
# The main target, for delegating into Main.gmk
|
||||
@@ -324,7 +319,7 @@ else # HAS_SPEC=true
|
||||
ifneq ($(PARALLEL_TARGETS), )
|
||||
$(call PrepareFailureLogs)
|
||||
$(call StartGlobalTimer)
|
||||
$(call PrepareJavacServer)
|
||||
$(call PrepareSmartJavac)
|
||||
# JOBS will only be empty for a bootcycle-images recursive call
|
||||
# or if specified via a make argument directly. In those cases
|
||||
# treat it as NOT using jobs at all.
|
||||
@@ -339,7 +334,7 @@ else # HAS_SPEC=true
|
||||
cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \
|
||||
HAS_SPEC=true on-failure ; \
|
||||
exit $$exitcode ) )
|
||||
$(call CleanupJavacServer)
|
||||
$(call CleanupSmartJavac)
|
||||
$(call StopGlobalTimer)
|
||||
$(call ReportBuildTimes)
|
||||
endif
|
||||
@@ -351,7 +346,7 @@ else # HAS_SPEC=true
|
||||
endif
|
||||
|
||||
on-failure:
|
||||
$(call CleanupJavacServer)
|
||||
$(call CleanupSmartJavac)
|
||||
$(call StopGlobalTimer)
|
||||
$(call ReportBuildTimes)
|
||||
$(call PrintFailureReports)
|
||||
@@ -364,11 +359,11 @@ else # HAS_SPEC=true
|
||||
|
||||
# Support targets for COMPARE_BUILD, used for makefile development
|
||||
pre-compare-build:
|
||||
$(call WaitForJavacServerFinish)
|
||||
$(call WaitForSmartJavacFinish)
|
||||
$(call PrepareCompareBuild)
|
||||
|
||||
post-compare-build:
|
||||
$(call WaitForJavacServerFinish)
|
||||
$(call WaitForSmartJavacFinish)
|
||||
$(call CleanupCompareBuild)
|
||||
$(call CompareBuildDoComparison)
|
||||
|
||||
|
||||
@@ -204,15 +204,6 @@ ifeq ($(HAS_SPEC),)
|
||||
# Otherwise select those that contain the given CONF string
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
|
||||
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
|
||||
# If we found an exact match, use that
|
||||
matching_confs := $$(CONF)
|
||||
# Don't repeat this output on make restarts caused by including
|
||||
# generated files.
|
||||
ifeq ($$(MAKE_RESTARTS),)
|
||||
$$(info Using exact match for CONF=$$(CONF) (other matches are possible))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifeq ($$(matching_confs),)
|
||||
$$(info Error: No configurations found matching CONF=$$(CONF).)
|
||||
@@ -435,10 +426,10 @@ else # $(HAS_SPEC)=true
|
||||
# Compare first and second build. Ignore any error code from compare.sh.
|
||||
$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
|
||||
$(if $(COMPARE_BUILD_COMP_DIR), \
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh -vv $(COMPARE_BUILD_COMP_OPTS) \
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
|
||||
-2dirs $(COMPARE_BUILD_OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) \
|
||||
$(OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) $(COMPARE_BUILD_IGNORE_RESULT)), \
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh -vv $(COMPARE_BUILD_COMP_OPTS) \
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
|
||||
-o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
|
||||
)
|
||||
endef
|
||||
@@ -502,15 +493,15 @@ else # $(HAS_SPEC)=true
|
||||
|
||||
# Remove any javac server logs and port files. This
|
||||
# prevents a new make run to reuse the previous servers.
|
||||
define PrepareJavacServer
|
||||
define PrepareSmartJavac
|
||||
$(if $(JAVAC_SERVER_DIR), \
|
||||
$(RM) -r $(JAVAC_SERVER_DIR) 2> /dev/null && \
|
||||
$(MKDIR) -p $(JAVAC_SERVER_DIR) \
|
||||
)
|
||||
endef
|
||||
|
||||
define CleanupJavacServer
|
||||
[ -f $(JAVAC_SERVER_DIR)/server.port ] && $(ECHO) Stopping javac server && \
|
||||
define CleanupSmartJavac
|
||||
[ -f $(JAVAC_SERVER_DIR)/server.port ] && $(ECHO) Stopping sjavac server && \
|
||||
$(TOUCH) $(JAVAC_SERVER_DIR)/server.port.stop; true
|
||||
endef
|
||||
|
||||
@@ -519,13 +510,13 @@ else # $(HAS_SPEC)=true
|
||||
# move or remove the build output directory. Since we have no proper
|
||||
# synchronization process, wait for a while and hope it helps. This is only
|
||||
# used by build comparisons.
|
||||
define WaitForJavacServerFinish
|
||||
define WaitForSmartJavacFinish
|
||||
$(if $(JAVAC_SERVER_DIR), \
|
||||
sleep 5\
|
||||
)
|
||||
endef
|
||||
else
|
||||
define WaitForJavacServerFinish
|
||||
define WaitForSmartJavacFinish
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,26 +1,17 @@
|
||||
#
|
||||
# Copyright 2000-2023 JetBrains s.r.o.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
# Copyright 2000-2021 JetBrains s.r.o.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include $(SPEC)
|
||||
@@ -42,7 +33,7 @@ JBR_API_GENSRC_FILES := $(foreach f, $(call FindFiles, $(JBR_API_SRC_DIR)), \
|
||||
$(JBR_API_GENSRC_DIR)/$(call RelativePath, $f, $(JBR_API_SRC_DIR)))
|
||||
|
||||
ifeq ($(JBR_API_JBR_VERSION),)
|
||||
JBR_API_JBR_VERSION := DEVELOPMENT
|
||||
JBR_API_JBR_VERSION := <DEVELOPMENT>
|
||||
JBR_API_FAIL_ON_HASH_MISMATCH := false
|
||||
else
|
||||
.PHONY: $(JBR_API_VERSION_PROPERTIES)
|
||||
@@ -90,4 +81,4 @@ ifneq ($(JBR_API_CONF_FILE),)
|
||||
$(ECHO) "SOURCES_JAR=$(JBR_API_OUTPUT_DIR)/jbr-api-sources.jar" >> $(JBR_API_CONF_FILE)
|
||||
jbr-api: $(JBR_API_CONF_FILE)
|
||||
.PHONY: $(JBR_API_CONF_FILE)
|
||||
endif
|
||||
endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -48,7 +48,6 @@ JIMAGE_PKGS := \
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
|
||||
COMPILER := bootjdk, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_JDK8), \
|
||||
SRC := $(TOPDIR)/src/java.base/share/classes, \
|
||||
EXCLUDE_FILES := module-info.java, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -257,46 +257,6 @@ $(eval $(call SetupTarget, hotspot-ide-project, \
|
||||
ARGS := -I$(TOPDIR)/make/hotspot, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-java-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=java SHARED=false, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-hotspot-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=hotspot SHARED=false, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-native-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=native SHARED=false, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-mixed-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make SHARED=false, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-shared-java-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=java SHARED=true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-shared-hotspot-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=hotspot SHARED=true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-shared-native-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make WORKSPACE=native SHARED=true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, eclipse-shared-mixed-env, \
|
||||
MAKEFILE := ide/eclipse/CreateWorkspace, \
|
||||
ARGS := --always-make SHARED=true, \
|
||||
))
|
||||
|
||||
ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
|
||||
$(HOTSPOT_VARIANT_LIBS_TARGETS)
|
||||
|
||||
@@ -506,15 +466,15 @@ ALL_TARGETS += bootcycle-images
|
||||
# Docs targets
|
||||
|
||||
# If building full docs, to complete docs-*-api we need both the javadoc and
|
||||
# graphs targets.
|
||||
# modulegraph targets.
|
||||
$(eval $(call SetupTarget, docs-jdk-api-javadoc, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-jdk-api-javadoc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, docs-jdk-api-graphs, \
|
||||
$(eval $(call SetupTarget, docs-jdk-api-modulegraph, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-jdk-api-graphs, \
|
||||
TARGET := docs-jdk-api-modulegraph, \
|
||||
DEPS := buildtools-modules runnable-buildjdk, \
|
||||
))
|
||||
|
||||
@@ -523,9 +483,9 @@ $(eval $(call SetupTarget, docs-javase-api-javadoc, \
|
||||
TARGET := docs-javase-api-javadoc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, docs-javase-api-graphs, \
|
||||
$(eval $(call SetupTarget, docs-javase-api-modulegraph, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-javase-api-graphs, \
|
||||
TARGET := docs-javase-api-modulegraph, \
|
||||
DEPS := buildtools-modules runnable-buildjdk, \
|
||||
))
|
||||
|
||||
@@ -534,9 +494,9 @@ $(eval $(call SetupTarget, docs-reference-api-javadoc, \
|
||||
TARGET := docs-reference-api-javadoc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, docs-reference-api-graphs, \
|
||||
$(eval $(call SetupTarget, docs-reference-api-modulegraph, \
|
||||
MAKEFILE := Docs, \
|
||||
TARGET := docs-reference-api-graphs, \
|
||||
TARGET := docs-reference-api-modulegraph, \
|
||||
DEPS := buildtools-modules runnable-buildjdk, \
|
||||
))
|
||||
|
||||
@@ -747,22 +707,6 @@ ifeq ($(BUILD_FAILURE_HANDLER), true)
|
||||
))
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_JTREG_TEST_THREAD_FACTORY), true)
|
||||
# Builds the test thread factory jtreg extension
|
||||
$(eval $(call SetupTarget, build-test-test-thread-factory, \
|
||||
MAKEFILE := test/BuildJtregTestThreadFactory, \
|
||||
TARGET := build, \
|
||||
DEPS := interim-langtools exploded-image, \
|
||||
))
|
||||
|
||||
# Copies the jtreg test thread factory into the test image
|
||||
$(eval $(call SetupTarget, test-image-test-thread-factory, \
|
||||
MAKEFILE := test/BuildJtregTestThreadFactory, \
|
||||
TARGET := images, \
|
||||
DEPS := build-test-test-thread-factory, \
|
||||
))
|
||||
endif
|
||||
|
||||
$(eval $(call SetupTarget, build-microbenchmark, \
|
||||
MAKEFILE := test/BuildMicrobenchmark, \
|
||||
DEPS := interim-langtools exploded-image, \
|
||||
@@ -1163,14 +1107,9 @@ docs-reference-api: docs-reference-api-javadoc
|
||||
# If we're building full docs, we must also generate the module graphs to
|
||||
# get non-broken api documentation.
|
||||
ifeq ($(ENABLE_FULL_DOCS), true)
|
||||
docs-jdk-api: docs-jdk-api-graphs
|
||||
docs-javase-api: docs-javase-api-graphs
|
||||
docs-reference-api: docs-reference-api-graphs
|
||||
|
||||
# We must generate javadoc first so we know what graphs are needed
|
||||
docs-jdk-api-graphs: docs-jdk-api-javadoc
|
||||
docs-javase-api-graphs: docs-javase-api-javadoc
|
||||
docs-reference-api-graphs: docs-reference-api-javadoc
|
||||
docs-jdk-api: docs-jdk-api-modulegraph
|
||||
docs-javase-api: docs-javase-api-modulegraph
|
||||
docs-reference-api: docs-reference-api-modulegraph
|
||||
endif
|
||||
|
||||
docs-jdk: docs-jdk-api docs-jdk-specs docs-jdk-index
|
||||
@@ -1243,10 +1182,6 @@ ifeq ($(BUILD_FAILURE_HANDLER), true)
|
||||
test-image: test-image-failure-handler
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_JTREG_TEST_THREAD_FACTORY), true)
|
||||
test-image: test-image-test-thread-factory
|
||||
endif
|
||||
|
||||
ifneq ($(JMH_CORE_JAR), )
|
||||
test-image: build-microbenchmark
|
||||
endif
|
||||
|
||||
@@ -51,7 +51,6 @@ define create-info-file
|
||||
$(if $(VENDOR_VERSION_STRING), \
|
||||
$(call info-file-item, "IMPLEMENTOR_VERSION", "$(VENDOR_VERSION_STRING)"))
|
||||
$(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
|
||||
$(call info-file-item, "JAVA_RUNTIME_VERSION", "$(VERSION_STRING)")
|
||||
$(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
|
||||
$(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
|
||||
$(call info-file-item, "LIBC", "$(RELEASE_FILE_LIBC)")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -93,9 +93,6 @@ endif
|
||||
JTREG_FAILURE_HANDLER_DIR := $(TEST_IMAGE_DIR)/failure_handler
|
||||
JTREG_FAILURE_HANDLER := $(JTREG_FAILURE_HANDLER_DIR)/jtregFailureHandler.jar
|
||||
|
||||
JTREG_TEST_THREAD_FACTORY_DIR := $(TEST_IMAGE_DIR)/jtreg_test_thread_factory
|
||||
JTREG_TEST_THREAD_FACTORY_JAR := $(JTREG_TEST_THREAD_FACTORY_DIR)/jtregTestThreadFactory.jar
|
||||
|
||||
JTREG_FAILURE_HANDLER_TIMEOUT ?= 0
|
||||
|
||||
ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
|
||||
@@ -199,12 +196,11 @@ $(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG))
|
||||
$(eval $(call SetTestOpt,JOBS,JTREG))
|
||||
$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
|
||||
$(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
|
||||
$(eval $(call SetTestOpt,REPORT,JTREG))
|
||||
|
||||
$(eval $(call ParseKeywordVariable, JTREG, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
|
||||
TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS \
|
||||
RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
|
||||
TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM RUN_PROBLEM_LISTS \
|
||||
RETRY_COUNT REPEAT_COUNT MAX_OUTPUT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
|
||||
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
|
||||
EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
|
||||
$(CUSTOM_JTREG_STRING_KEYWORDS), \
|
||||
@@ -353,24 +349,13 @@ ExpandJtregPath = \
|
||||
)) \
|
||||
)
|
||||
|
||||
# with test id: dir/Test.java#selection -> Test.java#selection -> .java#selection -> #selection
|
||||
# without: dir/Test.java -> Test.java -> .java -> <<empty string>>
|
||||
TestID = \
|
||||
$(subst .sh,,$(subst .html,,$(subst .java,,$(suffix $(notdir $1)))))
|
||||
|
||||
# The test id starting with a hash (#testid) will be stripped by all
|
||||
# evals in ParseJtregTestSelectionInner and will be reinserted by calling
|
||||
# TestID (if it is present).
|
||||
ParseJtregTestSelection = \
|
||||
$(call IfAppend, $(call ParseJtregTestSelectionInner, $1), $(call TestID, $1))
|
||||
|
||||
# Helper function to determine if a test specification is a Jtreg test
|
||||
#
|
||||
# It is a Jtreg test if it optionally begins with jtreg:, and then is either
|
||||
# an unspecified group name (possibly prefixed by :), or a group in a
|
||||
# specified test root, or a path to a test or test directory,
|
||||
# either absolute or relative to any of the TEST_BASEDIRS or test roots.
|
||||
define ParseJtregTestSelectionInner
|
||||
define ParseJtregTestSelection
|
||||
$(eval TEST_NAME := $(strip $(patsubst jtreg:%, %, $1))) \
|
||||
$(if $(or $(findstring :, $(TEST_NAME)), $(findstring /, $(TEST_NAME))), , \
|
||||
$(eval TEST_NAME := :$(TEST_NAME)) \
|
||||
@@ -434,19 +419,28 @@ ifeq ($(TEST), )
|
||||
$(error Cannot continue)
|
||||
endif
|
||||
|
||||
ParseTestSelection = \
|
||||
$(strip $(or \
|
||||
$(call ParseCustomTestSelection, $1) \
|
||||
$(call ParseGtestTestSelection, $1) \
|
||||
$(call ParseMicroTestSelection, $1) \
|
||||
$(call ParseJtregTestSelection, $1) \
|
||||
$(call ParseSpecialTestSelection, $1) \
|
||||
))
|
||||
|
||||
# Now intelligently convert the test selection given by the user in TEST
|
||||
# into a list of fully qualified test descriptors of the tests to run.
|
||||
TESTS_TO_RUN := $(strip $(foreach test, $(TEST), $(call ParseTestSelection, $(test))))
|
||||
UNKNOWN_TEST := $(strip $(foreach test, $(TEST), $(if $(call ParseTestSelection, $(test)), , $(test))))
|
||||
TESTS_TO_RUN :=
|
||||
$(foreach test, $(TEST), \
|
||||
$(eval PARSED_TESTS := $(call ParseCustomTestSelection, $(test))) \
|
||||
$(if $(strip $(PARSED_TESTS)), , \
|
||||
$(eval PARSED_TESTS += $(call ParseGtestTestSelection, $(test))) \
|
||||
) \
|
||||
$(if $(strip $(PARSED_TESTS)), , \
|
||||
$(eval PARSED_TESTS += $(call ParseMicroTestSelection, $(test))) \
|
||||
) \
|
||||
$(if $(strip $(PARSED_TESTS)), , \
|
||||
$(eval PARSED_TESTS += $(call ParseJtregTestSelection, $(test))) \
|
||||
) \
|
||||
$(if $(strip $(PARSED_TESTS)), , \
|
||||
$(eval PARSED_TESTS += $(call ParseSpecialTestSelection, $(test))) \
|
||||
) \
|
||||
$(if $(strip $(PARSED_TESTS)), , \
|
||||
$(eval UNKNOWN_TEST := $(test)) \
|
||||
) \
|
||||
$(eval TESTS_TO_RUN += $(PARSED_TESTS)) \
|
||||
)
|
||||
|
||||
ifneq ($(UNKNOWN_TEST), )
|
||||
$(info Unknown test selection: '$(UNKNOWN_TEST)')
|
||||
@@ -454,6 +448,9 @@ ifneq ($(UNKNOWN_TEST), )
|
||||
$(error Cannot continue)
|
||||
endif
|
||||
|
||||
TESTS_TO_RUN := $(strip $(TESTS_TO_RUN))
|
||||
|
||||
|
||||
# Present the result of our parsing to the user
|
||||
$(info Test selection '$(TEST)', will run:)
|
||||
$(foreach test, $(TESTS_TO_RUN), $(info * $(test)))
|
||||
@@ -746,11 +743,9 @@ define SetupRunJtregTestBody
|
||||
|
||||
JTREG_VERBOSE ?= fail,error,summary
|
||||
JTREG_RETAIN ?= fail,error
|
||||
JTREG_TEST_THREAD_FACTORY ?=
|
||||
JTREG_RUN_PROBLEM_LISTS ?= false
|
||||
JTREG_RETRY_COUNT ?= 0
|
||||
JTREG_REPEAT_COUNT ?= 0
|
||||
JTREG_REPORT ?= files
|
||||
|
||||
ifneq ($$(JTREG_RETRY_COUNT), 0)
|
||||
ifneq ($$(JTREG_REPEAT_COUNT), 0)
|
||||
@@ -760,14 +755,6 @@ define SetupRunJtregTestBody
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$(JTREG_TEST_THREAD_FACTORY), )
|
||||
$1_JTREG_BASIC_OPTIONS += -testThreadFactoryPath:$$(JTREG_TEST_THREAD_FACTORY_JAR)
|
||||
$1_JTREG_BASIC_OPTIONS += -testThreadFactory:$$(JTREG_TEST_THREAD_FACTORY)
|
||||
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
|
||||
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-$$(JTREG_TEST_THREAD_FACTORY).txt) \
|
||||
))
|
||||
endif
|
||||
|
||||
ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
|
||||
$1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
|
||||
endif
|
||||
@@ -784,13 +771,10 @@ define SetupRunJtregTestBody
|
||||
# Make sure the tmp dir is normalized as some tests will react badly otherwise
|
||||
$1_TEST_TMP_DIR := $$(abspath $$($1_TEST_SUPPORT_DIR)/tmp)
|
||||
|
||||
# test.boot.jdk is used by some test cases that want to execute a previous
|
||||
# version of the JDK.
|
||||
$1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
|
||||
-verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
|
||||
-concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
|
||||
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \
|
||||
-vmoption:-Dtest.boot.jdk="$$(BOOT_JDK)" \
|
||||
-vmoption:-Djava.io.tmpdir="$$($1_TEST_TMP_DIR)"
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
|
||||
@@ -802,8 +786,6 @@ define SetupRunJtregTestBody
|
||||
# symbol lookup in hserr files
|
||||
ifeq ($$(call isTargetOs, windows), true)
|
||||
$1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH
|
||||
else ifeq ($$(call isTargetOs, linux), true)
|
||||
$1_JTREG_BASIC_OPTIONS += -e:_JVM_DWARF_PATH=$$(SYMBOLS_IMAGE_DIR)
|
||||
endif
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += \
|
||||
@@ -815,6 +797,15 @@ define SetupRunJtregTestBody
|
||||
$1_JTREG_BASIC_OPTIONS += -ea -esa
|
||||
endif
|
||||
|
||||
ifeq ($$(ASAN_ENABLED), yes)
|
||||
$1_JTREG_BASIC_OPTIONS += -e:ASAN_OPTIONS=handle_segv=0:handle_sigfpe=0:detect_leaks=false
|
||||
$1_JTREG_BASIC_OPTIONS += -e:LD_PRELOAD=libasan.so.5
|
||||
endif
|
||||
|
||||
ifeq ($$(USAN_ENABLED), yes)
|
||||
$1_JTREG_BASIC_OPTIONS += -e:LD_PRELOAD=libubsan.so.1
|
||||
endif
|
||||
|
||||
ifneq ($$($1_JTREG_NATIVEPATH), )
|
||||
$1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH)
|
||||
endif
|
||||
@@ -871,8 +862,7 @@ define SetupRunJtregTestBody
|
||||
-dir:$$(JTREG_TOPDIR) \
|
||||
-reportDir:$$($1_TEST_RESULTS_DIR) \
|
||||
-workDir:$$($1_TEST_SUPPORT_DIR) \
|
||||
-report:$${JTREG_REPORT} \
|
||||
$$$${JTREG_STATUS} \
|
||||
-status:$$$${JTREG_STATUS} \
|
||||
$$(JTREG_OPTIONS) \
|
||||
$$(JTREG_FAILURE_HANDLER_OPTIONS) \
|
||||
$$(JTREG_COV_OPTIONS) \
|
||||
@@ -1203,11 +1193,13 @@ ifeq ($(TEST_OPTS_JCOV), true)
|
||||
JCOV_SOURCE_DIFF := $(JCOV_OUTPUT_DIR)/source_diff
|
||||
JCOV_DIFF_COVERAGE_REPORT := $(JCOV_OUTPUT_DIR)/diff_coverage_report
|
||||
|
||||
ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
|
||||
ifneq ($(and $(HG), $(wildcard $(TOPDIR)/.hg)), )
|
||||
DIFF_COMMAND := $(HG) -R $(TOPDIR) diff -r $(TEST_OPTS_JCOV_DIFF_CHANGESET) > $(JCOV_SOURCE_DIFF)
|
||||
else ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
|
||||
DIFF_COMMAND := $(GIT) -C $(TOPDIR) diff $(TEST_OPTS_JCOV_DIFF_CHANGESET) > $(JCOV_SOURCE_DIFF)
|
||||
else
|
||||
$(info Error: Must be a git source tree for diff coverage.)
|
||||
$(error No git source tree.)
|
||||
$(info Error: Must be either hg or git source tree for diff coverage.)
|
||||
$(error Neither hg nor git source tree.)
|
||||
endif
|
||||
|
||||
jcov-gen-diffcoverage: jcov-stop-grabber
|
||||
|
||||
@@ -295,11 +295,6 @@ test-prebuilt:
|
||||
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
|
||||
TEST="$(TEST)"
|
||||
|
||||
test-prebuilt-with-exit-code: test-prebuilt
|
||||
@if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
all: test-prebuilt
|
||||
|
||||
.PHONY: default all test-prebuilt
|
||||
|
||||
@@ -169,6 +169,7 @@ ZIPEXE := zip
|
||||
UNZIP := unzip
|
||||
EXPR := expr
|
||||
FILE := file
|
||||
HG := hg
|
||||
ULIMIT := ulimit
|
||||
|
||||
ifeq ($(OPENJDK_BUILD_OS), windows)
|
||||
|
||||
@@ -42,7 +42,11 @@ $(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))
|
||||
STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev
|
||||
|
||||
USE_SCM := false
|
||||
ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
|
||||
ifneq ($(and $(HG), $(wildcard $(TOPDIR)/.hg)), )
|
||||
USE_SCM := true
|
||||
SCM_DIR := .hg
|
||||
ID_COMMAND := $(PRINTF) "hg:%s" "$$($(HG) id -i)"
|
||||
else ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
|
||||
USE_SCM := true
|
||||
SCM_DIR := .git
|
||||
ID_COMMAND := $(PRINTF) "git:%s%s\n" \
|
||||
@@ -81,7 +85,7 @@ ifeq ($(USE_SCM), true)
|
||||
REPO_REVISIONS += $$(SUPPORT_OUTPUTDIR)/src-rev/$$($1_FILENAME)
|
||||
endef
|
||||
|
||||
# Setup rules for all repos. This makes sure all the "git log" calls are made
|
||||
# Setup rules for all repos. This makes sure all the "hg id" calls are made
|
||||
# in parallel.
|
||||
$(foreach repo, $(call FindAllReposRel), \
|
||||
$(eval $(call SetupGetRevisionForRepo, $(repo))) \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -31,7 +31,6 @@ include JavaCompilation.gmk
|
||||
include Modules.gmk
|
||||
|
||||
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
|
||||
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, ZipSource.gmk))
|
||||
@@ -46,10 +45,10 @@ ALL_MODULES := $(FindAllModules)
|
||||
# again to create src.zip.
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(foreach d, $(call FindModuleSrcDirs, $m), \
|
||||
$(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$(patsubst $(SUPPORT_OUTPUTDIR)/%,%,$d))/$m) \
|
||||
$(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$d)/$m) \
|
||||
$(if $(SRC_GENERATED), , \
|
||||
$(eval $$($d_TARGET): $d ; \
|
||||
$$(if $(filter $(SRC_ZIP_BASE)/%, $d), $$(link-file-relative), $$(link-file-absolute)) \
|
||||
$$(if $(filter $(TOPDIR)/%, $d), $$(link-file-relative), $$(link-file-absolute)) \
|
||||
) \
|
||||
) \
|
||||
$(eval SRC_ZIP_SRCS += $$($d_TARGET)) \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -31,11 +31,6 @@ AC_DEFUN_ONCE([BASIC_INIT],
|
||||
[
|
||||
# Save the original command line. This is passed to us by the wrapper configure script.
|
||||
AC_SUBST(CONFIGURE_COMMAND_LINE)
|
||||
# We might have the original command line if the wrapper was called by some
|
||||
# other script.
|
||||
AC_SUBST(REAL_CONFIGURE_COMMAND_EXEC_SHORT)
|
||||
AC_SUBST(REAL_CONFIGURE_COMMAND_EXEC_FULL)
|
||||
AC_SUBST(REAL_CONFIGURE_COMMAND_LINE)
|
||||
# AUTOCONF might be set in the environment by the user. Preserve for "make reconfigure".
|
||||
AC_SUBST(AUTOCONF)
|
||||
# Save the path variable before it gets changed
|
||||
@@ -60,7 +55,6 @@ AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
|
||||
|
||||
###############################################################################
|
||||
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
|
||||
# Make sure to only use tools set up in BASIC_SETUP_FUNDAMENTAL_TOOLS.
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
|
||||
[
|
||||
# Save the current directory this script was started from
|
||||
@@ -102,29 +96,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
|
||||
AUTOCONF_DIR=$TOPDIR/make/autoconf
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Setup what kind of build environment type we have (CI or local developer)
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_BUILD_ENV],
|
||||
[
|
||||
if test "x$CI" = "xtrue"; then
|
||||
DEFAULT_BUILD_ENV="ci"
|
||||
AC_MSG_NOTICE([CI environment variable set to $CI])
|
||||
else
|
||||
DEFAULT_BUILD_ENV="dev"
|
||||
fi
|
||||
|
||||
UTIL_ARG_WITH(NAME: build-env, TYPE: literal,
|
||||
RESULT: BUILD_ENV,
|
||||
VALID_VALUES: [auto dev ci], DEFAULT: auto,
|
||||
CHECKING_MSG: [for build environment type],
|
||||
DESC: [select build environment type (affects certain default values)],
|
||||
IF_AUTO: [
|
||||
RESULT=$DEFAULT_BUILD_ENV
|
||||
]
|
||||
)
|
||||
AC_SUBST(BUILD_ENV)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Evaluates platform specific overrides for devkit variables.
|
||||
# $1: Name of variable
|
||||
@@ -168,15 +139,6 @@ AC_DEFUN([BASIC_SETUP_XCODE_SYSROOT],
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_ERROR([The xcodebuild tool in the devkit reports an error: $XCODEBUILD_OUTPUT])
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_PATH" != x; then
|
||||
UTIL_LOOKUP_PROGS(XCODEBUILD, xcodebuild, $TOOLCHAIN_PATH)
|
||||
if test "x$XCODEBUILD" != x; then
|
||||
XCODEBUILD_OUTPUT=`"$XCODEBUILD" -version 2>&1`
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_WARN([Ignoring the located xcodebuild tool $XCODEBUILD due to an error: $XCODEBUILD_OUTPUT])
|
||||
XCODEBUILD=
|
||||
fi
|
||||
fi
|
||||
else
|
||||
UTIL_LOOKUP_PROGS(XCODEBUILD, xcodebuild)
|
||||
if test "x$XCODEBUILD" != x; then
|
||||
@@ -326,22 +288,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
|
||||
[UTIL_PREPEND_TO_PATH([TOOLCHAIN_PATH],$with_toolchain_path)]
|
||||
)
|
||||
|
||||
AC_ARG_WITH([xcode-path], [AS_HELP_STRING([--with-xcode-path],
|
||||
[set up toolchain on Mac OS using a path to an Xcode installation])])
|
||||
|
||||
if test "x$with_xcode_path" != x; then
|
||||
if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
|
||||
UTIL_PREPEND_TO_PATH([TOOLCHAIN_PATH],
|
||||
$with_xcode_path/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$with_xcode_path/Contents/Developer/usr/bin)
|
||||
else
|
||||
AC_MSG_WARN([Option --with-xcode-path is only valid on Mac OS, ignoring.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for toolchain path])
|
||||
AC_MSG_RESULT([$TOOLCHAIN_PATH])
|
||||
AC_SUBST(TOOLCHAIN_PATH)
|
||||
|
||||
AC_ARG_WITH([extra-path], [AS_HELP_STRING([--with-extra-path],
|
||||
[prepend these directories to the default path])],
|
||||
[UTIL_PREPEND_TO_PATH([EXTRA_PATH],$with_extra_path)]
|
||||
@@ -360,6 +306,10 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
|
||||
AC_MSG_RESULT([$SYSROOT])
|
||||
AC_SUBST(SYSROOT)
|
||||
|
||||
AC_MSG_CHECKING([for toolchain path])
|
||||
AC_MSG_RESULT([$TOOLCHAIN_PATH])
|
||||
AC_SUBST(TOOLCHAIN_PATH)
|
||||
|
||||
AC_MSG_CHECKING([for extra path])
|
||||
AC_MSG_RESULT([$EXTRA_PATH])
|
||||
])
|
||||
@@ -478,11 +428,7 @@ AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
|
||||
# df on AIX does not understand -l. On modern AIXes it understands "-T local" which
|
||||
# is the same. On older AIXes we just continue to live with a "not local build" warning.
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
if "$DF -T local > /dev/null 2>&1"; then
|
||||
DF_LOCAL_ONLY_OPTION='-T local'
|
||||
else # AIX may use GNU-utils instead
|
||||
DF_LOCAL_ONLY_OPTION='-l'
|
||||
fi
|
||||
DF_LOCAL_ONLY_OPTION='-T local'
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl1"; then
|
||||
# In WSL1, we can only build on a drvfs file system (that is, a mounted real Windows drive)
|
||||
DF_LOCAL_ONLY_OPTION='-t drvfs'
|
||||
@@ -507,7 +453,7 @@ AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
|
||||
# in the source tree when configure runs
|
||||
file_to_test="$TOPDIR/Makefile"
|
||||
if test `$STAT -c '%a' "$file_to_test"` -lt 400; then
|
||||
AC_MSG_ERROR([Bad file permissions on src files. This is usually caused by cloning the repositories with non cygwin tools in a directory not created in cygwin.])
|
||||
AC_MSG_ERROR([Bad file permissions on src files. This is usually caused by cloning the repositories with a non cygwin hg in a directory not created in cygwin.])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -24,13 +24,8 @@
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# It is recommended to use exactly this version of pandoc, especially for
|
||||
# re-generating checked in html files
|
||||
RECOMMENDED_PANDOC_VERSION=2.19.2
|
||||
|
||||
###############################################################################
|
||||
# Setup the most fundamental tools, used for setting up build platform and
|
||||
# path handling.
|
||||
# Setup the most fundamental tools that relies on not much else to set up,
|
||||
# but is used by much of the early bootstrap code.
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
|
||||
[
|
||||
# Bootstrapping: These tools are needed by UTIL_LOOKUP_PROGS
|
||||
@@ -42,28 +37,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
|
||||
UTIL_CHECK_NONEMPTY(FILE)
|
||||
AC_PATH_PROGS(LDD, ldd)
|
||||
|
||||
# Required tools
|
||||
UTIL_REQUIRE_PROGS(ECHO, echo)
|
||||
UTIL_REQUIRE_PROGS(TR, tr)
|
||||
UTIL_REQUIRE_PROGS(UNAME, uname)
|
||||
UTIL_REQUIRE_PROGS(WC, wc)
|
||||
|
||||
# Required tools with some special treatment
|
||||
UTIL_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
|
||||
UTIL_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
|
||||
UTIL_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
|
||||
|
||||
# Tools only needed on some platforms
|
||||
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
|
||||
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Setup further tools that should be resolved early but after setting up
|
||||
# build platform and path handling.
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
|
||||
[
|
||||
# Required tools
|
||||
# First are all the fundamental required tools.
|
||||
UTIL_REQUIRE_PROGS(BASH, bash)
|
||||
UTIL_REQUIRE_PROGS(CAT, cat)
|
||||
UTIL_REQUIRE_PROGS(CHMOD, chmod)
|
||||
@@ -71,6 +45,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
|
||||
UTIL_REQUIRE_PROGS(CUT, cut)
|
||||
UTIL_REQUIRE_PROGS(DATE, date)
|
||||
UTIL_REQUIRE_PROGS(DIFF, gdiff diff)
|
||||
UTIL_REQUIRE_PROGS(ECHO, echo)
|
||||
UTIL_REQUIRE_PROGS(EXPR, expr)
|
||||
UTIL_REQUIRE_PROGS(FIND, find)
|
||||
UTIL_REQUIRE_PROGS(GUNZIP, gunzip)
|
||||
@@ -92,20 +67,27 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
|
||||
UTIL_REQUIRE_PROGS(TAR, gtar tar)
|
||||
UTIL_REQUIRE_PROGS(TEE, tee)
|
||||
UTIL_REQUIRE_PROGS(TOUCH, touch)
|
||||
UTIL_REQUIRE_PROGS(TR, tr)
|
||||
UTIL_REQUIRE_PROGS(UNAME, uname)
|
||||
UTIL_REQUIRE_PROGS(WC, wc)
|
||||
UTIL_REQUIRE_PROGS(XARGS, xargs)
|
||||
|
||||
# Required tools with some special treatment
|
||||
# Then required tools that require some special treatment.
|
||||
UTIL_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
|
||||
UTIL_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
|
||||
UTIL_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
|
||||
UTIL_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
|
||||
|
||||
# Optional tools, we can do without them
|
||||
UTIL_LOOKUP_PROGS(DF, df)
|
||||
UTIL_LOOKUP_PROGS(GIT, git)
|
||||
UTIL_LOOKUP_PROGS(NICE, nice)
|
||||
UTIL_LOOKUP_PROGS(READLINK, greadlink readlink)
|
||||
UTIL_LOOKUP_PROGS(WHOAMI, whoami)
|
||||
|
||||
# Tools only needed on some platforms
|
||||
# These are only needed on some platforms
|
||||
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
|
||||
UTIL_LOOKUP_PROGS(LSB_RELEASE, lsb_release)
|
||||
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
|
||||
|
||||
# For compare.sh only
|
||||
UTIL_LOOKUP_PROGS(CMP, cmp)
|
||||
@@ -298,7 +280,7 @@ AC_DEFUN([BASIC_CHECK_TAR],
|
||||
if test "x$TAR_TYPE" = "xgnu"; then
|
||||
TAR_INCLUDE_PARAM="T"
|
||||
TAR_SUPPORTS_TRANSFORM="true"
|
||||
elif test "x$TAR_TYPE" = "xaix"; then
|
||||
elif test "x$TAR_TYPE" = "aix"; then
|
||||
# -L InputList of aix tar: name of file listing the files and directories
|
||||
# that need to be archived or extracted
|
||||
TAR_INCLUDE_PARAM="L"
|
||||
@@ -360,6 +342,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
|
||||
|
||||
UTIL_LOOKUP_PROGS(READELF, greadelf readelf)
|
||||
UTIL_LOOKUP_PROGS(DOT, dot)
|
||||
UTIL_LOOKUP_PROGS(HG, hg)
|
||||
UTIL_LOOKUP_PROGS(STAT, stat)
|
||||
UTIL_LOOKUP_PROGS(TIME, time)
|
||||
UTIL_LOOKUP_PROGS(FLOCK, flock)
|
||||
@@ -393,6 +376,41 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
|
||||
UTIL_REQUIRE_PROGS(MIG, mig)
|
||||
UTIL_REQUIRE_PROGS(XATTR, xattr)
|
||||
UTIL_LOOKUP_PROGS(CODESIGN, codesign)
|
||||
|
||||
# Check for user provided code signing identity.
|
||||
UTIL_ARG_WITH(NAME: macosx-codesign-identity, TYPE: string,
|
||||
DEFAULT: openjdk_codesign, CHECK_VALUE: UTIL_CHECK_STRING_NON_EMPTY,
|
||||
DESC: [specify the macosx code signing identity],
|
||||
CHECKING_MSG: [for macosx code signing identity]
|
||||
)
|
||||
AC_SUBST(MACOSX_CODESIGN_IDENTITY)
|
||||
|
||||
if test "x$CODESIGN" != "x"; then
|
||||
# Verify that the codesign certificate is present
|
||||
AC_MSG_CHECKING([if codesign certificate is present])
|
||||
$RM codesign-testfile
|
||||
$TOUCH codesign-testfile
|
||||
$CODESIGN -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile 2>&AS_MESSAGE_LOG_FD \
|
||||
>&AS_MESSAGE_LOG_FD || CODESIGN=
|
||||
$RM codesign-testfile
|
||||
if test "x$CODESIGN" = x; then
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
# Verify that the codesign has --option runtime
|
||||
AC_MSG_CHECKING([if codesign has --option runtime])
|
||||
$RM codesign-testfile
|
||||
$TOUCH codesign-testfile
|
||||
$CODESIGN --option runtime -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile \
|
||||
2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
|
||||
$RM codesign-testfile
|
||||
if test "x$CODESIGN" = x; then
|
||||
AC_MSG_ERROR([codesign does not have --option runtime. macOS 10.13.6 and above is required.])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
UTIL_REQUIRE_PROGS(SETFILE, SetFile)
|
||||
fi
|
||||
if ! test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
@@ -444,29 +462,22 @@ AC_DEFUN_ONCE([BASIC_SETUP_PANDOC],
|
||||
[
|
||||
UTIL_LOOKUP_PROGS(PANDOC, pandoc)
|
||||
|
||||
if test "x$PANDOC" != x; then
|
||||
AC_MSG_CHECKING([for pandoc version])
|
||||
PANDOC_VERSION=`$PANDOC --version 2>&1 | $TR -d '\r' | $HEAD -1 | $CUT -d " " -f 2`
|
||||
AC_MSG_RESULT([$PANDOC_VERSION])
|
||||
|
||||
if test "x$PANDOC_VERSION" != x$RECOMMENDED_PANDOC_VERSION; then
|
||||
AC_MSG_WARN([pandoc is version $PANDOC_VERSION, not the recommended version $RECOMMENDED_PANDOC_VERSION])
|
||||
fi
|
||||
|
||||
PANDOC_MARKDOWN_FLAG="markdown"
|
||||
AC_MSG_CHECKING([if the pandoc smart extension needs to be disabled for markdown])
|
||||
if $PANDOC --list-extensions | $GREP -q '+smart'; then
|
||||
PANDOC_MARKDOWN_FLAG="markdown"
|
||||
if test -n "$PANDOC"; then
|
||||
AC_MSG_CHECKING(if the pandoc smart extension needs to be disabled for markdown)
|
||||
if $PANDOC --list-extensions | $GREP -q '\+smart'; then
|
||||
AC_MSG_RESULT([yes])
|
||||
PANDOC_MARKDOWN_FLAG="markdown-smart"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$PANDOC"; then
|
||||
ENABLE_PANDOC="true"
|
||||
else
|
||||
ENABLE_PANDOC="false"
|
||||
fi
|
||||
|
||||
AC_SUBST(ENABLE_PANDOC)
|
||||
AC_SUBST(PANDOC_MARKDOWN_FLAG)
|
||||
])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -382,7 +382,7 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
||||
# Finally, set some other options...
|
||||
|
||||
# Determine if the boot jdk jar supports the --date option
|
||||
if $JAR --help 2>&1 | $GREP -q -e "--date=TIMESTAMP"; then
|
||||
if $JAR --help 2>&1 | $GREP -q "\-\-date=TIMESTAMP"; then
|
||||
BOOT_JDK_JAR_SUPPORTS_DATE=true
|
||||
else
|
||||
BOOT_JDK_JAR_SUPPORTS_DATE=false
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
86
make/autoconf/build-aux/config.guess
vendored
86
make/autoconf/build-aux/config.guess
vendored
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
@@ -29,27 +29,16 @@
|
||||
# and fix the broken property, if needed.
|
||||
|
||||
DIR=`dirname $0`
|
||||
OUT=`. $DIR/autoconf-config.guess 2> /dev/null`
|
||||
OUT=`. $DIR/autoconf-config.guess`
|
||||
|
||||
# Handle some cases that autoconf-config.guess is not capable of
|
||||
if [ "x$OUT" = x ]; then
|
||||
if [ `uname -s` = Linux ]; then
|
||||
# Test and fix little endian MIPS.
|
||||
if [ `uname -m` = mipsel ]; then
|
||||
OUT=mipsel-unknown-linux-gnu
|
||||
fi
|
||||
# Test and fix cygwin machine arch .x86_64
|
||||
elif [[ `uname -s` = CYGWIN* ]]; then
|
||||
if [ `uname -m` = ".x86_64" ]; then
|
||||
OUT=x86_64-unknown-cygwin
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$OUT" = x ]; then
|
||||
# Run autoconf-config.guess again to get the error message.
|
||||
. $DIR/autoconf-config.guess > /dev/null
|
||||
else
|
||||
printf "guessed by custom config.guess... " >&2
|
||||
# Detect C library.
|
||||
# Use '-gnu' suffix on systems that use glibc.
|
||||
# Use '-musl' suffix on systems that use the musl libc.
|
||||
echo $OUT | grep -- -linux- > /dev/null 2> /dev/null
|
||||
if test $? = 0; then
|
||||
libc_vendor=`ldd --version 2>&1 | sed -n '1s/.*\(musl\).*/\1/p'`
|
||||
if [ x"${libc_vendor}" = x"musl" ]; then
|
||||
OUT=`echo $OUT | sed 's/-gnu/-musl/'`
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -68,11 +57,11 @@ if test $? = 0; then
|
||||
fi
|
||||
|
||||
# Test and fix wsl
|
||||
echo $OUT | grep '\(unknown\|pc\)-linux-gnu' > /dev/null 2> /dev/null
|
||||
echo $OUT | grep unknown-linux-gnu > /dev/null 2> /dev/null
|
||||
if test $? = 0; then
|
||||
uname -r | grep -i microsoft > /dev/null 2> /dev/null
|
||||
if test $? = 0; then
|
||||
OUT=`echo $OUT | sed -e 's/\(unknown\|pc\)-linux-gnu/pc-wsl/'`
|
||||
OUT=`echo $OUT | sed -e 's/unknown-linux-gnu/pc-wsl/'`
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -92,6 +81,57 @@ if test $? = 0; then
|
||||
OUT=powerpc$KERNEL_BITMODE`echo $OUT | sed -e 's/[^-]*//'`
|
||||
fi
|
||||
|
||||
# Test and fix little endian PowerPC64.
|
||||
# TODO: should be handled by autoconf-config.guess.
|
||||
if [ "x$OUT" = x ]; then
|
||||
if [ `uname -m` = ppc64le ]; then
|
||||
if [ `uname -s` = Linux ]; then
|
||||
OUT=powerpc64le-unknown-linux-gnu
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix little endian MIPS.
|
||||
if [ "x$OUT" = x ]; then
|
||||
if [ `uname -s` = Linux ]; then
|
||||
if [ `uname -m` = mipsel ]; then
|
||||
OUT=mipsel-unknown-linux-gnu
|
||||
elif [ `uname -m` = mips64el ]; then
|
||||
OUT=mips64el-unknown-linux-gnu
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix LoongArch64.
|
||||
if [ "x$OUT" = x ]; then
|
||||
if [ `uname -s` = Linux ]; then
|
||||
if [ `uname -m` = loongarch64 ]; then
|
||||
OUT=loongarch64-unknown-linux-gnu
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix RISC-V.
|
||||
if [ "x$OUT" = x ]; then
|
||||
if [ `uname -s` = Linux ]; then
|
||||
if [ `uname -m` = riscv64 ]; then
|
||||
OUT=riscv64-unknown-linux-gnu
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix cpu on macos-aarch64, uname -p reports arm, buildsys expects aarch64
|
||||
echo $OUT | grep arm-apple-darwin > /dev/null 2> /dev/null
|
||||
if test $? != 0; then
|
||||
# The GNU version of uname may be on the PATH which reports arm64 instead
|
||||
echo $OUT | grep arm64-apple-darwin > /dev/null 2> /dev/null
|
||||
fi
|
||||
if test $? = 0; then
|
||||
if [ `uname -m` = arm64 ]; then
|
||||
OUT=aarch64`echo $OUT | sed -e 's/[^-]*//'`
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix cpu on Macosx when C preprocessor is not on the path
|
||||
echo $OUT | grep i386-apple-darwin > /dev/null 2> /dev/null
|
||||
if test $? = 0; then
|
||||
|
||||
34
make/autoconf/build-aux/config.sub
vendored
34
make/autoconf/build-aux/config.sub
vendored
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -29,16 +29,46 @@
|
||||
|
||||
DIR=`dirname $0`
|
||||
|
||||
if echo $* | grep linux-musl >/dev/null ; then
|
||||
echo $*
|
||||
exit
|
||||
fi
|
||||
|
||||
# Allow wsl
|
||||
if echo $* | grep pc-wsl >/dev/null ; then
|
||||
echo $*
|
||||
exit
|
||||
fi
|
||||
|
||||
# Allow msys2
|
||||
if echo $* | grep pc-msys >/dev/null ; then
|
||||
echo $*
|
||||
exit
|
||||
fi
|
||||
|
||||
# Canonicalize for riscv which autoconf-config.sub doesn't handle
|
||||
if echo $* | grep '^riscv\(32\|64\)-linux' >/dev/null ; then
|
||||
result=`echo $@ | sed 's/linux/unknown-linux/'`
|
||||
echo $result
|
||||
exit
|
||||
fi
|
||||
|
||||
# Filter out everything that doesn't begin with "aarch64-"
|
||||
if ! echo $* | grep '^aarch64-' >/dev/null ; then
|
||||
. $DIR/autoconf-config.sub "$@"
|
||||
# autoconf-config.sub exits, so we never reach here, but just in
|
||||
# case we do:
|
||||
exit
|
||||
fi
|
||||
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
-- ) # Stop option processing
|
||||
shift; break ;;
|
||||
aarch64-* )
|
||||
config=`echo $1 | sed 's/^aarch64-/arm-/'`
|
||||
sub_args="$sub_args $config"
|
||||
shift; ;;
|
||||
- ) # Use stdin as input.
|
||||
sub_args="$sub_args $1"
|
||||
shift; break ;;
|
||||
@@ -51,5 +81,7 @@ done
|
||||
result=`. $DIR/autoconf-config.sub $sub_args "$@"`
|
||||
exitcode=$?
|
||||
|
||||
result=`echo $result | sed "s/^arm-/aarch64-/"`
|
||||
|
||||
echo $result
|
||||
exit $exitcode
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -26,29 +26,39 @@
|
||||
AC_DEFUN([BPERF_CHECK_CORES],
|
||||
[
|
||||
AC_MSG_CHECKING([for number of cores])
|
||||
NUM_CORES=1
|
||||
FOUND_CORES=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux (or cygwin) system
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -cw processor`
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
|
||||
if test "$NUM_CORES" -eq "0"; then
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -c ^CPU`
|
||||
fi
|
||||
if test "$NUM_CORES" -ne "0"; then
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
elif test -x /usr/sbin/sysctl; then
|
||||
# Looks like a MacOSX system
|
||||
NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu`
|
||||
FOUND_CORES=yes
|
||||
elif test "x$OPENJDK_BUILD_OS" = xaix ; then
|
||||
NUM_CORES=`lparstat -m 2> /dev/null | $GREP -o "lcpu=[[0-9]]*" | $CUT -d "=" -f 2`
|
||||
NUM_LCPU=`lparstat -m 2> /dev/null | $GREP -o "lcpu=[[0-9]]*" | $CUT -d "=" -f 2`
|
||||
if test -n "$NUM_LCPU"; then
|
||||
NUM_CORES=$NUM_LCPU
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
elif test -n "$NUMBER_OF_PROCESSORS"; then
|
||||
# On windows, look in the env
|
||||
NUM_CORES=$NUMBER_OF_PROCESSORS
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test "$NUM_CORES" -eq "0"; then
|
||||
NUM_CORES=1
|
||||
if test "x$FOUND_CORES" = xyes; then
|
||||
AC_MSG_RESULT([$NUM_CORES])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect number of cores, defaulting to 1])
|
||||
AC_MSG_WARN([This will disable all parallelism from build!])
|
||||
else
|
||||
AC_MSG_RESULT([$NUM_CORES])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@@ -103,7 +103,3 @@ JVM_FEATURES_server := cds compiler1 compiler2 g1gc serialgc
|
||||
override EXTRA_CFLAGS :=
|
||||
override EXTRA_CXXFLAGS :=
|
||||
override EXTRA_LDFLAGS :=
|
||||
|
||||
# hsdis is not needed
|
||||
HSDIS_BACKEND := none
|
||||
ENABLE_HSDIS_BUNDLING := false
|
||||
|
||||
@@ -40,7 +40,6 @@ export AWK="@AWK@"
|
||||
export BASH="@BASH@"
|
||||
export CAT="@CAT@"
|
||||
export CMP="@CMP@"
|
||||
export CODESIGN="@CODESIGN@"
|
||||
export CP="@CP@"
|
||||
export CUT="@CUT@"
|
||||
export DIFF="@DIFF@"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT(OpenJDK, openjdk, build-dev@openjdk.org,,https://openjdk.org)
|
||||
AC_INIT(OpenJDK, openjdk, build-dev@openjdk.java.net,,http://openjdk.java.net)
|
||||
|
||||
AC_CONFIG_AUX_DIR([$TOPDIR/make/autoconf/build-aux])
|
||||
m4_include([build-aux/pkg.m4])
|
||||
@@ -86,8 +86,6 @@ PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
|
||||
|
||||
# Continue setting up basic stuff. Most remaining code require fundamental tools.
|
||||
BASIC_SETUP_PATHS
|
||||
BASIC_SETUP_TOOLS
|
||||
BASIC_SETUP_BUILD_ENV
|
||||
|
||||
# Check if it's a pure open build or if custom sources are to be used.
|
||||
JDKOPT_SETUP_OPEN_OR_CUSTOM
|
||||
@@ -135,7 +133,6 @@ BASIC_SETUP_DEFAULT_LOG
|
||||
###############################################################################
|
||||
|
||||
# We need build & target for this.
|
||||
JDKOPT_SETUP_JMOD_OPTIONS
|
||||
JDKOPT_SETUP_JLINK_OPTIONS
|
||||
JDKVER_SETUP_JDK_VERSION_NUMBERS
|
||||
|
||||
@@ -194,15 +191,18 @@ TOOLCHAIN_POST_DETECTION
|
||||
TOOLCHAIN_SETUP_BUILD_COMPILERS
|
||||
TOOLCHAIN_MISC_CHECKS
|
||||
|
||||
# Setup the JTReg Regression Test Harness.
|
||||
TOOLCHAIN_SETUP_JTREG
|
||||
|
||||
# Setup the Java Microbenchmark Harness (JMH)
|
||||
LIB_TESTS_SETUP_JMH
|
||||
|
||||
# Setup Jib dependency tool
|
||||
TOOLCHAIN_SETUP_JIB
|
||||
|
||||
# After toolchain setup, we need to process some flags to be able to continue.
|
||||
FLAGS_POST_TOOLCHAIN
|
||||
|
||||
# Setup the tools needed to test the JDK (JTReg Regression Test Harness,
|
||||
# Java Microbenchmark Harness (JMH) and the Jib dependency tool).
|
||||
LIB_TESTS_SETUP_JTREG
|
||||
LIB_TESTS_SETUP_JMH
|
||||
LIB_TESTS_SETUP_JIB
|
||||
|
||||
# Now we can test some aspects on the target using configure macros.
|
||||
PLATFORM_SETUP_OPENJDK_TARGET_BITS
|
||||
PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
|
||||
@@ -220,13 +220,6 @@ JDKOPT_SETUP_ADDRESS_SANITIZER
|
||||
# UndefinedBehaviorSanitizer
|
||||
JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER
|
||||
|
||||
# LeakSanitizer
|
||||
JDKOPT_SETUP_LEAK_SANITIZER
|
||||
|
||||
# Fallback linker
|
||||
# This needs to go before 'LIB_DETERMINE_DEPENDENCIES'
|
||||
JDKOPT_SETUP_FALLBACK_LINKER
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check dependencies for external and internal libraries.
|
||||
@@ -253,15 +246,12 @@ HOTSPOT_SETUP_MISC
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
LIB_TESTS_ENABLE_DISABLE_FAILURE_HANDLER
|
||||
LIB_TESTS_ENABLE_DISABLE_JTREG_TEST_THREAD_FACTORY
|
||||
|
||||
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
|
||||
JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
|
||||
JDKOPT_EXCLUDE_TRANSLATIONS
|
||||
JDKOPT_ENABLE_DISABLE_MANPAGES
|
||||
JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE
|
||||
JDKOPT_ENABLE_DISABLE_COMPATIBLE_CDS_ALIGNMENT
|
||||
JDKOPT_SETUP_MACOSX_SIGNING
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -51,14 +51,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
|
||||
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# Linking is different on aix
|
||||
SHARED_LIBRARY_FLAGS="-shared -Wl,-bM:SRE -Wl,-bnoentry"
|
||||
SET_EXECUTABLE_ORIGIN=""
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
|
||||
else
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
@@ -121,7 +113,7 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
)
|
||||
fi
|
||||
|
||||
CFLAGS_DEBUG_SYMBOLS="-g -gdwarf-4"
|
||||
CFLAGS_DEBUG_SYMBOLS="-g"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
|
||||
@@ -136,12 +128,7 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
)
|
||||
fi
|
||||
|
||||
# -gdwarf-4 and -gdwarf-aranges were introduced in clang 5.0
|
||||
GDWARF_FLAGS="-gdwarf-4 -gdwarf-aranges"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${GDWARF_FLAGS}],
|
||||
IF_FALSE: [GDWARF_FLAGS=""])
|
||||
|
||||
CFLAGS_DEBUG_SYMBOLS="-g ${GDWARF_FLAGS}"
|
||||
CFLAGS_DEBUG_SYMBOLS="-g"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
CFLAGS_DEBUG_SYMBOLS="-g1"
|
||||
@@ -180,7 +167,11 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-WX"
|
||||
|
||||
WARNINGS_ENABLE_ALL="-W3"
|
||||
DISABLED_WARNINGS="4800 5105"
|
||||
DISABLED_WARNINGS="4800"
|
||||
if test "x$TOOLCHAIN_VERSION" = x2017; then
|
||||
# VS2017 incorrectly triggers this warning for constexpr
|
||||
DISABLED_WARNINGS="$DISABLED_WARNINGS 4307"
|
||||
fi
|
||||
;;
|
||||
|
||||
gcc)
|
||||
@@ -197,10 +188,6 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
|
||||
|
||||
DISABLED_WARNINGS="unused-parameter unused"
|
||||
# gcc10/11 on ppc generate lots of abi warnings about layout of aggregates containing vectors
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xppc"; then
|
||||
DISABLED_WARNINGS="$DISABLED_WARNINGS psabi"
|
||||
fi
|
||||
;;
|
||||
|
||||
clang)
|
||||
@@ -214,6 +201,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
|
||||
|
||||
DISABLED_WARNINGS="unknown-warning-option unused-parameter unused"
|
||||
|
||||
;;
|
||||
|
||||
xlc)
|
||||
@@ -276,7 +264,7 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
DISABLE_FORTIFY_CFLAGS="-U_FORTIFY_SOURCE"
|
||||
# ASan doesn't work well with _FORTIFY_SOURCE
|
||||
# See https://github.com/google/sanitizers/wiki/AddressSanitizer#faq
|
||||
if test "x$ASAN_ENABLED" = xyes; then
|
||||
if test "x$ASAN_ENABLED" = xyes || test "x$USAN_ENABLED" = xyes; then
|
||||
ENABLE_FORTIFY_CFLAGS="${DISABLE_FORTIFY_CFLAGS}"
|
||||
else
|
||||
ENABLE_FORTIFY_CFLAGS="-D_FORTIFY_SOURCE=2"
|
||||
@@ -291,15 +279,9 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
C_O_FLAG_NONE="${C_O_FLAG_NONE} ${DISABLE_FORTIFY_CFLAGS}"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
C_O_FLAG_HIGHEST_JVM="-O3 -finline-functions"
|
||||
C_O_FLAG_HIGHEST="-O3 -finline-functions"
|
||||
C_O_FLAG_HI="-O3 -finline-functions"
|
||||
else
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
fi
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
C_O_FLAG_NORM="-O2"
|
||||
C_O_FLAG_DEBUG_JVM="-O0"
|
||||
C_O_FLAG_SIZE="-Os"
|
||||
@@ -471,9 +453,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# so for debug we build with '-qpic=large -bbigtoc'.
|
||||
DEBUG_CFLAGS_JVM="-qpic=large"
|
||||
fi
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
DEBUG_CFLAGS_JVM="-fpic -mcmodel=large"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$DEBUG_LEVEL" != xrelease; then
|
||||
@@ -496,7 +475,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602 \
|
||||
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
|
||||
ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602 \
|
||||
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE"
|
||||
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE \
|
||||
-D_WINSOCK_DEPRECATED_NO_WARNINGS"
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
@@ -509,14 +489,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# clang compiler on aix needs -ffunction-sections
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno -fstack-protector"
|
||||
TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char -fstack-protector"
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new -fstack-protector"
|
||||
TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
|
||||
# reduce lib size on linux in link step, this needs also special compile flags
|
||||
# do this on s390x also for libjvm (where serviceability agent is not supported)
|
||||
@@ -557,18 +531,28 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# Suggested additions: -qsrcmsg to get improved error reporting
|
||||
# set -qtbtable=full for a better traceback table/better stacks in hs_err when xlc16 is used
|
||||
TOOLCHAIN_CFLAGS_JDK="-qtbtable=full -qchars=signed -qfullpath -qsaveopt -qstackprotect" # add on both CFLAGS
|
||||
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced -fno-exceptions \
|
||||
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced \
|
||||
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -MP"
|
||||
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:wchar_t-"
|
||||
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:strictStrings -MP"
|
||||
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:strictStrings -Zc:wchar_t-"
|
||||
fi
|
||||
|
||||
# CFLAGS C language level for JDK sources (hotspot only uses C++)
|
||||
# Ideally we would have a common level across all toolchains so that all sources
|
||||
# are sure to conform to the same standard. Unfortunately neither our sources nor
|
||||
# our toolchains are in a condition to support that. But what we loosely aim for is
|
||||
# C99 level.
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
LANGSTD_CFLAGS="-std=c11"
|
||||
# Explicitly set C99. clang and xlclang support the same flag.
|
||||
LANGSTD_CFLAGS="-std=c99"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
LANGSTD_CFLAGS="-std:c11"
|
||||
# MSVC doesn't support C99/C11 explicitly, unless you compile as C++:
|
||||
# LANGSTD_CFLAGS="-TP"
|
||||
# but that requires numerous changes to the sources files. So we are limited
|
||||
# to C89/C90 plus whatever extensions Visual Studio has decided to implement.
|
||||
# This is the lowest bar for shared code.
|
||||
LANGSTD_CFLAGS=""
|
||||
fi
|
||||
TOOLCHAIN_CFLAGS_JDK_CONLY="$LANGSTD_CFLAGS $TOOLCHAIN_CFLAGS_JDK_CONLY"
|
||||
|
||||
@@ -623,9 +607,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
PICFLAG="-fPIC"
|
||||
PIEFLAG="-fPIE"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
JVM_PICFLAG="-fpic -mcmodel=large -Wl,-bbigtoc
|
||||
JDK_PICFLAG="-fpic
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
# '-qpic' defaults to 'qpic=small'. This means that the compiler generates only
|
||||
# one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker
|
||||
@@ -662,7 +643,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
STATIC_LIBS_CFLAGS="-DSTATIC_BUILD=1"
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -ffunction-sections -fdata-sections \
|
||||
-DJNIEXPORT='__attribute__((visibility(\"default\")))'"
|
||||
-DJNIEXPORT='__attribute__((visibility(\"hidden\")))'"
|
||||
else
|
||||
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -DJNIEXPORT="
|
||||
fi
|
||||
@@ -771,9 +752,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
|
||||
fi
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
$1_CFLAGS_CPU="-mcpu=pwr8"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
if test "x$FLAGS_CPU" = xppc64; then
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -70,16 +70,12 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
fi
|
||||
fi
|
||||
|
||||
BASIC_LDFLAGS_JVM_ONLY=""
|
||||
BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
|
||||
-fPIC"
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \
|
||||
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
|
||||
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
BASIC_LDFLAGS="-b64 -brtl -bnorwexec -bnolibpath -bnoexpall -bernotok -btextpsize:64K \
|
||||
-bdatapsize:64K -bstackpsize:64K"
|
||||
@@ -92,8 +88,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
|
||||
fi
|
||||
|
||||
if (test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang) \
|
||||
&& test "x$OPENJDK_TARGET_OS" != xaix; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test -n "$HAS_NOEXECSTACK"; then
|
||||
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,noexecstack"
|
||||
fi
|
||||
@@ -121,14 +116,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
if test "x$DEBUG_LEVEL" != xrelease; then
|
||||
DEBUGLEVEL_LDFLAGS_JVM_ONLY="$DEBUGLEVEL_LDFLAGS_JVM_ONLY -bbigtoc"
|
||||
fi
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# We need '-fpic' or '-fpic -mcmodel=large -Wl,-bbigtoc' if the TOC overflows.
|
||||
# Hotspot now overflows its 64K TOC (currently only for debug),
|
||||
# so we build with '-fpic -mcmodel=large -Wl,-bbigtoc'.
|
||||
if test "x$DEBUG_LEVEL" != xrelease; then
|
||||
DEBUGLEVEL_LDFLAGS_JVM_ONLY="$DEBUGLEVEL_LDFLAGS_JVM_ONLY -Wl,-bbigtoc"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Setup LDFLAGS for linking executables
|
||||
|
||||
@@ -46,31 +46,15 @@ AC_DEFUN([FLAGS_SETUP_ARFLAGS],
|
||||
AC_DEFUN([FLAGS_SETUP_STRIPFLAGS],
|
||||
[
|
||||
## Setup strip.
|
||||
if test "x$STRIP" != x; then
|
||||
AC_MSG_CHECKING([how to run strip])
|
||||
|
||||
# Easy cheat: Check strip variant by passing --version as an argument.
|
||||
# Different types of strip have varying command line syntaxes for querying their
|
||||
# version string, and all noisily fail if the provided version option is not
|
||||
# recognised.
|
||||
#
|
||||
# The actual version string or failure to execute strip are hidden by redirection
|
||||
# to config.log with 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD
|
||||
|
||||
if $STRIP "--version" 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
|
||||
# strip that comes from the GNU family uses --version
|
||||
# This variant of strip is usually found accompanying gcc and clang
|
||||
STRIPFLAGS="--strip-debug"
|
||||
elif $STRIP "-V" 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
|
||||
# IBM strip that works with AIX binaries only supports -V
|
||||
STRIPFLAGS="-X32_64"
|
||||
else
|
||||
# The only strip variant left is MacOS/Xcode strip, which does not have any
|
||||
# way whatsoever to be identified (lacking even basic help or version options),
|
||||
# so we leave it as the last fallback when all other tests have failed.
|
||||
STRIPFLAGS="-S"
|
||||
fi
|
||||
AC_MSG_RESULT($STRIPFLAGS)
|
||||
# FIXME: should this really be per platform, or should it be per toolchain type?
|
||||
# strip is not provided by clang; so guessing platform makes most sense.
|
||||
# FIXME: we should really only export STRIPFLAGS from here, not POST_STRIP_CMD.
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
STRIPFLAGS="-g"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
STRIPFLAGS="-S"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
STRIPFLAGS="-X32_64"
|
||||
fi
|
||||
|
||||
AC_SUBST(STRIPFLAGS)
|
||||
@@ -133,3 +117,4 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS_CPU_DEP],
|
||||
|
||||
AC_SUBST($2JVM_ASFLAGS)
|
||||
])
|
||||
|
||||
|
||||
@@ -342,7 +342,6 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
|
||||
AC_MSG_CHECKING([if @file is supported by gcc])
|
||||
# Extra empty "" to prevent ECHO from interpreting '--version' as argument
|
||||
$ECHO "" "--version" > command.file
|
||||
# Redirect stderr and stdout to config.log (AS_MESSAGE_LOG_FD) via merge
|
||||
if $CXX @command.file 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
|
||||
AC_MSG_RESULT(yes)
|
||||
COMPILER_COMMAND_FILE_FLAG="@"
|
||||
@@ -503,14 +502,14 @@ UTIL_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS],
|
||||
UTIL_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS],
|
||||
[*ARGUMENT IF_TRUE IF_FALSE PREFIX], [$@],
|
||||
[
|
||||
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: ARG_ARGUMENT,
|
||||
FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT],
|
||||
IF_TRUE: [C_COMP_SUPPORTS="yes"],
|
||||
IF_FALSE: [C_COMP_SUPPORTS="no"],
|
||||
PREFIX: ARG_PREFIX)
|
||||
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: ARG_ARGUMENT,
|
||||
PREFIX: [ARG_PREFIX])
|
||||
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT],
|
||||
IF_TRUE: [CXX_COMP_SUPPORTS="yes"],
|
||||
IF_FALSE: [CXX_COMP_SUPPORTS="no"],
|
||||
PREFIX: ARG_PREFIX)
|
||||
PREFIX: [ARG_PREFIX])
|
||||
|
||||
AC_MSG_CHECKING([if both ARG_PREFIX[CC] and ARG_PREFIX[CXX] support "ARG_ARGUMENT"])
|
||||
supports=no
|
||||
|
||||
@@ -278,11 +278,6 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
||||
printf "using default settings.\n"
|
||||
fi
|
||||
|
||||
if test "x$REAL_CONFIGURE_COMMAND_EXEC_FULL" != x; then
|
||||
printf "\n"
|
||||
printf "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'.\n"
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
printf "Configuration summary:\n"
|
||||
printf "* Name: $CONF_NAME\n"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -234,31 +234,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
fi
|
||||
AC_SUBST(HOTSPOT_OVERRIDE_LIBPATH)
|
||||
|
||||
# Should we build the client for the JAWS screen reader?
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
AC_MSG_CHECKING([if JAWS client support is enabled])
|
||||
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED=true
|
||||
AC_ARG_ENABLE(
|
||||
[jaws-client],
|
||||
[AS_HELP_STRING([--disable-jaws-client], [Set to disable to exclude the client for the JAWS screen reader from the build])],
|
||||
[
|
||||
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
|
||||
AC_MSG_WARN([--[enable|disable]-jaws-client[=*] flags are ignored for headless builds])
|
||||
elif test "x$enableval" != xyes; then
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED=false
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED=false
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$A11Y_JAWS_ANNOUNCING_ENABLED])
|
||||
else
|
||||
A11Y_JAWS_ANNOUNCING_ENABLED=false
|
||||
fi
|
||||
AC_SUBST(A11Y_JAWS_ANNOUNCING_ENABLED)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
@@ -435,13 +410,12 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
||||
[
|
||||
UTIL_ARG_ENABLE(NAME: asan, DEFAULT: false, RESULT: ASAN_ENABLED,
|
||||
UTIL_ARG_ENABLE(NAME: asan, DEFAULT: false,
|
||||
DESC: [enable AddressSanitizer],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if AddressSanitizer (asan) is available])
|
||||
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
|
||||
test "x$TOOLCHAIN_TYPE" = "xclang" ||
|
||||
test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
|
||||
test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
@@ -449,20 +423,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
||||
fi
|
||||
],
|
||||
IF_ENABLED: [
|
||||
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
|
||||
test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||
# ASan is simply incompatible with gcc -Wstringop-truncation. See
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85650
|
||||
# It's harmless to be suppressed in clang as well.
|
||||
ASAN_CFLAGS="-fsanitize=address -Wno-stringop-truncation -fno-omit-frame-pointer -fno-common -DADDRESS_SANITIZER"
|
||||
ASAN_LDFLAGS="-fsanitize=address"
|
||||
elif test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
|
||||
# -Oy- is equivalent to -fno-omit-frame-pointer in GCC/Clang.
|
||||
ASAN_CFLAGS="-fsanitize=address -Oy- -DADDRESS_SANITIZER"
|
||||
# MSVC produces a warning if you pass -fsanitize=address to the linker. It also complains
|
||||
$ if -DEBUG is not passed to the linker when building with ASan.
|
||||
ASAN_LDFLAGS="-debug"
|
||||
fi
|
||||
# ASan is simply incompatible with gcc -Wstringop-truncation. See
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85650
|
||||
# It's harmless to be suppressed in clang as well.
|
||||
ASAN_CFLAGS="-fsanitize=address -Wno-stringop-truncation -fno-omit-frame-pointer"
|
||||
ASAN_LDFLAGS="-fsanitize=address"
|
||||
JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS"
|
||||
JVM_LDFLAGS="$JVM_LDFLAGS $ASAN_LDFLAGS"
|
||||
CFLAGS_JDKLIB="$CFLAGS_JDKLIB $ASAN_CFLAGS"
|
||||
@@ -471,41 +436,13 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $ASAN_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $ASAN_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $ASAN_LDFLAGS"
|
||||
])
|
||||
AC_SUBST(ASAN_ENABLED)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# LeakSanitizer
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_LEAK_SANITIZER],
|
||||
[
|
||||
UTIL_ARG_ENABLE(NAME: lsan, DEFAULT: false, RESULT: LSAN_ENABLED,
|
||||
DESC: [enable LeakSanitizer],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if LeakSanitizer (lsan) is available])
|
||||
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
|
||||
test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
ASAN_ENABLED="yes"
|
||||
],
|
||||
IF_ENABLED: [
|
||||
LSAN_CFLAGS="-fsanitize=leak -fno-omit-frame-pointer -DLEAK_SANITIZER"
|
||||
LSAN_LDFLAGS="-fsanitize=leak"
|
||||
JVM_CFLAGS="$JVM_CFLAGS $LSAN_CFLAGS"
|
||||
JVM_LDFLAGS="$JVM_LDFLAGS $LSAN_LDFLAGS"
|
||||
CFLAGS_JDKLIB="$CFLAGS_JDKLIB $LSAN_CFLAGS"
|
||||
CFLAGS_JDKEXE="$CFLAGS_JDKEXE $LSAN_CFLAGS"
|
||||
CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $LSAN_CFLAGS"
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $LSAN_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $LSAN_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $LSAN_LDFLAGS"
|
||||
IF_DISABLED: [
|
||||
ASAN_ENABLED="no"
|
||||
])
|
||||
AC_SUBST(LSAN_ENABLED)
|
||||
|
||||
AC_SUBST(ASAN_ENABLED)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
@@ -514,15 +451,10 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_LEAK_SANITIZER],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
|
||||
[
|
||||
# GCC reports lots of likely false positives for stringop-truncation and format-overflow.
|
||||
# Silence them for now.
|
||||
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base"
|
||||
UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
|
||||
UBSAN_LDFLAGS="$UBSAN_CHECKS"
|
||||
UTIL_ARG_ENABLE(NAME: ubsan, DEFAULT: false, RESULT: UBSAN_ENABLED,
|
||||
UTIL_ARG_ENABLE(NAME: usan, DEFAULT: false,
|
||||
DESC: [enable UndefinedBehaviorSanitizer],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if UndefinedBehaviorSanitizer (ubsan) is available])
|
||||
AC_MSG_CHECKING([if UndefinedBehaviorSanitizer (usan) is available])
|
||||
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
|
||||
test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
@@ -532,22 +464,24 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
|
||||
fi
|
||||
],
|
||||
IF_ENABLED: [
|
||||
JVM_CFLAGS="$JVM_CFLAGS $UBSAN_CFLAGS"
|
||||
JVM_LDFLAGS="$JVM_LDFLAGS $UBSAN_LDFLAGS"
|
||||
CFLAGS_JDKLIB="$CFLAGS_JDKLIB $UBSAN_CFLAGS"
|
||||
CFLAGS_JDKEXE="$CFLAGS_JDKEXE $UBSAN_CFLAGS"
|
||||
CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $UBSAN_CFLAGS"
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $UBSAN_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $UBSAN_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $UBSAN_LDFLAGS"
|
||||
USAN_FLAGS="-fsanitize=undefined"
|
||||
USAN_CFLAGS="$USAN_FLAGS -fno-omit-frame-pointer"
|
||||
USAN_LDFLAGS="$USAN_FLAGS"
|
||||
JVM_CFLAGS="$JVM_CFLAGS $USAN_CFLAGS"
|
||||
JVM_LDFLAGS="$JVM_LDFLAGS $USAN_LDFLAGS"
|
||||
CFLAGS_JDKLIB="$CFLAGS_JDKLIB $USAN_CFLAGS"
|
||||
CFLAGS_JDKEXE="$CFLAGS_JDKEXE $USAN_CFLAGS"
|
||||
CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $USAN_CFLAGS"
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $USAN_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $USAN_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $USAN_LDFLAGS"
|
||||
USAN_ENABLED="yes"
|
||||
],
|
||||
IF_DISABLED: [
|
||||
USAN_ENABLED="no"
|
||||
])
|
||||
if test "x$UBSAN_ENABLED" = xfalse; then
|
||||
UBSAN_CFLAGS=""
|
||||
UBSAN_LDFLAGS=""
|
||||
fi
|
||||
AC_SUBST(UBSAN_CFLAGS)
|
||||
AC_SUBST(UBSAN_LDFLAGS)
|
||||
AC_SUBST(UBSAN_ENABLED)
|
||||
|
||||
AC_SUBST(USAN_ENABLED)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@@ -577,31 +511,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
|
||||
AC_SUBST(STATIC_BUILD)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# jmod options.
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JMOD_OPTIONS],
|
||||
[
|
||||
# Final JMODs are recompiled often during development, and java.base JMOD
|
||||
# includes the JVM libraries. In release mode, prefer to compress JMODs fully.
|
||||
# In debug mode, pay with a little extra space, but win a lot of CPU time back
|
||||
# with the lightest (but still some) compression.
|
||||
if test "x$DEBUG_LEVEL" = xrelease; then
|
||||
DEFAULT_JMOD_COMPRESS="zip-6"
|
||||
else
|
||||
DEFAULT_JMOD_COMPRESS="zip-1"
|
||||
fi
|
||||
|
||||
UTIL_ARG_WITH(NAME: jmod-compress, TYPE: literal,
|
||||
VALID_VALUES: [zip-0 zip-1 zip-2 zip-3 zip-4 zip-5 zip-6 zip-7 zip-8 zip-9],
|
||||
DEFAULT: $DEFAULT_JMOD_COMPRESS,
|
||||
CHECKING_MSG: [for JMOD compression type],
|
||||
DESC: [specify JMOD compression type (zip-[0-9])]
|
||||
)
|
||||
AC_SUBST(JMOD_COMPRESS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# jlink options.
|
||||
@@ -616,6 +525,29 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
|
||||
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Check if building of the jtreg failure handler should be enabled.
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
|
||||
[
|
||||
UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto,
|
||||
RESULT: BUILD_FAILURE_HANDLER,
|
||||
DESC: [enable building of the jtreg failure handler],
|
||||
DEFAULT_DESC: [enabled if jtreg is present],
|
||||
CHECKING_MSG: [if the jtreg failure handler should be built],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if the jtreg failure handler is available])
|
||||
if test "x$JT_HOME" != "x"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AVAILABLE=false
|
||||
AC_MSG_RESULT([no (jtreg not present)])
|
||||
fi
|
||||
])
|
||||
AC_SUBST(BUILD_FAILURE_HANDLER)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Enable or disable generation of the classlist at build time
|
||||
@@ -755,7 +687,7 @@ AC_DEFUN([JDKOPT_ALLOW_ABSOLUTE_PATHS_IN_OUTPUT],
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_REPRODUCIBLE_BUILD],
|
||||
[
|
||||
AC_ARG_WITH([source-date], [AS_HELP_STRING([--with-source-date],
|
||||
[how to set SOURCE_DATE_EPOCH ('updated', 'current', 'version' a timestamp or an ISO-8601 date) @<:@current/value of SOURCE_DATE_EPOCH@:>@])],
|
||||
[how to set SOURCE_DATE_EPOCH ('updated', 'current', 'version' a timestamp or an ISO-8601 date) @<:@updated/value of SOURCE_DATE_EPOCH@:>@])],
|
||||
[with_source_date_present=true], [with_source_date_present=false])
|
||||
|
||||
if test "x$SOURCE_DATE_EPOCH" != x && test "x$with_source_date" != x; then
|
||||
@@ -772,9 +704,9 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_REPRODUCIBLE_BUILD],
|
||||
with_source_date_present=true
|
||||
AC_MSG_RESULT([$SOURCE_DATE, from SOURCE_DATE_EPOCH])
|
||||
else
|
||||
# Tell makefiles to take the time from configure
|
||||
SOURCE_DATE=$($DATE +"%s")
|
||||
AC_MSG_RESULT([$SOURCE_DATE, from 'current' (default)])
|
||||
# Tell the makefiles to update at each build
|
||||
SOURCE_DATE=updated
|
||||
AC_MSG_RESULT([determined at build time (default)])
|
||||
fi
|
||||
elif test "x$with_source_date" = xupdated; then
|
||||
SOURCE_DATE=updated
|
||||
@@ -826,124 +758,3 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_REPRODUCIBLE_BUILD],
|
||||
|
||||
UTIL_DEPRECATED_ARG_ENABLE(reproducible-build)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Setup signing on macOS. This can either be setup to sign with a real identity
|
||||
# and enabling the hardened runtime, or it can simply add the debug entitlement
|
||||
# com.apple.security.get-task-allow without actually signing any binaries. The
|
||||
# latter is needed to be able to debug processes and dump core files on modern
|
||||
# versions of macOS. It can also be skipped completely.
|
||||
#
|
||||
# Check if codesign will run with the given parameters
|
||||
# $1: Parameters to run with
|
||||
# $2: Checking message
|
||||
# Sets CODESIGN_SUCCESS=true/false
|
||||
AC_DEFUN([JDKOPT_CHECK_CODESIGN_PARAMS],
|
||||
[
|
||||
PARAMS="$1"
|
||||
MESSAGE="$2"
|
||||
CODESIGN_TESTFILE="$CONFIGURESUPPORT_OUTPUTDIR/codesign-testfile"
|
||||
$RM "$CODESIGN_TESTFILE"
|
||||
$TOUCH "$CODESIGN_TESTFILE"
|
||||
CODESIGN_SUCCESS=false
|
||||
eval \"$CODESIGN\" $PARAMS \"$CODESIGN_TESTFILE\" 2>&AS_MESSAGE_LOG_FD \
|
||||
>&AS_MESSAGE_LOG_FD && CODESIGN_SUCCESS=true
|
||||
$RM "$CODESIGN_TESTFILE"
|
||||
AC_MSG_CHECKING([$MESSAGE])
|
||||
if test "x$CODESIGN_SUCCESS" = "xtrue"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([JDKOPT_CHECK_CODESIGN_HARDENED],
|
||||
[
|
||||
JDKOPT_CHECK_CODESIGN_PARAMS([-s \"$MACOSX_CODESIGN_IDENTITY\" --option runtime],
|
||||
[if codesign with hardened runtime is possible])
|
||||
])
|
||||
|
||||
AC_DEFUN([JDKOPT_CHECK_CODESIGN_DEBUG],
|
||||
[
|
||||
JDKOPT_CHECK_CODESIGN_PARAMS([-s -], [if debug mode codesign is possible])
|
||||
])
|
||||
|
||||
AC_DEFUN([JDKOPT_SETUP_MACOSX_SIGNING],
|
||||
[
|
||||
ENABLE_CODESIGN=false
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx" && test "x$CODESIGN" != "x"; then
|
||||
|
||||
UTIL_ARG_WITH(NAME: macosx-codesign, TYPE: literal, OPTIONAL: true,
|
||||
VALID_VALUES: [hardened debug auto], DEFAULT: auto,
|
||||
ENABLED_DEFAULT: true,
|
||||
CHECKING_MSG: [for macosx code signing mode],
|
||||
DESC: [set the macosx code signing mode (hardened, debug, auto)]
|
||||
)
|
||||
|
||||
MACOSX_CODESIGN_MODE=disabled
|
||||
if test "x$MACOSX_CODESIGN_ENABLED" = "xtrue"; then
|
||||
|
||||
# Check for user provided code signing identity.
|
||||
UTIL_ARG_WITH(NAME: macosx-codesign-identity, TYPE: string,
|
||||
DEFAULT: openjdk_codesign, CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY],
|
||||
DESC: [specify the macosx code signing identity],
|
||||
CHECKING_MSG: [for macosx code signing identity]
|
||||
)
|
||||
AC_SUBST(MACOSX_CODESIGN_IDENTITY)
|
||||
|
||||
if test "x$MACOSX_CODESIGN" = "xauto"; then
|
||||
# Only try to default to hardened signing on release builds
|
||||
if test "x$DEBUG_LEVEL" = "xrelease"; then
|
||||
JDKOPT_CHECK_CODESIGN_HARDENED
|
||||
if test "x$CODESIGN_SUCCESS" = "xtrue"; then
|
||||
MACOSX_CODESIGN_MODE=hardened
|
||||
fi
|
||||
fi
|
||||
if test "x$MACOSX_CODESIGN_MODE" = "xdisabled"; then
|
||||
JDKOPT_CHECK_CODESIGN_DEBUG
|
||||
if test "x$CODESIGN_SUCCESS" = "xtrue"; then
|
||||
MACOSX_CODESIGN_MODE=debug
|
||||
fi
|
||||
fi
|
||||
AC_MSG_CHECKING([for macosx code signing mode])
|
||||
AC_MSG_RESULT([$MACOSX_CODESIGN_MODE])
|
||||
elif test "x$MACOSX_CODESIGN" = "xhardened"; then
|
||||
JDKOPT_CHECK_CODESIGN_HARDENED
|
||||
if test "x$CODESIGN_SUCCESS" = "xfalse"; then
|
||||
AC_MSG_ERROR([Signing with hardened runtime is not possible])
|
||||
fi
|
||||
MACOSX_CODESIGN_MODE=hardened
|
||||
elif test "x$MACOSX_CODESIGN" = "xdebug"; then
|
||||
JDKOPT_CHECK_CODESIGN_DEBUG
|
||||
if test "x$CODESIGN_SUCCESS" = "xfalse"; then
|
||||
AC_MSG_ERROR([Signing in debug mode is not possible])
|
||||
fi
|
||||
MACOSX_CODESIGN_MODE=debug
|
||||
else
|
||||
AC_MSG_ERROR([unknown value for --with-macosx-codesign: $MACOSX_CODESIGN])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MACOSX_CODESIGN_IDENTITY)
|
||||
AC_SUBST(MACOSX_CODESIGN_MODE)
|
||||
fi
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# fallback linker
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_FALLBACK_LINKER],
|
||||
[
|
||||
FALLBACK_LINKER_DEFAULT=false
|
||||
|
||||
if HOTSPOT_CHECK_JVM_VARIANT(zero); then
|
||||
FALLBACK_LINKER_DEFAULT=true
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: fallback-linker, DEFAULT: $FALLBACK_LINKER_DEFAULT,
|
||||
RESULT: ENABLE_FALLBACK_LINKER,
|
||||
DESC: [enable libffi-based fallback implementation of java.lang.foreign.Linker],
|
||||
CHECKING_MSG: [if fallback linker enabled])
|
||||
AC_SUBST(ENABLE_FALLBACK_LINKER)
|
||||
])
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user