Change-Id: I67fbd07da84e2043ace3e4ccc68e4c15dd915a11
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2457
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Divya Thaluru <dthaluru@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
... | ... |
@@ -41,6 +41,12 @@ else |
41 | 41 |
PHOTON_PUBLISH_RPMS := publish-rpms |
42 | 42 |
endif |
43 | 43 |
|
44 |
+ifdef PHOTON_PUBLISH_XRPMS_PATH |
|
45 |
+PHOTON_PUBLISH_XRPMS := publish-x-rpms-cached |
|
46 |
+else |
|
47 |
+PHOTON_PUBLISH_XRPMS := publish-x-rpms |
|
48 |
+endif |
|
49 |
+ |
|
44 | 50 |
# Tri state RPMCHECK: |
45 | 51 |
# 1) RPMCHECK is not specified: just build |
46 | 52 |
# 2) RPMCHECK=enable: build and run %check section. do not stop on error. will generate report file. |
... | ... |
@@ -224,7 +230,7 @@ who-needs: |
224 | 224 |
@cd $(PHOTON_SPECDEPS_DIR) && \ |
225 | 225 |
$(PHOTON_SPECDEPS) -s $(PHOTON_SPECS_DIR) -i who-needs -p $(pkg) |
226 | 226 |
|
227 |
-packages: check-tools $(PHOTON_STAGE) $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES) $(CONTAIN) generate-dep-lists |
|
227 |
+packages: check-tools $(PHOTON_STAGE) $(PHOTON_PUBLISH_XRPMS) $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES) $(CONTAIN) generate-dep-lists |
|
228 | 228 |
@echo "Building all RPMS..." |
229 | 229 |
@cd $(PHOTON_PKG_BUILDER_DIR) && \ |
230 | 230 |
$(PHOTON_PACKAGE_BUILDER) \ |
... | ... |
@@ -235,6 +241,7 @@ packages: check-tools $(PHOTON_STAGE) $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES) $ |
235 | 235 |
-b $(PHOTON_CHROOT_PATH) \ |
236 | 236 |
-l $(PHOTON_LOGS_DIR) \ |
237 | 237 |
-p $(PHOTON_PUBLISH_RPMS_DIR) \ |
238 |
+ -e $(PHOTON_PUBLISH_XRPMS_DIR) \ |
|
238 | 239 |
-c $(PHOTON_BINTRAY_CONFIG) \ |
239 | 240 |
-d $(PHOTON_DIST_TAG) \ |
240 | 241 |
-n $(PHOTON_BUILD_NUMBER) \ |
... | ... |
@@ -244,7 +251,7 @@ packages: check-tools $(PHOTON_STAGE) $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES) $ |
244 | 244 |
$(PHOTON_RPMCHECK_FLAGS) \ |
245 | 245 |
-t ${THREADS} |
246 | 246 |
|
247 |
-updated-packages: check-tools $(PHOTON_STAGE) $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES) $(CONTAIN) generate-dep-lists |
|
247 |
+updated-packages: check-tools $(PHOTON_STAGE) $(PHOTON_PUBLISH_XRPMS) $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES) $(CONTAIN) generate-dep-lists |
|
248 | 248 |
@echo "Building only updated RPMS..." |
249 | 249 |
@cd $(PHOTON_PKG_BUILDER_DIR) && \ |
250 | 250 |
$(PHOTON_PACKAGE_BUILDER) \ |
... | ... |
@@ -254,6 +261,7 @@ updated-packages: check-tools $(PHOTON_STAGE) $(PHOTON_PUBLISH_RPMS) $(PHOTON_SO |
254 | 254 |
-b $(PHOTON_CHROOT_PATH) \ |
255 | 255 |
-l $(PHOTON_LOGS_DIR) \ |
256 | 256 |
-p $(PHOTON_PUBLISH_RPMS_DIR) \ |
257 |
+ -e $(PHOTON_PUBLISH_XRPMS_DIR) \ |
|
257 | 258 |
-c $(PHOTON_BINTRAY_CONFIG) \ |
258 | 259 |
-d $(PHOTON_DIST_TAG) \ |
259 | 260 |
-n $(PHOTON_BUILD_NUMBER) \ |
... | ... |
@@ -321,11 +329,21 @@ publish-rpms: |
321 | 321 |
@cd $(PHOTON_PULL_PUBLISH_RPMS_DIR) && \ |
322 | 322 |
$(PHOTON_PULL_PUBLISH_RPMS) $(PHOTON_PUBLISH_RPMS_DIR) |
323 | 323 |
|
324 |
+publish-x-rpms: |
|
325 |
+ @echo "Pulling publish X rpms from bintray..." |
|
326 |
+ @cd $(PHOTON_PULL_PUBLISH_RPMS_DIR) && \ |
|
327 |
+ $(PHOTON_PULL_PUBLISH_X_RPMS) $(PHOTON_PUBLISH_XRPMS_DIR) |
|
328 |
+ |
|
324 | 329 |
publish-rpms-cached: |
325 | 330 |
@echo "Using cached publish rpms..." |
326 | 331 |
@$(MKDIR) -p $(PHOTON_PUBLISH_RPMS_DIR) && \ |
327 | 332 |
$(CP) -rf $(PHOTON_PUBLISH_RPMS_PATH)/* $(PHOTON_PUBLISH_RPMS_DIR)/ |
328 | 333 |
|
334 |
+publish-x-rpms-cached: |
|
335 |
+ @echo "Using ..." |
|
336 |
+ @$(MKDIR) -p $(PHOTON_PUBLISH_XRPMS_DIR) && \ |
|
337 |
+ $(CP) -rf $(PHOTON_PUBLISH_XRPMS_PATH)/* $(PHOTON_PUBLISH_XRPMS_DIR)/ |
|
338 |
+ |
|
329 | 339 |
$(PHOTON_STAGE): |
330 | 340 |
@echo "Creating staging folder..." |
331 | 341 |
$(MKDIR) -p $(PHOTON_STAGE) |
... | ... |
@@ -506,6 +524,7 @@ check: packages |
506 | 506 |
-b $(PHOTON_CHROOT_PATH) \ |
507 | 507 |
-l $(PHOTON_LOGS_DIR) \ |
508 | 508 |
-p $(PHOTON_PUBLISH_RPMS_DIR) \ |
509 |
+ -e $(PHOTON_PUBLISH_XRPMS_DIR) \ |
|
509 | 510 |
-c $(PHOTON_BINTRAY_CONFIG) \ |
510 | 511 |
-d $(PHOTON_DIST_TAG) \ |
511 | 512 |
-n $(PHOTON_BUILD_NUMBER) \ |
... | ... |
@@ -516,7 +535,7 @@ check: packages |
516 | 516 |
$(rpmcheck_stop_on_error) \ |
517 | 517 |
-t ${THREADS} |
518 | 518 |
|
519 |
-%: check-tools $(PHOTON_PUBLISH_RPMS) $(PHOTON_SOURCES) $(CONTAIN) |
|
519 |
+%: check-tools $(PHOTON_PUBLISH_RPMS) $(PHOTON_PUBLISH_XRPMS) $(PHOTON_SOURCES) $(CONTAIN) $(eval PKG_NAME = $@) |
|
520 | 520 |
$(eval PKG_NAME = $@) |
521 | 521 |
@echo "Building package $(PKG_NAME) ..." |
522 | 522 |
@cd $(PHOTON_PKG_BUILDER_DIR) && \ |
... | ... |
@@ -527,6 +546,7 @@ check: packages |
527 | 527 |
-a $(PHOTON_SRPMS_DIR) \ |
528 | 528 |
-x $(PHOTON_SRCS_DIR) \ |
529 | 529 |
-p $(PHOTON_PUBLISH_RPMS_DIR) \ |
530 |
+ -e $(PHOTON_PUBLISH_XRPMS_DIR) \ |
|
530 | 531 |
-c $(PHOTON_BINTRAY_CONFIG) \ |
531 | 532 |
-d $(PHOTON_DIST_TAG) \ |
532 | 533 |
-n $(PHOTON_BUILD_NUMBER) \ |
533 | 534 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,433 @@ |
0 |
+--- a/jdk/src/share/back/invoker.c Tue Mar 29 23:02:04 2016 +0100 |
|
1 |
+@@ -211,6 +211,47 @@ |
|
2 |
+ return error; |
|
3 |
+ } |
|
4 |
+ |
|
5 |
++/* |
|
6 |
++ * Delete global references from the request which got put there before a |
|
7 |
++ * invoke request was carried out. See fillInvokeRequest() and invoker invoke*() |
|
8 |
++ * impls. |
|
9 |
++ */ |
|
10 |
++static void |
|
11 |
++deleteGlobalRefs(JNIEnv *env, InvokeRequest *request) |
|
12 |
++{ |
|
13 |
++ void *cursor; |
|
14 |
++ jint argIndex = 0; |
|
15 |
++ jvalue *argument = request->arguments; |
|
16 |
++ jbyte argumentTag = firstArgumentTypeTag(request->methodSignature, &cursor); |
|
17 |
++ |
|
18 |
++ if (request->clazz != NULL) { |
|
19 |
++ tossGlobalRef(env, &(request->clazz)); |
|
20 |
++ } |
|
21 |
++ if (request->instance != NULL) { |
|
22 |
++ tossGlobalRef(env, &(request->instance)); |
|
23 |
++ } |
|
24 |
++ /* Delete global argument references */ |
|
25 |
++ while (argIndex < request->argumentCount) { |
|
26 |
++ if ((argumentTag == JDWP_TAG(OBJECT)) || |
|
27 |
++ (argumentTag == JDWP_TAG(ARRAY))) { |
|
28 |
++ if (argument->l != NULL) { |
|
29 |
++ tossGlobalRef(env, &(argument->l)); |
|
30 |
++ } |
|
31 |
++ } |
|
32 |
++ argument++; |
|
33 |
++ argIndex++; |
|
34 |
++ argumentTag = nextArgumentTypeTag(&cursor); |
|
35 |
++ } |
|
36 |
++ /* Delete potentially saved return values */ |
|
37 |
++ if ((request->invokeType == INVOKE_CONSTRUCTOR) || |
|
38 |
++ (returnTypeTag(request->methodSignature) == JDWP_TAG(OBJECT)) || |
|
39 |
++ (returnTypeTag(request->methodSignature) == JDWP_TAG(ARRAY))) { |
|
40 |
++ if (request->returnValue.l != NULL) { |
|
41 |
++ tossGlobalRef(env, &(request->returnValue.l)); |
|
42 |
++ } |
|
43 |
++ } |
|
44 |
++} |
|
45 |
++ |
|
46 |
+ static jvmtiError |
|
47 |
+ fillInvokeRequest(JNIEnv *env, InvokeRequest *request, |
|
48 |
+ jbyte invokeType, jbyte options, jint id, |
|
49 |
+@@ -736,6 +777,13 @@ |
|
50 |
+ (void)outStream_writeObjectRef(env, &out, exc); |
|
51 |
+ outStream_sendReply(&out); |
|
52 |
+ } |
|
53 |
++ |
|
54 |
++ /* |
|
55 |
++ * At this time, there's no need to retain global references on |
|
56 |
++ * arguments since the reply is processed. No one will deal with |
|
57 |
++ * this request ID anymore, so we must call deleteGlobalRefs(). |
|
58 |
++ */ |
|
59 |
++ deleteGlobalRefs(env, request); |
|
60 |
+ } |
|
61 |
+ |
|
62 |
+ jboolean |
|
63 |
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
64 |
+@@ -0,0 +1,1 @@ |
|
65 |
++-Xmx40m |
|
66 |
+\ No newline at end of file |
|
67 |
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
68 |
+@@ -0,0 +1,312 @@ |
|
69 |
++/* |
|
70 |
++ * Copyright (c) 2016 Red Hat Inc. |
|
71 |
++ * |
|
72 |
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
73 |
++ * |
|
74 |
++ * This code is free software; you can redistribute it and/or modify it |
|
75 |
++ * under the terms of the GNU General Public License version 2 only, as |
|
76 |
++ * published by the Free Software Foundation. |
|
77 |
++ * |
|
78 |
++ * This code is distributed in the hope that it will be useful, but WITHOUT |
|
79 |
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
80 |
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
81 |
++ * version 2 for more details (a copy is included in the LICENSE file that |
|
82 |
++ * accompanied this code). |
|
83 |
++ * |
|
84 |
++ * You should have received a copy of the GNU General Public License version |
|
85 |
++ * 2 along with this work; if not, write to the Free Software Foundation, |
|
86 |
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
87 |
++ * |
|
88 |
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
89 |
++ * or visit www.oracle.com if you need additional information or have any |
|
90 |
++ * questions. |
|
91 |
++ */ |
|
92 |
++ |
|
93 |
++/** |
|
94 |
++ * @test |
|
95 |
++ * @bug 4858370 |
|
96 |
++ * @summary JDWP: Memory Leak (global references not deleted after invokeMethod). |
|
97 |
++ * |
|
98 |
++ * @author Severin Gehwolf <sgehwolf@redhat.com> |
|
99 |
++ * |
|
100 |
++ * @library .. |
|
101 |
++ * @run build TestScaffold VMConnection TargetListener TargetAdapter |
|
102 |
++ * @run compile -g OomDebugTest.java |
|
103 |
++ * @run shell OomDebugTestSetup.sh |
|
104 |
++ * @run main OomDebugTest OomDebugTestTarget test1 |
|
105 |
++ * @run main OomDebugTest OomDebugTestTarget test2 |
|
106 |
++ * @run main OomDebugTest OomDebugTestTarget test3 |
|
107 |
++ * @run main OomDebugTest OomDebugTestTarget test4 |
|
108 |
++ * @run main OomDebugTest OomDebugTestTarget test5 |
|
109 |
++ */ |
|
110 |
++import java.util.ArrayList; |
|
111 |
++import java.util.Collections; |
|
112 |
++import java.util.List; |
|
113 |
++ |
|
114 |
++import com.sun.jdi.ArrayReference; |
|
115 |
++import com.sun.jdi.ArrayType; |
|
116 |
++import com.sun.jdi.ClassType; |
|
117 |
++import com.sun.jdi.Field; |
|
118 |
++import com.sun.jdi.InvocationException; |
|
119 |
++import com.sun.jdi.Method; |
|
120 |
++import com.sun.jdi.ObjectReference; |
|
121 |
++import com.sun.jdi.ReferenceType; |
|
122 |
++import com.sun.jdi.StackFrame; |
|
123 |
++import com.sun.jdi.VMOutOfMemoryException; |
|
124 |
++import com.sun.jdi.Value; |
|
125 |
++import com.sun.jdi.event.BreakpointEvent; |
|
126 |
++ |
|
127 |
++/***************** Target program **********************/ |
|
128 |
++ |
|
129 |
++class OomDebugTestTarget { |
|
130 |
++ |
|
131 |
++ OomDebugTestTarget() { |
|
132 |
++ System.out.println("DEBUG: invoked constructor"); |
|
133 |
++ } |
|
134 |
++ static class FooCls { |
|
135 |
++ @SuppressWarnings("unused") |
|
136 |
++ private byte[] bytes = new byte[3000000]; |
|
137 |
++ }; |
|
138 |
++ |
|
139 |
++ FooCls fooCls = new FooCls(); |
|
140 |
++ byte[] byteArray = new byte[0]; |
|
141 |
++ |
|
142 |
++ void testMethod(FooCls foo) { |
|
143 |
++ System.out.println("DEBUG: invoked 'void testMethod(FooCls)', foo == " + foo); |
|
144 |
++ } |
|
145 |
++ |
|
146 |
++ void testPrimitive(byte[] foo) { |
|
147 |
++ System.out.println("DEBUG: invoked 'void testPrimitive(byte[])', foo == " + foo); |
|
148 |
++ } |
|
149 |
++ |
|
150 |
++ byte[] testPrimitiveArrRetval() { |
|
151 |
++ System.out.println("DEBUG: invoked 'byte[] testPrimitiveArrRetval()'"); |
|
152 |
++ return new byte[3000000]; |
|
153 |
++ } |
|
154 |
++ |
|
155 |
++ FooCls testFooClsRetval() { |
|
156 |
++ System.out.println("DEBUG: invoked 'FooCls testFooClsRetval()'"); |
|
157 |
++ return new FooCls(); |
|
158 |
++ } |
|
159 |
++ |
|
160 |
++ public void entry() {} |
|
161 |
++ |
|
162 |
++ public static void main(String[] args){ |
|
163 |
++ System.out.println("DEBUG: OomDebugTestTarget.main"); |
|
164 |
++ new OomDebugTestTarget().entry(); |
|
165 |
++ } |
|
166 |
++} |
|
167 |
++ |
|
168 |
++/***************** Test program ************************/ |
|
169 |
++ |
|
170 |
++public class OomDebugTest extends TestScaffold { |
|
171 |
++ |
|
172 |
++ private static final int TOTAL_TESTS = 1; |
|
173 |
++ private ReferenceType targetClass; |
|
174 |
++ private ObjectReference thisObject; |
|
175 |
++ private int failedTests; |
|
176 |
++ private final String testMethodName; |
|
177 |
++ |
|
178 |
++ public OomDebugTest(String[] args) { |
|
179 |
++ super(args); |
|
180 |
++ if (args.length != 2) { |
|
181 |
++ throw new RuntimeException("Test failed unexpectedly."); |
|
182 |
++ } |
|
183 |
++ testMethodName = args[1]; |
|
184 |
++ } |
|
185 |
++ |
|
186 |
++ @Override |
|
187 |
++ protected void runTests() throws Exception { |
|
188 |
++ try { |
|
189 |
++ /* |
|
190 |
++ * Get to the top of entry() |
|
191 |
++ * to determine targetClass and mainThread |
|
192 |
++ */ |
|
193 |
++ BreakpointEvent bpe = startTo("OomDebugTestTarget", "entry", "()V"); |
|
194 |
++ targetClass = bpe.location().declaringType(); |
|
195 |
++ |
|
196 |
++ mainThread = bpe.thread(); |
|
197 |
++ |
|
198 |
++ StackFrame frame = mainThread.frame(0); |
|
199 |
++ thisObject = frame.thisObject(); |
|
200 |
++ java.lang.reflect.Method m = findTestMethod(); |
|
201 |
++ m.invoke(this); |
|
202 |
++ } catch (NoSuchMethodException e) { |
|
203 |
++ e.printStackTrace(); |
|
204 |
++ failure(); |
|
205 |
++ } catch (SecurityException e) { |
|
206 |
++ e.printStackTrace(); |
|
207 |
++ failure(); |
|
208 |
++ } |
|
209 |
++ } |
|
210 |
++ |
|
211 |
++ private java.lang.reflect.Method findTestMethod() |
|
212 |
++ throws NoSuchMethodException, SecurityException { |
|
213 |
++ return OomDebugTest.class.getDeclaredMethod(testMethodName); |
|
214 |
++ } |
|
215 |
++ |
|
216 |
++ private void failure() { |
|
217 |
++ failedTests++; |
|
218 |
++ } |
|
219 |
++ |
|
220 |
++ /* |
|
221 |
++ * Test case: Object reference as method parameter. |
|
222 |
++ */ |
|
223 |
++ @SuppressWarnings("unused") // called via reflection |
|
224 |
++ private void test1() throws Exception { |
|
225 |
++ System.out.println("DEBUG: ------------> Running " + testMethodName); |
|
226 |
++ try { |
|
227 |
++ Field field = targetClass.fieldByName("fooCls"); |
|
228 |
++ ClassType clsType = (ClassType)field.type(); |
|
229 |
++ Method constructor = getConstructorForClass(clsType); |
|
230 |
++ for (int i = 0; i < 15; i++) { |
|
231 |
++ @SuppressWarnings({ "rawtypes", "unchecked" }) |
|
232 |
++ ObjectReference objRef = clsType.newInstance(mainThread, |
|
233 |
++ constructor, |
|
234 |
++ new ArrayList(0), |
|
235 |
++ ObjectReference.INVOKE_NONVIRTUAL); |
|
236 |
++ invoke("testMethod", "(LOomDebugTestTarget$FooCls;)V", objRef); |
|
237 |
++ } |
|
238 |
++ } catch (InvocationException e) { |
|
239 |
++ handleFailure(e); |
|
240 |
++ } |
|
241 |
++ } |
|
242 |
++ |
|
243 |
++ /* |
|
244 |
++ * Test case: Array reference as method parameter. |
|
245 |
++ */ |
|
246 |
++ @SuppressWarnings("unused") // called via reflection |
|
247 |
++ private void test2() throws Exception { |
|
248 |
++ System.out.println("DEBUG: ------------> Running " + testMethodName); |
|
249 |
++ try { |
|
250 |
++ Field field = targetClass.fieldByName("byteArray"); |
|
251 |
++ ArrayType arrType = (ArrayType)field.type(); |
|
252 |
++ |
|
253 |
++ for (int i = 0; i < 15; i++) { |
|
254 |
++ ArrayReference byteArrayVal = arrType.newInstance(3000000); |
|
255 |
++ invoke("testPrimitive", "([B)V", byteArrayVal); |
|
256 |
++ } |
|
257 |
++ } catch (VMOutOfMemoryException e) { |
|
258 |
++ defaultHandleOOMFailure(e); |
|
259 |
++ } |
|
260 |
++ } |
|
261 |
++ |
|
262 |
++ /* |
|
263 |
++ * Test case: Array reference as return value. |
|
264 |
++ */ |
|
265 |
++ @SuppressWarnings("unused") // called via reflection |
|
266 |
++ private void test3() throws Exception { |
|
267 |
++ System.out.println("DEBUG: ------------> Running " + testMethodName); |
|
268 |
++ try { |
|
269 |
++ for (int i = 0; i < 15; i++) { |
|
270 |
++ invoke("testPrimitiveArrRetval", |
|
271 |
++ "()[B", |
|
272 |
++ Collections.EMPTY_LIST, |
|
273 |
++ vm().mirrorOfVoid()); |
|
274 |
++ } |
|
275 |
++ } catch (InvocationException e) { |
|
276 |
++ handleFailure(e); |
|
277 |
++ } |
|
278 |
++ } |
|
279 |
++ |
|
280 |
++ /* |
|
281 |
++ * Test case: Object reference as return value. |
|
282 |
++ */ |
|
283 |
++ @SuppressWarnings("unused") // called via reflection |
|
284 |
++ private void test4() throws Exception { |
|
285 |
++ System.out.println("DEBUG: ------------> Running " + testMethodName); |
|
286 |
++ try { |
|
287 |
++ for (int i = 0; i < 15; i++) { |
|
288 |
++ invoke("testFooClsRetval", |
|
289 |
++ "()LOomDebugTestTarget$FooCls;", |
|
290 |
++ Collections.EMPTY_LIST, |
|
291 |
++ vm().mirrorOfVoid()); |
|
292 |
++ } |
|
293 |
++ } catch (InvocationException e) { |
|
294 |
++ handleFailure(e); |
|
295 |
++ } |
|
296 |
++ } |
|
297 |
++ |
|
298 |
++ /* |
|
299 |
++ * Test case: Constructor |
|
300 |
++ */ |
|
301 |
++ @SuppressWarnings({ "unused", "unchecked", "rawtypes" }) // called via reflection |
|
302 |
++ private void test5() throws Exception { |
|
303 |
++ System.out.println("DEBUG: ------------> Running " + testMethodName); |
|
304 |
++ try { |
|
305 |
++ ClassType type = (ClassType)thisObject.type(); |
|
306 |
++ for (int i = 0; i < 15; i++) { |
|
307 |
++ type.newInstance(mainThread, |
|
308 |
++ findMethod(targetClass, "<init>", "()V"), |
|
309 |
++ new ArrayList(0), |
|
310 |
++ ObjectReference.INVOKE_NONVIRTUAL); |
|
311 |
++ } |
|
312 |
++ } catch (InvocationException e) { |
|
313 |
++ handleFailure(e); |
|
314 |
++ } |
|
315 |
++ } |
|
316 |
++ |
|
317 |
++ private Method getConstructorForClass(ClassType clsType) { |
|
318 |
++ List<Method> methods = clsType.methodsByName("<init>"); |
|
319 |
++ if (methods.size() != 1) { |
|
320 |
++ throw new RuntimeException("FAIL. Expected only one, the default, constructor"); |
|
321 |
++ } |
|
322 |
++ return methods.get(0); |
|
323 |
++ } |
|
324 |
++ |
|
325 |
++ private void handleFailure(InvocationException e) { |
|
326 |
++ // There is no good way to see the OOME diagnostic message in the target since the |
|
327 |
++ // TestScaffold might throw an exception while trying to print the stack trace. I.e |
|
328 |
++ // it might get a a VMDisconnectedException before the stack trace printing finishes. |
|
329 |
++ System.err.println("FAILURE: InvocationException caused by OOM"); |
|
330 |
++ defaultHandleOOMFailure(e); |
|
331 |
++ } |
|
332 |
++ |
|
333 |
++ private void defaultHandleOOMFailure(Exception e) { |
|
334 |
++ e.printStackTrace(); |
|
335 |
++ failure(); |
|
336 |
++ } |
|
337 |
++ |
|
338 |
++ @SuppressWarnings({ "rawtypes", "unchecked" }) |
|
339 |
++ void invoke(String methodName, String methodSig, Value value) |
|
340 |
++ throws Exception { |
|
341 |
++ List args = new ArrayList(1); |
|
342 |
++ args.add(value); |
|
343 |
++ invoke(methodName, methodSig, args, value); |
|
344 |
++ } |
|
345 |
++ |
|
346 |
++ void invoke(String methodName, |
|
347 |
++ String methodSig, |
|
348 |
++ @SuppressWarnings("rawtypes") List args, |
|
349 |
++ Value value) throws Exception { |
|
350 |
++ Method method = findMethod(targetClass, methodName, methodSig); |
|
351 |
++ if ( method == null) { |
|
352 |
++ failure("FAILED: Can't find method: " |
|
353 |
++ + methodName + " for class = " + targetClass); |
|
354 |
++ return; |
|
355 |
++ } |
|
356 |
++ invoke(method, args, value); |
|
357 |
++ } |
|
358 |
++ |
|
359 |
++ @SuppressWarnings({ "rawtypes", "unchecked" }) |
|
360 |
++ void invoke(Method method, List args, Value value) throws Exception { |
|
361 |
++ thisObject.invokeMethod(mainThread, method, args, 0); |
|
362 |
++ System.out.println("DEBUG: Done invoking method via debugger."); |
|
363 |
++ } |
|
364 |
++ |
|
365 |
++ Value fieldValue(String fieldName) { |
|
366 |
++ Field field = targetClass.fieldByName(fieldName); |
|
367 |
++ return thisObject.getValue(field); |
|
368 |
++ } |
|
369 |
++ |
|
370 |
++ public static void main(String[] args) throws Exception { |
|
371 |
++ OomDebugTest oomTest = new OomDebugTest(args); |
|
372 |
++ oomTest.startTests(); |
|
373 |
++ if (oomTest.failedTests > 0) { |
|
374 |
++ throw new RuntimeException(oomTest.failedTests |
|
375 |
++ + " of " + TOTAL_TESTS + " test(s) failed."); |
|
376 |
++ } |
|
377 |
++ System.out.println("All " + TOTAL_TESTS + " tests passed."); |
|
378 |
++ } |
|
379 |
++ |
|
380 |
++} |
|
381 |
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
382 |
+@@ -0,0 +1,46 @@ |
|
383 |
++#!/bin/sh |
|
384 |
++# |
|
385 |
++# Copyright (c) 2016 Red Hat Inc. |
|
386 |
++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
387 |
++# |
|
388 |
++# This code is free software; you can redistribute it and/or modify it |
|
389 |
++# under the terms of the GNU General Public License version 2 only, as |
|
390 |
++# published by the Free Software Foundation. |
|
391 |
++# |
|
392 |
++# This code is distributed in the hope that it will be useful, but WITHOUT |
|
393 |
++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
394 |
++# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
395 |
++# version 2 for more details (a copy is included in the LICENSE file that |
|
396 |
++# accompanied this code). |
|
397 |
++# |
|
398 |
++# You should have received a copy of the GNU General Public License version |
|
399 |
++# 2 along with this work; if not, write to the Free Software Foundation, |
|
400 |
++# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
401 |
++# |
|
402 |
++# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
403 |
++# or visit www.oracle.com if you need additional information or have any |
|
404 |
++# questions. |
|
405 |
++# |
|
406 |
++ |
|
407 |
++ |
|
408 |
++if [ "${TESTSRC}" = "" ] |
|
409 |
++then |
|
410 |
++ echo "TESTSRC not set. Test cannot execute. Failed." |
|
411 |
++ exit 1 |
|
412 |
++fi |
|
413 |
++echo "TESTSRC=${TESTSRC}" |
|
414 |
++ |
|
415 |
++if [ "${TESTJAVA}" = "" ] |
|
416 |
++then |
|
417 |
++ echo "TESTJAVA not set. Test cannot execute. Failed." |
|
418 |
++ exit 1 |
|
419 |
++fi |
|
420 |
++echo "TESTJAVA=${TESTJAVA}" |
|
421 |
++ |
|
422 |
++if [ "${TESTCLASSES}" = "" ] |
|
423 |
++then |
|
424 |
++ echo "TESTCLASSES not set. Test cannot execute. Failed." |
|
425 |
++ exit 1 |
|
426 |
++fi |
|
427 |
++ |
|
428 |
++cp ${TESTSRC}/@debuggeeVMOptions ${TESTCLASSES}/ |
0 | 429 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,53 @@ |
0 |
+diff -r 6b81fd2227d1 -r 3334efeacd83 src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java |
|
1 |
+--- a/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java Fri Apr 01 05:33:37 2016 +0100 |
|
2 |
+@@ -174,15 +174,20 @@ |
|
3 |
+ storeFile = new File(storeFileName); |
|
4 |
+ fis = getFileInputStream(storeFile); |
|
5 |
+ } else { |
|
6 |
+- String javaHome = props.get("javaHome"); |
|
7 |
+- storeFile = new File(javaHome + sep + "lib" + sep |
|
8 |
+- + "security" + sep + |
|
9 |
+- "jssecacerts"); |
|
10 |
++ /* Check system cacerts DB first; /etc/pki/java/cacerts */ |
|
11 |
++ storeFile = new File(sep + "etc" + sep + "pki" + sep |
|
12 |
++ + "java" + sep + "cacerts"); |
|
13 |
+ if ((fis = getFileInputStream(storeFile)) == null) { |
|
14 |
++ String javaHome = props.get("javaHome"); |
|
15 |
+ storeFile = new File(javaHome + sep + "lib" + sep |
|
16 |
+- + "security" + sep + |
|
17 |
+- "cacerts"); |
|
18 |
+- fis = getFileInputStream(storeFile); |
|
19 |
++ + "security" + sep + |
|
20 |
++ "jssecacerts"); |
|
21 |
++ if ((fis = getFileInputStream(storeFile)) == null) { |
|
22 |
++ storeFile = new File(javaHome + sep + "lib" + sep |
|
23 |
++ + "security" + sep + |
|
24 |
++ "cacerts"); |
|
25 |
++ fis = getFileInputStream(storeFile); |
|
26 |
++ } |
|
27 |
+ } |
|
28 |
+ } |
|
29 |
+ |
|
30 |
+diff -r 6b81fd2227d1 -r 3334efeacd83 src/share/classes/sun/security/tools/KeyStoreUtil.java |
|
31 |
+--- a/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java Fri Apr 01 05:33:37 2016 +0100 |
|
32 |
+@@ -87,9 +87,14 @@ |
|
33 |
+ throws Exception |
|
34 |
+ { |
|
35 |
+ String sep = File.separator; |
|
36 |
+- File file = new File(System.getProperty("java.home") + sep |
|
37 |
+- + "lib" + sep + "security" + sep |
|
38 |
+- + "cacerts"); |
|
39 |
++ /* Check system cacerts DB first; /etc/pki/java/cacerts */ |
|
40 |
++ File file = new File(sep + "etc" + sep + "pki" + sep |
|
41 |
++ + "java" + sep + "cacerts"); |
|
42 |
++ if (!file.exists()) { |
|
43 |
++ file = new File(System.getProperty("java.home") + sep |
|
44 |
++ + "lib" + sep + "security" + sep |
|
45 |
++ + "cacerts"); |
|
46 |
++ } |
|
47 |
+ if (!file.exists()) { |
|
48 |
+ return null; |
|
49 |
+ } |
|
50 |
+ |
0 | 51 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,11 @@ |
0 |
+--- a/jdk/make/CompileNativeLibraries.gmk 2017-04-07 20:06:07.668018356 +0000 |
|
1 |
+@@ -83,7 +83,7 @@ |
|
2 |
+ |
|
3 |
+ include lib/ServiceabilityLibraries.gmk |
|
4 |
+ |
|
5 |
+-include lib/Awt2dLibraries.gmk |
|
6 |
++#include lib/Awt2dLibraries.gmk |
|
7 |
+ |
|
8 |
+ include lib/SoundLibraries.gmk |
|
9 |
+ |
0 | 10 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,13 @@ |
0 |
+diff --git a/src/share/native/sun/java2d/cmm/lcms/cmstypes.c b/src/share/native/sun/java2d/cmm/lcms/cmstypes.c |
|
1 |
+--- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c |
|
2 |
+@@ -1483,7 +1483,7 @@ |
|
3 |
+ if (!_cmsReadUInt32Number(io, &Offset)) goto Error; |
|
4 |
+ |
|
5 |
+ // Check for overflow |
|
6 |
+- if (Offset < (SizeOfHeader + 8)) goto Error; |
|
7 |
++ if ((Offset + Len) > SizeOfTag + :sunglasses: goto Error; |
|
8 |
+ |
|
9 |
+ // True begin of the string |
|
10 |
+ BeginOfThisString = Offset - SizeOfHeader - 8; |
|
11 |
+ |
... | ... |
@@ -1,18 +1,30 @@ |
1 | 1 |
%define _use_internal_dependency_generator 0 |
2 |
+%global security_hardening none |
|
2 | 3 |
Summary: OpenJDK |
3 | 4 |
Name: openjdk |
4 |
-Version: 1.8.0.112 |
|
5 |
-Release: 2%{?dist} |
|
5 |
+Version: 1.8.0.131 |
|
6 |
+Release: 1%{?dist} |
|
6 | 7 |
License: GNU GPL |
7 | 8 |
URL: https://openjdk.java.net |
8 | 9 |
Group: Development/Tools |
9 | 10 |
Vendor: VMware, Inc. |
10 | 11 |
Distribution: Photon |
11 |
-Source0: http://anduin.linuxfromscratch.org/files/BLFS/OpenJDK/OpenJDK-%{version}-x86_64-bin.tar.xz |
|
12 |
-%define sha1 OpenJDK=c14a20158e16a8877940cfa6dbdf0900d4099a4a |
|
13 |
-Source1: macros.java |
|
12 |
+Source0: http://anduin.linuxfromscratch.org/files/BLFS/OpenJDK/openjdk-%{version}.tar.bz2 |
|
13 |
+%define sha1 openjdk=ae01c24fe5247d5aa246a60c0272ba92188a7d55 |
|
14 |
+Source1: macros.java |
|
15 |
+Patch0: disable-awt-lib.patch |
|
16 |
+Patch1: fix-lcms.patch |
|
17 |
+Patch2: Fix-memory-leak.patch |
|
18 |
+Patch3: check-system-ca-certs.patch |
|
19 |
+BuildRequires: pcre-devel |
|
20 |
+BuildRequires: which |
|
21 |
+BuildRequires: zip |
|
22 |
+BuildRequires: unzip |
|
23 |
+BuildRequires: zlib-devel |
|
24 |
+BuildRequires: ca-certificates |
|
14 | 25 |
Requires: openjre = %{version}-%{release} |
15 | 26 |
AutoReqProv: no |
27 |
+%define bootstrapjdkversion 1.8.0.112 |
|
16 | 28 |
%description |
17 | 29 |
The OpenJDK package installs java class library and javac java compiler. |
18 | 30 |
|
... | ... |
@@ -46,16 +58,52 @@ This package provides the runtime library class sources. |
46 | 46 |
Requires: %{name} = %{version}-%{release} |
47 | 47 |
|
48 | 48 |
%prep -p exit |
49 |
-%setup -qn OpenJDK-%{version}-x86_64-bin |
|
49 |
+%setup -q -n openjdk |
|
50 |
+%patch0 -p1 |
|
51 |
+%patch1 -p1 |
|
52 |
+%patch2 -p1 |
|
53 |
+%patch3 -p1 |
|
54 |
+ |
|
50 | 55 |
%build |
56 |
+chmod a+x ./configure |
|
57 |
+unset JAVA_HOME && |
|
58 |
+./configure \ |
|
59 |
+ FREETYPE_NOT_NEEDED=yes \ |
|
60 |
+ CUPS_NOT_NEEDED=yes \ |
|
61 |
+ --with-target-bits=64 \ |
|
62 |
+ --with-boot-jdk=/var/opt/OpenJDK-%bootstrapjdkversion-bin \ |
|
63 |
+ --enable-headful=no \ |
|
64 |
+ --with-cacerts-file=/var/opt/OpenJDK-%bootstrapjdkversion-bin/jre/lib/security/cacerts \ |
|
65 |
+ --with-extra-cxxflags="-Wno-error -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse" \ |
|
66 |
+ --with-extra-cflags="-std=gnu++98 -fno-delete-null-pointer-checks -Wno-error -fno-lifetime-dse" \ |
|
67 |
+ --with-stdc++lib=dynamic |
|
68 |
+ |
|
69 |
+make \ |
|
70 |
+ DEBUG_BINARIES=true \ |
|
71 |
+ BUILD_HEADLESS_ONLY=yes \ |
|
72 |
+ OPENJDK_TARGET_OS=linux \ |
|
73 |
+ JAVAC_FLAGS=-g \ |
|
74 |
+ STRIP_POLICY=no_strip \ |
|
75 |
+ DISABLE_HOTSPOT_OS_VERSION_CHECK=ok \ |
|
76 |
+ CLASSPATH=/var/opt/OpenJDK-%bootstrapjdkversion-bin/jre \ |
|
77 |
+ POST_STRIP_CMD="" \ |
|
78 |
+ LOG=trace \ |
|
79 |
+ SCTP_WERROR= |
|
51 | 80 |
|
52 | 81 |
%install |
82 |
+make DESTDIR=%{buildroot} install \ |
|
83 |
+ BUILD_HEADLESS_ONLY=yes \ |
|
84 |
+ OPENJDK_TARGET_OS=linux \ |
|
85 |
+ DISABLE_HOTSPOT_OS_VERSION_CHECK=ok \ |
|
86 |
+ CLASSPATH=/var/opt/OpenJDK-%bootstrapjdkversion-bin/jre |
|
87 |
+ |
|
88 |
+install -vdm755 %{buildroot}/var/opt/OpenJDK-%{version}-bin |
|
89 |
+chown -R root:root %{buildroot}/var/opt/OpenJDK-%{version}-bin |
|
90 |
+mkdir -p %{buildroot}/etc/profile.d |
|
53 | 91 |
install -vdm755 %{buildroot}%{_rpmconfigdir}/macros.d |
54 | 92 |
install -m 644 %{SOURCE1} %{buildroot}/%{_rpmconfigdir}/macros.d/ |
55 |
-install -vdm755 %{buildroot}/var/opt/OpenJDK-%{version}-bin |
|
56 |
-mv -v %{_builddir}/OpenJDK-%{version}-x86_64-bin/* %{buildroot}/var/opt/OpenJDK-%{version}-bin/ |
|
57 |
-chown -R root:root %{buildroot}/var/opt/OpenJDK-%{version}-bin |
|
58 | 93 |
install -vdm644 %{buildroot}/etc/profile.d |
94 |
+mv /usr/local/jvm/openjdk-1.8.0-internal/* %{buildroot}/var/opt/OpenJDK-%{version}-bin/ |
|
59 | 95 |
|
60 | 96 |
cat >> %{buildroot}/etc/profile.d/java-exports.sh <<- "EOF" |
61 | 97 |
export CLASSPATH=.:/usr/share/java |
... | ... |
@@ -63,6 +111,11 @@ export JAVA_HOME=/var/opt/OpenJDK-%{version}-bin |
63 | 63 |
export PATH="$PATH:/var/opt/OpenJDK-%{version}-bin/bin:/var/opt/OpenJDK-%{version}-bin/jre/bin" |
64 | 64 |
EOF |
65 | 65 |
|
66 |
+chmod a+x %{buildroot}/etc/profile.d/java-exports.sh |
|
67 |
+ |
|
68 |
+%post |
|
69 |
+source /etc/profile.d/java-exports.sh |
|
70 |
+ |
|
66 | 71 |
%clean |
67 | 72 |
rm -rf %{buildroot}/* |
68 | 73 |
|
... | ... |
@@ -74,7 +127,6 @@ rm -rf %{buildroot}/* |
74 | 74 |
/var/opt/OpenJDK-%{version}-bin/THIRD_PARTY_README |
75 | 75 |
/var/opt/OpenJDK-%{version}-bin/lib |
76 | 76 |
/var/opt/OpenJDK-%{version}-bin/include/ |
77 |
-/var/opt/OpenJDK-%{version}-bin/bin/appletviewer |
|
78 | 77 |
/var/opt/OpenJDK-%{version}-bin/bin/extcheck |
79 | 78 |
/var/opt/OpenJDK-%{version}-bin/bin/idlj |
80 | 79 |
/var/opt/OpenJDK-%{version}-bin/bin/jar |
... | ... |
@@ -98,7 +150,6 @@ rm -rf %{buildroot}/* |
98 | 98 |
/var/opt/OpenJDK-%{version}-bin/bin/jstack |
99 | 99 |
/var/opt/OpenJDK-%{version}-bin/bin/jstat |
100 | 100 |
/var/opt/OpenJDK-%{version}-bin/bin/jstatd |
101 |
-/var/opt/OpenJDK-%{version}-bin/bin/mkcacerts |
|
102 | 101 |
/var/opt/OpenJDK-%{version}-bin/bin/native2ascii |
103 | 102 |
/var/opt/OpenJDK-%{version}-bin/bin/rmic |
104 | 103 |
/var/opt/OpenJDK-%{version}-bin/bin/schemagen |
... | ... |
@@ -116,7 +167,6 @@ rm -rf %{buildroot}/* |
116 | 116 |
/var/opt/OpenJDK-%{version}-bin/bin/keytool |
117 | 117 |
/var/opt/OpenJDK-%{version}-bin/bin/orbd |
118 | 118 |
/var/opt/OpenJDK-%{version}-bin/bin/pack200 |
119 |
-/var/opt/OpenJDK-%{version}-bin/bin/policytool |
|
120 | 119 |
/var/opt/OpenJDK-%{version}-bin/bin/rmid |
121 | 120 |
/var/opt/OpenJDK-%{version}-bin/bin/rmiregistry |
122 | 121 |
/var/opt/OpenJDK-%{version}-bin/bin/servertool |
... | ... |
@@ -140,6 +190,8 @@ rm -rf %{buildroot}/* |
140 | 140 |
/var/opt/OpenJDK-%{version}-bin/src.zip |
141 | 141 |
|
142 | 142 |
%changelog |
143 |
+* Mon Apr 10 2017 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 1.8.0.131-1 |
|
144 |
+- Upgraded to version 1.8.0.131 and building Java from sources |
|
143 | 145 |
* Tue Mar 28 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.8.0.112-2 |
144 | 146 |
- add java rpm macros |
145 | 147 |
* Wed Dec 21 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.8.0.112-1 |
... | ... |
@@ -28,6 +28,7 @@ PHOTON_COMMON_DIR?=$(SRCROOT)/common |
28 | 28 |
PHOTON_DATA_DIR?=$(PHOTON_COMMON_DIR)/data |
29 | 29 |
PHOTON_SRCS_DIR=$(PHOTON_STAGE)/SOURCES |
30 | 30 |
PHOTON_PUBLISH_RPMS_DIR=$(PHOTON_STAGE)/PUBLISHRPMS |
31 |
+PHOTON_PUBLISH_XRPMS_DIR=$(PHOTON_STAGE)/PUBLISHXRPMS |
|
31 | 32 |
PHOTON_GENERATED_DATA_DIR=$(PHOTON_STAGE)/common/data |
32 | 33 |
|
33 | 34 |
PHOTON_PKG_BUILDER_DIR=$(SRCROOT)/support/package-builder |
... | ... |
@@ -41,6 +42,7 @@ PHOTON_SPECDEPS=$(PHOTON_SPECDEPS_DIR)/SpecDeps.py |
41 | 41 |
PHOTON_PACKAGE_BUILDER=$(PHOTON_PKG_BUILDER_DIR)/builder.py |
42 | 42 |
PHOTON_BINTRAY_CONFIG?=$(PHOTON_PKG_BUILDER_DIR)/pullsources.conf |
43 | 43 |
PHOTON_PULL_PUBLISH_RPMS=$(PHOTON_PULL_PUBLISH_RPMS_DIR)/pullpublishrpms.sh |
44 |
+PHOTON_PULL_PUBLISH_X_RPMS=$(PHOTON_PULL_PUBLISH_RPMS_DIR)/pullpublishXrpms.sh |
|
44 | 45 |
PHOTON_CLOUD_IMAGE_BUILDER=$(PHOTON_CLOUD_IMAGE_BUILDER_DIR)/cloud-image-build.sh |
45 | 46 |
|
46 | 47 |
PHOTON_CHROOT_CLEANER=$(PHOTON_PKG_BUILDER_DIR)/clean-up-chroot.py |
... | ... |
@@ -23,7 +23,7 @@ class PackageBuilder(object): |
23 | 23 |
self.listBuildOptionPackages=listBuildOptionPackages |
24 | 24 |
self.pkgBuildOptionFile=pkgBuildOptionFile |
25 | 25 |
|
26 |
- def prepareBuildRoot(self,chrootName): |
|
26 |
+ def prepareBuildRoot(self,chrootName, packageName): |
|
27 | 27 |
chrootID=None |
28 | 28 |
try: |
29 | 29 |
chrUtils = ChrootUtils(self.logName,self.logPath) |
... | ... |
@@ -32,7 +32,7 @@ class PackageBuilder(object): |
32 | 32 |
if not returnVal: |
33 | 33 |
raise Exception("Unable to prepare build root") |
34 | 34 |
tUtils=ToolChainUtils(self.logName,self.logPath) |
35 |
- tUtils.installToolChainRPMS(chrootID) |
|
35 |
+ tUtils.installToolChainRPMS(chrootID, packageName) |
|
36 | 36 |
except Exception as e: |
37 | 37 |
if chrootID is not None: |
38 | 38 |
self.logger.debug("Deleting chroot: " + chrootID) |
... | ... |
@@ -99,7 +99,7 @@ class PackageBuilder(object): |
99 | 99 |
chrootName="build-"+package |
100 | 100 |
chrootID=None |
101 | 101 |
try: |
102 |
- chrootID = self.prepareBuildRoot(chrootName) |
|
102 |
+ chrootID = self.prepareBuildRoot(chrootName, package) |
|
103 | 103 |
destLogPath=constants.logPath+"/build-"+package |
104 | 104 |
if not os.path.isdir(destLogPath): |
105 | 105 |
cmdUtils = CommandUtils() |
... | ... |
@@ -92,7 +92,7 @@ class ToolChainUtils(object): |
92 | 92 |
if not returnVal: |
93 | 93 |
self.logger.error("Creating chroot failed") |
94 | 94 |
raise Exception("creating chroot failed") |
95 |
- self.installToolChainRPMS(chrootID) |
|
95 |
+ self.installToolChainRPMS(chrootID, package) |
|
96 | 96 |
pkgUtils.adjustGCCSpecs(package, chrootID, destLogPath) |
97 | 97 |
pkgUtils.buildRPMSForGivenPackage(package, chrootID, listBuildOptionPackages, pkgBuildOptionFile, destLogPath) |
98 | 98 |
chrUtils.destroyChroot(chrootID) |
... | ... |
@@ -106,7 +106,7 @@ class ToolChainUtils(object): |
106 | 106 |
traceback.print_exc() |
107 | 107 |
raise e |
108 | 108 |
|
109 |
- def installToolChainRPMS(self,chrootID): |
|
109 |
+ def installToolChainRPMS(self,chrootID, packageName): |
|
110 | 110 |
cmdUtils = CommandUtils() |
111 | 111 |
self.prepareBuildRoot(chrootID) |
112 | 112 |
self.logger.info("Installing Tool Chain RPMS.......") |
... | ... |
@@ -136,6 +136,30 @@ class ToolChainUtils(object): |
136 | 136 |
if retval != 0: |
137 | 137 |
self.logger.error("Installing tool chain failed") |
138 | 138 |
raise Exception("RPM installation failed") |
139 |
- |
|
140 |
- self.logger.info("Successfully installed all Tool Chain RPMS in Chroot:"+chrootID) |
|
141 |
- |
|
139 |
+ self.logger.info("Successfully installed all Tool Chain RPMS in Chroot:"+chrootID) |
|
140 |
+ if "openjdk" in packageName or "openjre" in packageName: |
|
141 |
+ self.installToolChainXRPMS(chrootID); |
|
142 |
+ |
|
143 |
+ def installToolChainXRPMS(self, chrootID): |
|
144 |
+ self.logger.info("Installing Tool Chain X package RPMS.......") |
|
145 |
+ rpmFiles = "" |
|
146 |
+ packages = "" |
|
147 |
+ for package in constants.listToolChainXRPMsToInstall: |
|
148 |
+ pkgUtils=PackageUtils(self.logName,self.logPath) |
|
149 |
+ print "DEBUG:" + package |
|
150 |
+ rpmFile=self.findRPMFileInGivenLocation(package, constants.prevPublishXRPMRepo) |
|
151 |
+ if rpmFile is None: |
|
152 |
+ self.logger.error("Unable to find rpm "+ package +" in current and previous versions") |
|
153 |
+ raise Exception("Input Error") |
|
154 |
+ rpmFiles += " " + rpmFile |
|
155 |
+ packages += " " + package |
|
156 |
+ |
|
157 |
+ self.logger.debug("Installing rpms:"+packages) |
|
158 |
+ cmd=self.rpmCommand + " -i --nodeps --force --root "+chrootID+" --define \'_dbpath /var/lib/rpm\' "+ rpmFiles |
|
159 |
+ print "Command Executed:" + cmd |
|
160 |
+ process = subprocess.Popen("%s" %cmd,shell=True,stdout=subprocess.PIPE) |
|
161 |
+ retval = process.wait() |
|
162 |
+ if retval != 0: |
|
163 |
+ self.logger.error("Installing tool chain failed") |
|
164 |
+ raise Exception("RPM installation failed") |
|
165 |
+ self.logger.info("Successfully installed all Tool Chain X RPMS") |
... | ... |
@@ -22,6 +22,7 @@ def main(): |
22 | 22 |
parser.add_argument("-r", "--rpm-path", dest="rpmPath", default="../../stage/RPMS") |
23 | 23 |
parser.add_argument("-i", "--install-package", dest="installPackage", default=False, action ="store_true") |
24 | 24 |
parser.add_argument("-p", "--publish-RPMS-path", dest="publishRPMSPath", default="../../stage/PUBLISHRPMS") |
25 |
+ parser.add_argument("-e", "--publish-XRPMS-path", dest="publishXRPMSPath", default="../../stage/PUBLISHXRPMS") |
|
25 | 26 |
parser.add_argument("-l", "--log-path", dest="logPath", default="../../stage/LOGS") |
26 | 27 |
parser.add_argument("-z", "--top-dir-path", dest="topDirPath", default="/usr/src/photon") |
27 | 28 |
parser.add_argument("-b", "--build-root-path", dest="buildRootPath", default="/mnt") |
... | ... |
@@ -58,18 +59,26 @@ def main(): |
58 | 58 |
if not os.path.isdir(options.publishRPMSPath): |
59 | 59 |
logger.error("Given RPMS Path is not a directory:"+options.publishRPMSPath) |
60 | 60 |
errorFlag = True |
61 |
+ if not os.path.isdir(options.publishXRPMSPath): |
|
62 |
+ logger.error("Given X RPMS Path is not a directory:"+options.publishXRPMSPath) |
|
63 |
+ errorFlag = True |
|
61 | 64 |
if not os.path.isdir(options.publishRPMSPath+"/x86_64"): |
62 | 65 |
logger.error("Given RPMS Path is missing x86_64 sub-directory:"+options.publishRPMSPath) |
63 | 66 |
errorFlag = True |
67 |
+ if not os.path.isdir(options.publishXRPMSPath+"/x86_64"): |
|
68 |
+ logger.error("Given X RPMS Path is missing x86_64 sub-directory:"+options.publishXRPMSPath) |
|
69 |
+ errorFlag = True |
|
64 | 70 |
if not os.path.isdir(options.publishRPMSPath+"/noarch"): |
65 | 71 |
logger.error("Given RPMS Path is missing noarch sub-directory:"+options.publishRPMSPath) |
66 | 72 |
errorFlag = True |
67 |
- |
|
73 |
+ if not os.path.isdir(options.publishXRPMSPath+"/noarch"): |
|
74 |
+ logger.error("Given X RPMS Path is missing noarch sub-directory:"+options.publishXRPMSPath) |
|
75 |
+ errorFlag = True |
|
68 | 76 |
if not os.path.isfile(options.pkgBuildOptionFile): |
69 | 77 |
logger.warning("Given JSON File is not a file:"+options.pkgBuildOptionFile) |
70 | 78 |
|
71 | 79 |
if options.inputRPMSPath is not None and not os.path.isdir(options.inputRPMSPath): |
72 |
- logger.error("Given input RPMS Path is not a directory:"+options.publishRPMSPath) |
|
80 |
+ logger.error("Given input RPMS Path is not a directory:"+options.inputRPMSPath) |
|
73 | 81 |
errorFlag = True |
74 | 82 |
|
75 | 83 |
if options.installPackage : |
... | ... |
@@ -100,6 +109,7 @@ def main(): |
100 | 100 |
logger.info("Log Path :" + options.logPath) |
101 | 101 |
logger.info("Top Dir Path :" + options.topDirPath) |
102 | 102 |
logger.info("Publish RPMS Path :" + options.publishRPMSPath) |
103 |
+ logger.info("Publish X RPMS Path :" + options.publishXRPMSPath) |
|
103 | 104 |
|
104 | 105 |
if options.installPackage: |
105 | 106 |
logger.info("Package to build:"+package) |
... | ... |
@@ -13,6 +13,7 @@ class constants(object): |
13 | 13 |
specData=None |
14 | 14 |
buildRootPath="/mnt" |
15 | 15 |
prevPublishRPMRepo="" |
16 |
+ prevPublishXRPMRepo="" |
|
16 | 17 |
pullsourcesConfig="" |
17 | 18 |
buildPatch=False |
18 | 19 |
inputRPMSPath="" |
... | ... |
@@ -193,6 +194,47 @@ class constants(object): |
193 | 193 |
"cpio", |
194 | 194 |
"go"] |
195 | 195 |
|
196 |
+ # List of X library RPMS that will be installed in a chroot prior to build openjdk & openjre package. |
|
197 |
+ listToolChainXRPMsToInstall=[ |
|
198 |
+ "glib-devel", |
|
199 |
+ "icu-devel", |
|
200 |
+ "openjdk", |
|
201 |
+ "openjre", |
|
202 |
+ "icu", |
|
203 |
+ "harfbuzz", |
|
204 |
+ "harfbuzz-devel", |
|
205 |
+ "freetype2", |
|
206 |
+ "freetype2-devel", |
|
207 |
+ "alsa-lib", |
|
208 |
+ "alsa-lib-devel", |
|
209 |
+ "xcb-proto", |
|
210 |
+ "libXdmcp-devel", |
|
211 |
+ "libXau-devel", |
|
212 |
+ "util-macros", |
|
213 |
+ "xtrans", |
|
214 |
+ "libxcb-devel", |
|
215 |
+ "fontconfig-devel", |
|
216 |
+ "proto", |
|
217 |
+ "libXdmcp", |
|
218 |
+ "libxcb", |
|
219 |
+ "libXau", |
|
220 |
+ "fontconfig", |
|
221 |
+ "xtrans-devel", |
|
222 |
+ "libX11", |
|
223 |
+ "libX11-devel", |
|
224 |
+ "libXext", |
|
225 |
+ "libXext-devel", |
|
226 |
+ "libICE-devel", |
|
227 |
+ "libSM", |
|
228 |
+ "libICE", |
|
229 |
+ "libSM-devel", |
|
230 |
+ "libXt", |
|
231 |
+ "libXmu", |
|
232 |
+ "libXt-devel", |
|
233 |
+ "libXmu-devel", |
|
234 |
+ "libXrender", |
|
235 |
+ "libXrender-devel" |
|
236 |
+ ] |
|
196 | 237 |
# List of RPMs which are not published. They will be created during the |
197 | 238 |
# build process |
198 | 239 |
listOfRPMsProvidedAfterBuild=[ |
... | ... |
@@ -266,7 +308,8 @@ class constants(object): |
266 | 266 |
constants.sourceRpmPath = options.sourceRpmPath |
267 | 267 |
constants.topDirPath = options.topDirPath |
268 | 268 |
constants.logPath = options.logPath |
269 |
- constants.prevPublishRPMRepo=options.publishRPMSPath |
|
269 |
+ constants.prevPublishRPMRepo = options.publishRPMSPath |
|
270 |
+ constants.prevPublishXRPMRepo = options.publishXRPMSPath |
|
270 | 271 |
constants.buildRootPath=options.buildRootPath |
271 | 272 |
constants.specData = SerializableSpecObjectsUtils(constants.logPath) |
272 | 273 |
constants.specData.readSpecsAndConvertToSerializableObjects(constants.specPath) |
273 | 274 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,18 @@ |
0 |
+#!/bin/bash |
|
1 |
+################################################# |
|
2 |
+# Title: pullpublishxrpms.sh # |
|
3 |
+# Date: 04-10-2017 # |
|
4 |
+# Version: 1.0 # |
|
5 |
+# Author: hudaiyakumar@vmware.com # |
|
6 |
+################################################# |
|
7 |
+ |
|
8 |
+PRGNAME=${0##*/} |
|
9 |
+ |
|
10 |
+if [ $# -lt 1 ]; then |
|
11 |
+ echo "${PRGNAME}: No publish rpms path and log path are specified. Usage : ${PRGNAME} <publish-rpms-path>" |
|
12 |
+ exit 1 |
|
13 |
+fi |
|
14 |
+ |
|
15 |
+PUBLISHRPMSPATHDIR=$1 |
|
16 |
+ |
|
17 |
+cat xrpmfilelist | awk '{print "https://bintray.com/artifact/download/vmware/photon_publish_x_rpms/"$1}' | xargs -n 1 -P 10 wget --user-agent Mozilla/4.0 -c -nv -nc -r -nH --cut-dirs=4 -P ${PUBLISHRPMSPATHDIR} |
0 | 18 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,39 @@ |
0 |
+noarch/proto-7.7-1.noarch.rpm |
|
1 |
+noarch/util-macros-1.19.0-1.noarch.rpm |
|
2 |
+x86_64/openjdk-1.8.0.112-1.x86_64.rpm |
|
3 |
+x86_64/openjre-1.8.0.112-1.x86_64.rpm |
|
4 |
+x86_64/alsa-lib-1.0.29-1.x86_64.rpm |
|
5 |
+x86_64/alsa-lib-devel-1.0.29-1.x86_64.rpm |
|
6 |
+x86_64/fontconfig-2.11.1-1.x86_64.rpm |
|
7 |
+x86_64/fontconfig-devel-2.11.1-1.x86_64.rpm |
|
8 |
+x86_64/freetype2-2.5.5-1.x86_64.rpm |
|
9 |
+x86_64/freetype2-devel-2.5.5-1.x86_64.rpm |
|
10 |
+x86_64/glib-2.48.2-1.ph1.x86_64.rpm |
|
11 |
+x86_64/glib-devel-2.48.2-1.ph1.x86_64.rpm |
|
12 |
+x86_64/harfbuzz-0.9.40-1.x86_64.rpm |
|
13 |
+x86_64/harfbuzz-devel-0.9.40-1.x86_64.rpm |
|
14 |
+x86_64/icu-55.1-1.x86_64.rpm |
|
15 |
+x86_64/icu-devel-55.1-1.x86_64.rpm |
|
16 |
+x86_64/libICE-1.0.9-1.x86_64.rpm |
|
17 |
+x86_64/libICE-devel-1.0.9-1.x86_64.rpm |
|
18 |
+x86_64/libSM-1.2.2-1.x86_64.rpm |
|
19 |
+x86_64/libSM-devel-1.2.2-1.x86_64.rpm |
|
20 |
+x86_64/libX11-1.6.3-1.x86_64.rpm |
|
21 |
+x86_64/libX11-devel-1.6.3-1.x86_64.rpm |
|
22 |
+x86_64/libXau-1.0.8-1.x86_64.rpm |
|
23 |
+x86_64/libXau-devel-1.0.8-1.x86_64.rpm |
|
24 |
+x86_64/libXdmcp-1.1.2-1.x86_64.rpm |
|
25 |
+x86_64/libXdmcp-devel-1.1.2-1.x86_64.rpm |
|
26 |
+x86_64/libXext-1.3.3-1.x86_64.rpm |
|
27 |
+x86_64/libXext-devel-1.3.3-1.x86_64.rpm |
|
28 |
+x86_64/libXmu-1.1.2-1.x86_64.rpm |
|
29 |
+x86_64/libXmu-devel-1.1.2-1.x86_64.rpm |
|
30 |
+x86_64/libXrender-0.9.8-1.x86_64.rpm |
|
31 |
+x86_64/libXrender-devel-0.9.8-1.x86_64.rpm |
|
32 |
+x86_64/libXt-1.1.4-1.x86_64.rpm |
|
33 |
+x86_64/libXt-devel-1.1.4-1.x86_64.rpm |
|
34 |
+x86_64/libxcb-1.11-1.x86_64.rpm |
|
35 |
+x86_64/libxcb-devel-1.11-1.x86_64.rpm |
|
36 |
+x86_64/xcb-proto-1.11-1.x86_64.rpm |
|
37 |
+x86_64/xtrans-1.3.5-1.x86_64.rpm |
|
38 |
+x86_64/xtrans-devel-1.3.5-1.x86_64.rpm |