mirror of
https://github.com/Basilisk-Development-Team/UXP-mirror.git
synced 2026-11-04 17:00:06 -05:00
Compare commits
655
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44d17e4ee7 | ||
|
|
26cc7c3126 | ||
|
|
cea1b66ba5 | ||
|
|
948559c22c | ||
|
|
5d7a1ca5a9 | ||
|
|
613443c5eb | ||
|
|
d7884bb96c | ||
|
|
fc25f50e5f | ||
|
|
b70b3a5aa1 | ||
|
|
88ae39ed04 | ||
|
|
d893526f82 | ||
|
|
4d5b1cc5d8 | ||
|
|
0e521f6302 | ||
|
|
9cacfcff57 | ||
|
|
21ad7adc90 | ||
|
|
9a29430751 | ||
|
|
481d4868b0 | ||
|
|
d148c11717 | ||
|
|
bc322e58f8 | ||
|
|
e48a6f26a5 | ||
|
|
d85edd01df | ||
|
|
296379d751 | ||
|
|
7ba9fc2801 | ||
|
|
a9ac8b390f | ||
|
|
71c0f8246c | ||
|
|
6cda35442f | ||
|
|
1dba423327 | ||
|
|
e2af0b28bf | ||
|
|
5ea9b7b80a | ||
|
|
b799e100ad | ||
|
|
1c500a6abb | ||
|
|
b909fccc92 | ||
|
|
abddee43b4 | ||
|
|
49d184e550 | ||
|
|
3e223cbfb4 | ||
|
|
7341809f67 | ||
|
|
dd9099a7d3 | ||
|
|
31558a1521 | ||
|
|
0e683bf699 | ||
|
|
6459dec5bb | ||
|
|
0e930fba3f | ||
|
|
3b683bbe59 | ||
|
|
0042e54c38 | ||
|
|
e75201f7d1 | ||
|
|
28c47723b2 | ||
|
|
3d872ff7b0 | ||
|
|
beb684c29e | ||
|
|
775588b75d | ||
|
|
8a2a5d837c | ||
|
|
8add755c81 | ||
|
|
257c64567e | ||
|
|
d0b61d4a68 | ||
|
|
3b5f50cc35 | ||
|
|
27c6a7f477 | ||
|
|
c65f84214e | ||
|
|
a317c65fd7 | ||
|
|
0ec35ce534 | ||
|
|
bf0c040722 | ||
|
|
ebadd51401 | ||
|
|
5ed0bf8b44 | ||
|
|
f877c1dba5 | ||
|
|
4c14f8f89b | ||
|
|
c119728965 | ||
|
|
fa55b9c2e8 | ||
|
|
16aba76fc5 | ||
|
|
995def99cd | ||
|
|
923e52789c | ||
|
|
22d945430b | ||
|
|
65d7d93760 | ||
|
|
dfd0ea4e8a | ||
|
|
12a49709cb | ||
|
|
2a70c8a6f0 | ||
|
|
1f639d78ca | ||
|
|
65e8245153 | ||
|
|
bce5dbad0b | ||
|
|
0b25b5f8db | ||
|
|
7345874098 | ||
|
|
edb82fd1c9 | ||
|
|
35ebdcac66 | ||
|
|
a095661e86 | ||
|
|
205a0d66bb | ||
|
|
54945a0808 | ||
|
|
84c1eedac6 | ||
|
|
ddf5d6256e | ||
|
|
0eae777fd0 | ||
|
|
b2594a4ace | ||
|
|
ce61835a81 | ||
|
|
30e29845c4 | ||
|
|
d8662c5dd9 | ||
|
|
8a2a9ead92 | ||
|
|
efdbd34b0b | ||
|
|
d2fa69f593 | ||
|
|
18d0a1a525 | ||
|
|
0a5e50a9fe | ||
|
|
3f5b7ed020 | ||
|
|
9d9802c660 | ||
|
|
27c579652a | ||
|
|
8ffa6b3c13 | ||
|
|
83f6efc33d | ||
|
|
47f1928610 | ||
|
|
7b3d961465 | ||
|
|
22b2e18d91 | ||
|
|
f6c9c0c59f | ||
|
|
d8c9d24a9c | ||
|
|
a466b73267 | ||
|
|
1ce14fb014 | ||
|
|
8bbf60fb38 | ||
|
|
f2d7c02290 | ||
|
|
65ddfc21b6 | ||
|
|
163619de60 | ||
|
|
29c4d554a0 | ||
|
|
3e59569d0b | ||
|
|
fb8483407b | ||
|
|
ec8b7f86d0 | ||
|
|
9899d59010 | ||
|
|
789e976ace | ||
|
|
d5bf2555a3 | ||
|
|
be672813f6 | ||
|
|
746a7be08c | ||
|
|
c222ee80fa | ||
|
|
4950bd038d | ||
|
|
058336a071 | ||
|
|
6823388a85 | ||
|
|
b68d097eb6 | ||
|
|
21743e0b7c | ||
|
|
c97a22776d | ||
|
|
c484dbcca5 | ||
|
|
54f15d7afe | ||
|
|
05441188be | ||
|
|
25a2d31be7 | ||
|
|
58a4e0d545 | ||
|
|
ad06b4ce5e | ||
|
|
be3827b088 | ||
|
|
a136aaf502 | ||
|
|
40d91a8eae | ||
|
|
5b81a81ac4 | ||
|
|
328ddb2927 | ||
|
|
06b9622302 | ||
|
|
1218649202 | ||
|
|
cbea8f5a53 | ||
|
|
f42e644486 | ||
|
|
a40490b946 | ||
|
|
ad98693f3d | ||
|
|
7b4aaca975 | ||
|
|
400e59a96d | ||
|
|
09276b72a6 | ||
|
|
ec18304362 | ||
|
|
4cf411f393 | ||
|
|
a0f135b94f | ||
|
|
3be679effc | ||
|
|
2d91c80555 | ||
|
|
e5326c1d74 | ||
|
|
5ddccdc7f6 | ||
|
|
8dc41b293a | ||
|
|
f02956a324 | ||
|
|
e3646af419 | ||
|
|
ee1f2e31a1 | ||
|
|
dcb90d6f92 | ||
|
|
f9cdc54e09 | ||
|
|
28be7ae6e0 | ||
|
|
463e7ec3c6 | ||
|
|
531eeaabaa | ||
|
|
af92afbd6c | ||
|
|
5005a47921 | ||
|
|
72d4ca2b35 | ||
|
|
b8951dbc2a | ||
|
|
20c92e63c5 | ||
|
|
ea785c3bb0 | ||
|
|
7abc11b3d1 | ||
|
|
2a4c4687c6 | ||
|
|
de3970d9b4 | ||
|
|
4da8c1fe4c | ||
|
|
8230f9b359 | ||
|
|
310fec9ad5 | ||
|
|
5f2040153b | ||
|
|
30a774eb08 | ||
|
|
e8ee09b41f | ||
|
|
5fc626f0fc | ||
|
|
c87c0e440b | ||
|
|
39b34ed8c5 | ||
|
|
e6b4a84e7e | ||
|
|
f7dfc278c4 | ||
|
|
13349f484c | ||
|
|
bd2670e006 | ||
|
|
e5bebae2c7 | ||
|
|
d93df7216d | ||
|
|
3d0a6899ce | ||
|
|
fdde68855b | ||
|
|
2d038e6c1a | ||
|
|
c10f8a567b | ||
|
|
dcfa35e1ff | ||
|
|
de1a7f5fe1 | ||
|
|
2b0935adf4 | ||
|
|
cbdc5fa85f | ||
|
|
2a06c40a09 | ||
|
|
f499e3dd36 | ||
|
|
34d88ac937 | ||
|
|
48d21fa2bf | ||
|
|
c91c69272b | ||
|
|
91f4fa744e | ||
|
|
c2abd4aaa6 | ||
|
|
617ad84f96 | ||
|
|
33b6bfa1b9 | ||
|
|
4e03afd191 | ||
|
|
3512b73bc3 | ||
|
|
d0ac45cb08 | ||
|
|
ab3d950bd3 | ||
|
|
44ddd79356 | ||
|
|
054ddf661f | ||
|
|
da466a3bdd | ||
|
|
42f0c2d78f | ||
|
|
5853784a31 | ||
|
|
5b20295620 | ||
|
|
68e151c2a3 | ||
|
|
dd764a70a2 | ||
|
|
12defe0d12 | ||
|
|
8868dd5785 | ||
|
|
e787d585a4 | ||
|
|
5eb7518ce2 | ||
|
|
5be93da111 | ||
|
|
39a89b708e | ||
|
|
69ad4f1674 | ||
|
|
59ae55a0e2 | ||
|
|
6eb551332e | ||
|
|
96be1bb7a0 | ||
|
|
4dc3b6db93 | ||
|
|
a1da555b51 | ||
|
|
c1abc2eb3e | ||
|
|
f0acda0bf4 | ||
|
|
16212905de | ||
|
|
2eb5e91b62 | ||
|
|
fa6b67c8ac | ||
|
|
6a117bd9d1 | ||
|
|
714c709ad0 | ||
|
|
eafc230ff2 | ||
|
|
523a9aa2de | ||
|
|
ec92c29029 | ||
|
|
4a9d702bc1 | ||
|
|
f363ec1838 | ||
|
|
ffb3a95eb9 | ||
|
|
63094adef4 | ||
|
|
1f8dcf74c8 | ||
|
|
f20c549f66 | ||
|
|
b62cccda62 | ||
|
|
43f3b3c7ee | ||
|
|
a328464912 | ||
|
|
977ddd9e81 | ||
|
|
67717762f9 | ||
|
|
a33f6857fd | ||
|
|
5c7c192df1 | ||
|
|
0186e78221 | ||
|
|
e9e858348b | ||
|
|
631bb15b05 | ||
|
|
e7d6301c75 | ||
|
|
22001fbca3 | ||
|
|
22e3028d56 | ||
|
|
9498ce3f1e | ||
|
|
172c7b6f25 | ||
|
|
750ef67831 | ||
|
|
c19a39c4a5 | ||
|
|
d6bfeeaf1a | ||
|
|
e7ea20c073 | ||
|
|
a7e01b3f77 | ||
|
|
c3a541c55a | ||
|
|
41efdfd488 | ||
|
|
7d41d2a47c | ||
|
|
ec951c592a | ||
|
|
829fd431e2 | ||
|
|
9b7d25d1fd | ||
|
|
1ab3e82a4d | ||
|
|
b07102b821 | ||
|
|
3adf3917ee | ||
|
|
bbaf41e032 | ||
|
|
618c017249 | ||
|
|
3cf7c94995 | ||
|
|
2ca5d21147 | ||
|
|
266cc371f7 | ||
|
|
fba218cff4 | ||
|
|
f33ccb5ce3 | ||
|
|
8ca5438db9 | ||
|
|
8b6414ea7c | ||
|
|
1c09cd7816 | ||
|
|
07b47c8472 | ||
|
|
950a608e01 | ||
|
|
c7f08c7e53 | ||
|
|
4f3857c1ea | ||
|
|
60b4b1ad47 | ||
|
|
8262184873 | ||
|
|
e9abd8b022 | ||
|
|
fe29e0430c | ||
|
|
589967f3df | ||
|
|
9db275d300 | ||
|
|
b6d0a261d2 | ||
|
|
dad0daf389 | ||
|
|
b58e2b9312 | ||
|
|
b8f458a819 | ||
|
|
39321f4796 | ||
|
|
d8de738239 | ||
|
|
40407bb784 | ||
|
|
a5b2671f1e | ||
|
|
4249686af4 | ||
|
|
69ba22d624 | ||
|
|
4359582e67 | ||
|
|
fa06d2de31 | ||
|
|
b7b1918a36 | ||
|
|
aa69d5ec99 | ||
|
|
6e4bb257a4 | ||
|
|
a30f439a9c | ||
|
|
0ccaab55ca | ||
|
|
e61621692c | ||
|
|
9a8cb2e22e | ||
|
|
eb487c2ca1 | ||
|
|
5c0a35a358 | ||
|
|
a468f81a5e | ||
|
|
d1b46d7347 | ||
|
|
3583e443dd | ||
|
|
afc6210b2c | ||
|
|
6fb98414ef | ||
|
|
1268c5055a | ||
|
|
30a1c98c9d | ||
|
|
17b7e131b4 | ||
|
|
7574161abe | ||
|
|
5185da6cf0 | ||
|
|
a5c925df20 | ||
|
|
e794163e05 | ||
|
|
2690911551 | ||
|
|
6cc0c04b5c | ||
|
|
edd0f13910 | ||
|
|
c57f1ec98c | ||
|
|
f757e38c04 | ||
|
|
00ab986cb8 | ||
|
|
cd873c87d5 | ||
|
|
bd3ea8d98d | ||
|
|
865d547992 | ||
|
|
2c4ea0bc88 | ||
|
|
001f950041 | ||
|
|
ca839a4b0f | ||
|
|
807faf43b0 | ||
|
|
2edc704e4f | ||
|
|
becff6c0d2 | ||
|
|
06caa2f30f | ||
|
|
ac0f516a1a | ||
|
|
6d4244e049 | ||
|
|
d5d43c7221 | ||
|
|
3a5950ae65 | ||
|
|
58a00fe63b | ||
|
|
b486a37ba1 | ||
|
|
a1bde368ab | ||
|
|
dc2cb047aa | ||
|
|
a06d5a80a1 | ||
|
|
2dbf5e90d6 | ||
|
|
3259bdc1c1 | ||
|
|
d8fc800bb6 | ||
|
|
2f48cd27d5 | ||
|
|
5da410af19 | ||
|
|
11b676d033 | ||
|
|
68f88c7b49 | ||
|
|
b887dd8f37 | ||
|
|
9be79d5b97 | ||
|
|
ed4b5d4214 | ||
|
|
2aeecda75f | ||
|
|
633de098f8 | ||
|
|
241f9c3965 | ||
|
|
3749fabef9 | ||
|
|
ab6fdd555a | ||
|
|
6dcb20949a | ||
|
|
2ad83109ee | ||
|
|
993f6947d0 | ||
|
|
a0ee7ae1d7 | ||
|
|
140226f9ee | ||
|
|
4729e6299e | ||
|
|
b6a9734757 | ||
|
|
426edd0c41 | ||
|
|
5cc9593b41 | ||
|
|
bd3a1d801a | ||
|
|
007e595a33 | ||
|
|
537bbfa821 | ||
|
|
4b340a1d4d | ||
|
|
8ef06683c6 | ||
|
|
2f1765ef22 | ||
|
|
569f912ffd | ||
|
|
7bd4bfeb06 | ||
|
|
043c98373e | ||
|
|
c02d8f1d61 | ||
|
|
c2aeecbf38 | ||
|
|
3869453bba | ||
|
|
14d2e10576 | ||
|
|
d667906533 | ||
|
|
6b4b7dadb2 | ||
|
|
9f73d5bb49 | ||
|
|
802aebd0dd | ||
|
|
88a7b76bfe | ||
|
|
0164ef4a07 | ||
|
|
cd1e02de12 | ||
|
|
265bdc3076 | ||
|
|
0f54499203 | ||
|
|
cd028bb746 | ||
|
|
1b15cf18d7 | ||
|
|
da0cf2149f | ||
|
|
e079c83629 | ||
|
|
fc489dc3ad | ||
|
|
983e140fbc | ||
|
|
bc826af721 | ||
|
|
ade8a91835 | ||
|
|
7a9e340ba4 | ||
|
|
907d5eb3a0 | ||
|
|
9ae455ac7d | ||
|
|
ac2c809f8c | ||
|
|
86d942f9b5 | ||
|
|
0581d130fe | ||
|
|
5e74610f98 | ||
|
|
2710214767 | ||
|
|
efd34d3137 | ||
|
|
e051599073 | ||
|
|
002b1d928e | ||
|
|
79aa36ef10 | ||
|
|
1842de878f | ||
|
|
81cc4e7d9e | ||
|
|
0d69bdc104 | ||
|
|
eb235f0675 | ||
|
|
2729d6cae9 | ||
|
|
da3b8fc623 | ||
|
|
58f6eb679b | ||
|
|
e4db1b8fdc | ||
|
|
6f68647251 | ||
|
|
867bd1549b | ||
|
|
bb3275468d | ||
|
|
bfc67972ed | ||
|
|
c04c33e327 | ||
|
|
a64033be06 | ||
|
|
1805114b8b | ||
|
|
d0465ae9e5 | ||
|
|
533b487b3b | ||
|
|
7899aa0e49 | ||
|
|
2ac6f05047 | ||
|
|
6bd4859ef6 | ||
|
|
120f8bebe4 | ||
|
|
84a3ff050c | ||
|
|
b822fda771 | ||
|
|
3e38744f8b | ||
|
|
ffeaec8710 | ||
|
|
bbeb397619 | ||
|
|
0e0e2eed28 | ||
|
|
0541bf3363 | ||
|
|
8c677506b2 | ||
|
|
d77bac2b73 | ||
|
|
4f8122c97c | ||
|
|
7db3518bcb | ||
|
|
509b1c9c9d | ||
|
|
ceb04b11aa | ||
|
|
1fb0e5ad2e | ||
|
|
0d778af5a1 | ||
|
|
1983e6dc6e | ||
|
|
851cfe1a41 | ||
|
|
86cbf4a9f3 | ||
|
|
af8cda32de | ||
|
|
6b9f39b933 | ||
|
|
ac7a61a9be | ||
|
|
017cc7ef84 | ||
|
|
72b2c2c555 | ||
|
|
aec1c42d17 | ||
|
|
a84dbb6281 | ||
|
|
951c54835b | ||
|
|
142dca26f4 | ||
|
|
6f74b59900 | ||
|
|
07c08f37be | ||
|
|
a703325af2 | ||
|
|
acf54dc358 | ||
|
|
edee1158ee | ||
|
|
4f7803881b | ||
|
|
a54d8527c8 | ||
|
|
7ddab852c3 | ||
|
|
ffc4084854 | ||
|
|
367dec14bc | ||
|
|
522b1c58df | ||
|
|
f5c28ff4d6 | ||
|
|
11aa5a7586 | ||
|
|
f3eb80a55b | ||
|
|
5a606f322e | ||
|
|
fb9098d69b | ||
|
|
7e1d721f20 | ||
|
|
55fe29cbb7 | ||
|
|
044736c889 | ||
|
|
875b73823e | ||
|
|
74fc0fc150 | ||
|
|
a4c8f55faf | ||
|
|
8405bea921 | ||
|
|
feda33fbec | ||
|
|
741112d29c | ||
|
|
afe857516d | ||
|
|
101c6c1ca8 | ||
|
|
6d70806439 | ||
|
|
6aed69f637 | ||
|
|
fc8ca12118 | ||
|
|
15faf0c3c6 | ||
|
|
a16543eb90 | ||
|
|
eaf6665b70 | ||
|
|
9907fca0bb | ||
|
|
145748d74c | ||
|
|
885aeb2ffa | ||
|
|
0eac54b24e | ||
|
|
f4fbed884b | ||
|
|
a4b7b7473f | ||
|
|
4fdaa6a05a | ||
|
|
cfe4a5e353 | ||
|
|
561002daa4 | ||
|
|
9a5b0e8fef | ||
|
|
7da9a8d988 | ||
|
|
373ada7321 | ||
|
|
8ebd469720 | ||
|
|
481c255726 | ||
|
|
3d790dfa0b | ||
|
|
4bd6812d9c | ||
|
|
98514f7e45 | ||
|
|
b822fa9d33 | ||
|
|
336c03ff42 | ||
|
|
5e7320f939 | ||
|
|
0ea174bd02 | ||
|
|
4fbecf0e50 | ||
|
|
48eee536a3 | ||
|
|
010f09bf1e | ||
|
|
771f5dccd5 | ||
|
|
18a693a8ab | ||
|
|
e10d75b7c2 | ||
|
|
fd62e7eb91 | ||
|
|
975e6c2618 | ||
|
|
94ff99c265 | ||
|
|
1e1235d1fb | ||
|
|
9ae59f4312 | ||
|
|
802110305d | ||
|
|
008d2b2b01 | ||
|
|
db451f41d4 | ||
|
|
a00c861f3b | ||
|
|
56035186ff | ||
|
|
73cfb5e9e5 | ||
|
|
9eed22be4f | ||
|
|
11d18319bd | ||
|
|
d07eaa0c68 | ||
|
|
e6f73d578b | ||
|
|
0e825b7a8b | ||
|
|
d3b337c77a | ||
|
|
19b79bef4b | ||
|
|
cfbe413763 | ||
|
|
090242a16e | ||
|
|
53bc735ee9 | ||
|
|
dc92189c0f | ||
|
|
3b0aadb95c | ||
|
|
12ba8bf083 | ||
|
|
71a061f3ea | ||
|
|
c29de91663 | ||
|
|
3be43599e2 | ||
|
|
2f07b7f26e | ||
|
|
b180acefa2 | ||
|
|
0cd75d7bee | ||
|
|
f17894ba65 | ||
|
|
656a76c24e | ||
|
|
20a0b94fbf | ||
|
|
c037f1194f | ||
|
|
5fb569520e | ||
|
|
0054f425d9 | ||
|
|
60a96d9cd2 | ||
|
|
323338eb09 | ||
|
|
d2a4890384 | ||
|
|
56a2627104 | ||
|
|
8811a48b8a | ||
|
|
5f03b88dd3 | ||
|
|
2e18e11f2b | ||
|
|
02ec45c715 | ||
|
|
3b21b1bc49 | ||
|
|
663ec3d230 | ||
|
|
c36a9c674e | ||
|
|
4ff3a75296 | ||
|
|
5871ce0b85 | ||
|
|
6237c680ca | ||
|
|
facdbf7bc0 | ||
|
|
8f54050907 | ||
|
|
2fbe032ee9 | ||
|
|
a8a68383cb | ||
|
|
e3f67c01a2 | ||
|
|
a1fe345c98 | ||
|
|
a1caa316a7 | ||
|
|
1011058248 | ||
|
|
b9842306a4 | ||
|
|
5d63edee09 | ||
|
|
dc9a5cd350 | ||
|
|
017e021c37 | ||
|
|
12641659e6 | ||
|
|
16f351a14c | ||
|
|
80c7d08eee | ||
|
|
a8c59c38d4 | ||
|
|
9bf46d80f1 | ||
|
|
638c7f07f7 | ||
|
|
8e01b2d181 | ||
|
|
235db83ca0 | ||
|
|
160e956ab5 | ||
|
|
2cecbc0e7f | ||
|
|
11226f5308 | ||
|
|
8ff0eb3b1c | ||
|
|
2bb084e824 | ||
|
|
c089567185 | ||
|
|
62397ff43e | ||
|
|
458f60d071 | ||
|
|
63752e83a5 | ||
|
|
033b7f5219 | ||
|
|
9c10d36094 | ||
|
|
19f0115559 | ||
|
|
5188aa4874 | ||
|
|
4e11fab9b4 | ||
|
|
8cb419166a | ||
|
|
e431c0cb13 | ||
|
|
889a1c39c5 | ||
|
|
6c77f329da | ||
|
|
0e0823a4df | ||
|
|
f335e05ff6 | ||
|
|
74762d6567 | ||
|
|
1545a33858 | ||
|
|
1801a9148d | ||
|
|
deff79b573 | ||
|
|
0dbe65d6af | ||
|
|
04e6f86a60 | ||
|
|
214fc9bdfb | ||
|
|
3dd092c8d8 | ||
|
|
cb559a5eb2 | ||
|
|
313dcc69fa | ||
|
|
367505a1b0 | ||
|
|
fb669b392c | ||
|
|
b818d7905a | ||
|
|
827b1052ea | ||
|
|
04b9a2f949 | ||
|
|
d9821226cf | ||
|
|
17e3d48201 | ||
|
|
151ca2805b | ||
|
|
93272b0ac0 | ||
|
|
763e812c4c | ||
|
|
6433d1d7a4 | ||
|
|
ae877638e8 | ||
|
|
e12d6ebd5e | ||
|
|
7abb343363 | ||
|
|
af6ae6a1d3 | ||
|
|
69d2d3f47d | ||
|
|
0ce9d8f121 | ||
|
|
0c61ee391c | ||
|
|
5fdc8dd723 | ||
|
|
5af8e3ba5c | ||
|
|
2f37a44b8f | ||
|
|
6454d7492f | ||
|
|
c77e0a8cec | ||
|
|
46f126c10c | ||
|
|
4906a75883 | ||
|
|
8c0f0ccdcf | ||
|
|
112c119477 | ||
|
|
ec4f21e5e3 | ||
|
|
42fbdd74fd | ||
|
|
49615281cd | ||
|
|
e11fc9b4cf |
No files matched your search
@@ -22,4 +22,4 @@
|
|||||||
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
||||||
# don't change CLOBBER for WebIDL changes any more.
|
# don't change CLOBBER for WebIDL changes any more.
|
||||||
|
|
||||||
Clobber for libvpx changes
|
Clobber for removal of network tickler
|
||||||
+8
-4
@@ -14,7 +14,7 @@ endif
|
|||||||
export TOPLEVEL_BUILD := 1
|
export TOPLEVEL_BUILD := 1
|
||||||
|
|
||||||
default::
|
default::
|
||||||
|
BACKEND_ONCE_STAMP := backend.once.stamp
|
||||||
ifndef TEST_MOZBUILD
|
ifndef TEST_MOZBUILD
|
||||||
ifdef MOZ_BUILD_APP
|
ifdef MOZ_BUILD_APP
|
||||||
include $(wildcard $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk)
|
include $(wildcard $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk)
|
||||||
@@ -46,7 +46,7 @@ ifndef TEST_MOZBUILD
|
|||||||
ifndef MOZ_PROFILE_USE
|
ifndef MOZ_PROFILE_USE
|
||||||
# We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
|
# We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
|
||||||
# rules.mk doesn't run early enough.
|
# rules.mk doesn't run early enough.
|
||||||
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status $(BUILD_BACKEND_FILES)
|
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status $(BACKEND_ONCE_STAMP)
|
||||||
|
|
||||||
# While our mozbuild backend has some kind of crazy install_manfests junk to
|
# While our mozbuild backend has some kind of crazy install_manfests junk to
|
||||||
# try and make this not have to happen, we actually want dist/bin to be
|
# try and make this not have to happen, we actually want dist/bin to be
|
||||||
@@ -100,7 +100,11 @@ config.status js/src/config.status:
|
|||||||
ifndef TEST_MOZBUILD
|
ifndef TEST_MOZBUILD
|
||||||
|
|
||||||
.PHONY: backend
|
.PHONY: backend
|
||||||
backend: $(BUILD_BACKEND_FILES)
|
backend: $(BACKEND_ONCE_STAMP)
|
||||||
|
# Create a per-invocation stamp so backend regenerates only once
|
||||||
|
$(BACKEND_ONCE_STAMP):
|
||||||
|
@echo "Stamping backend regeneration."
|
||||||
|
@$(TOUCH) $@
|
||||||
|
|
||||||
# A traditional rule would look like this:
|
# A traditional rule would look like this:
|
||||||
# backend.%:
|
# backend.%:
|
||||||
@@ -122,7 +126,7 @@ $(subst .,%,$(BUILD_BACKEND_FILES)):
|
|||||||
@echo 'Build configuration changed. Regenerating backend.'
|
@echo 'Build configuration changed. Regenerating backend.'
|
||||||
$(PYTHON) config.status
|
$(PYTHON) config.status
|
||||||
|
|
||||||
Makefile: $(BUILD_BACKEND_FILES)
|
Makefile: $(BACKEND_ONCE_STAMP)
|
||||||
@$(TOUCH) $@
|
@$(TOUCH) $@
|
||||||
|
|
||||||
define build_backend_rule
|
define build_backend_rule
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
TRADEMARK NOTICE
|
||||||
|
================
|
||||||
|
|
||||||
|
The name "Goanna" and visual representations (logo) have not been
|
||||||
|
registered by the Copyright owners as a trademark in any jurisdiction.
|
||||||
|
However, because Goanna has been distributed and maintained world-wide,
|
||||||
|
continually since 2015, the Copyright owners claim "common-law trademark
|
||||||
|
protection" in any jurisdiction where common-law trademark is recognized.
|
||||||
@@ -18,10 +18,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#if (MOZ_WIDGET_GTK == 3)
|
|
||||||
extern "C" __attribute__((weak,visibility("default"))) int atk_bridge_adaptor_init(int*, char **[]);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::a11y;
|
using namespace mozilla::a11y;
|
||||||
|
|
||||||
@@ -33,12 +29,20 @@ extern "C" {
|
|||||||
typedef GType (* AtkGetTypeType) (void);
|
typedef GType (* AtkGetTypeType) (void);
|
||||||
typedef void (*GnomeAccessibilityInit) (void);
|
typedef void (*GnomeAccessibilityInit) (void);
|
||||||
typedef void (*GnomeAccessibilityShutdown) (void);
|
typedef void (*GnomeAccessibilityShutdown) (void);
|
||||||
|
#if (MOZ_WIDGET_GTK == 3)
|
||||||
|
typedef int (*AtkBridgeAdaptorInit) (int*, char***);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static PRLibrary* sATKLib = nullptr;
|
static PRLibrary* sATKLib = nullptr;
|
||||||
static const char sATKLibName[] = "libatk-1.0.so.0";
|
static const char sATKLibName[] = "libatk-1.0.so.0";
|
||||||
static const char sATKHyperlinkImplGetTypeSymbol[] =
|
static const char sATKHyperlinkImplGetTypeSymbol[] =
|
||||||
"atk_hyperlink_impl_get_type";
|
"atk_hyperlink_impl_get_type";
|
||||||
|
#if (MOZ_WIDGET_GTK == 3)
|
||||||
|
static PRLibrary* sAtkBridgeAdaptorLib = nullptr;
|
||||||
|
static const char sAtkBridgeAdaptorLibName[] = "libatk-bridge-2.0.so.0";
|
||||||
|
static const char sAtkBridgeAdaptorInitSymbol[] = "atk_bridge_adaptor_init";
|
||||||
|
#endif
|
||||||
|
|
||||||
gboolean toplevel_event_watcher(GSignalInvocationHint*, guint, const GValue*,
|
gboolean toplevel_event_watcher(GSignalInvocationHint*, guint, const GValue*,
|
||||||
gpointer);
|
gpointer);
|
||||||
@@ -127,6 +131,38 @@ LoadGtkModule(GnomeAccessibilityModule& aModule)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (MOZ_WIDGET_GTK == 3)
|
||||||
|
static bool
|
||||||
|
InitAtkBridgeAdaptor()
|
||||||
|
{
|
||||||
|
AtkBridgeAdaptorInit initBridge =
|
||||||
|
reinterpret_cast<AtkBridgeAdaptorInit>(
|
||||||
|
PR_FindFunctionSymbolAndLibrary(sAtkBridgeAdaptorInitSymbol,
|
||||||
|
&sAtkBridgeAdaptorLib));
|
||||||
|
|
||||||
|
if (!initBridge) {
|
||||||
|
sAtkBridgeAdaptorLib = PR_LoadLibrary(sAtkBridgeAdaptorLibName);
|
||||||
|
if (sAtkBridgeAdaptorLib) {
|
||||||
|
initBridge =
|
||||||
|
reinterpret_cast<AtkBridgeAdaptorInit>(
|
||||||
|
PR_FindFunctionSymbol(sAtkBridgeAdaptorLib,
|
||||||
|
sAtkBridgeAdaptorInitSymbol));
|
||||||
|
if (!initBridge) {
|
||||||
|
PR_UnloadLibrary(sAtkBridgeAdaptorLib);
|
||||||
|
sAtkBridgeAdaptorLib = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!initBridge) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
initBridge(nullptr, nullptr);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
a11y::PlatformInit()
|
a11y::PlatformInit()
|
||||||
{
|
{
|
||||||
@@ -181,9 +217,7 @@ a11y::PlatformInit()
|
|||||||
// Init atk-bridge now
|
// Init atk-bridge now
|
||||||
PR_SetEnv("NO_AT_BRIDGE=0");
|
PR_SetEnv("NO_AT_BRIDGE=0");
|
||||||
#if (MOZ_WIDGET_GTK == 3)
|
#if (MOZ_WIDGET_GTK == 3)
|
||||||
if (atk_bridge_adaptor_init) {
|
if (!InitAtkBridgeAdaptor())
|
||||||
atk_bridge_adaptor_init(nullptr, nullptr);
|
|
||||||
} else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
nsresult rv = LoadGtkModule(sAtkBridge);
|
nsresult rv = LoadGtkModule(sAtkBridge);
|
||||||
@@ -228,6 +262,13 @@ a11y::PlatformShutdown()
|
|||||||
sAtkBridge.init = nullptr;
|
sAtkBridge.init = nullptr;
|
||||||
sAtkBridge.shutdown = nullptr;
|
sAtkBridge.shutdown = nullptr;
|
||||||
}
|
}
|
||||||
|
#if (MOZ_WIDGET_GTK == 3)
|
||||||
|
if (sAtkBridgeAdaptorLib) {
|
||||||
|
// Do not shutdown/unload atk-bridge; an exit function registered by
|
||||||
|
// the bridge will take care of it.
|
||||||
|
sAtkBridgeAdaptorLib = nullptr;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if (MOZ_WIDGET_GTK == 2)
|
#if (MOZ_WIDGET_GTK == 2)
|
||||||
if (sGail.lib) {
|
if (sGail.lib) {
|
||||||
// Do not shutdown gail because
|
// Do not shutdown gail because
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ private:
|
|||||||
{
|
{
|
||||||
explicit IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
|
explicit IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
|
||||||
|
|
||||||
Accessible* mParent;
|
RefPtr<Accessible> mParent;
|
||||||
int32_t mIndex;
|
int32_t mIndex;
|
||||||
IteratorState* mParentState;
|
IteratorState* mParentState;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def loadEventIDL(parser, includePath, eventname):
|
|||||||
class Configuration:
|
class Configuration:
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
config = {}
|
config = {}
|
||||||
execfile(filename, config)
|
exec(compile(open(filename, "rb").read(), filename, 'exec'), config)
|
||||||
self.simple_events = config.get('simple_events', [])
|
self.simple_events = config.get('simple_events', [])
|
||||||
|
|
||||||
def firstCap(str):
|
def firstCap(str):
|
||||||
@@ -64,7 +64,7 @@ def print_header_file(fd, conf, incdirs):
|
|||||||
for e in conf.simple_events:
|
for e in conf.simple_events:
|
||||||
idl, idl_path = loadEventIDL(p, incdirs, e)
|
idl, idl_path = loadEventIDL(p, incdirs, e)
|
||||||
idl_paths.add(idl_path)
|
idl_paths.add(idl_path)
|
||||||
for iface in filter(lambda p: p.kind == "interface", idl.productions):
|
for iface in [p for p in idl.productions if p.kind == "interface"]:
|
||||||
classname = ("xpcAcc%s" % e)
|
classname = ("xpcAcc%s" % e)
|
||||||
baseinterfaces = interfaces(iface)
|
baseinterfaces = interfaces(iface)
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ def print_header_file(fd, conf, incdirs):
|
|||||||
fd.write("public:\n")
|
fd.write("public:\n")
|
||||||
|
|
||||||
attributes = allAttributes(iface)
|
attributes = allAttributes(iface)
|
||||||
args = map(writeAttributeParams, attributes)
|
args = list(map(writeAttributeParams, attributes))
|
||||||
fd.write(" %s(%s) :\n" % (classname, ", ".join(args)))
|
fd.write(" %s(%s) :\n" % (classname, ", ".join(args)))
|
||||||
|
|
||||||
initializers = []
|
initializers = []
|
||||||
@@ -83,7 +83,7 @@ def print_header_file(fd, conf, incdirs):
|
|||||||
fd.write(" NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n")
|
fd.write(" NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n")
|
||||||
fd.write(" NS_DECL_CYCLE_COLLECTION_CLASS(%s)\n" % (classname))
|
fd.write(" NS_DECL_CYCLE_COLLECTION_CLASS(%s)\n" % (classname))
|
||||||
|
|
||||||
for iface in filter(lambda i: i.name != "nsISupports", baseinterfaces):
|
for iface in [i for i in baseinterfaces if i.name != "nsISupports"]:
|
||||||
fd.write(" NS_DECL_%s\n" % iface.name.upper())
|
fd.write(" NS_DECL_%s\n" % iface.name.upper())
|
||||||
|
|
||||||
fd.write("\nprivate:\n")
|
fd.write("\nprivate:\n")
|
||||||
@@ -97,13 +97,13 @@ def print_header_file(fd, conf, incdirs):
|
|||||||
return idl_paths
|
return idl_paths
|
||||||
|
|
||||||
def interfaceAttributeTypes(idl):
|
def interfaceAttributeTypes(idl):
|
||||||
ifaces = filter(lambda p: p.kind == "interface", idl.productions)
|
ifaces = [p for p in idl.productions if p.kind == "interface"]
|
||||||
attributes = []
|
attributes = []
|
||||||
for i in ifaces:
|
for i in ifaces:
|
||||||
ifaceAttributes = allAttributes(i)
|
ifaceAttributes = allAttributes(i)
|
||||||
attributes.extend(ifaceAttributes)
|
attributes.extend(ifaceAttributes)
|
||||||
ifaceAttrs = filter(lambda a: a.realtype.nativeType("in").endswith("*"), attributes)
|
ifaceAttrs = [a for a in attributes if a.realtype.nativeType("in").endswith("*")]
|
||||||
return map(lambda a: a.realtype.nativeType("in").strip(" *"), ifaceAttrs)
|
return [a.realtype.nativeType("in").strip(" *") for a in ifaceAttrs]
|
||||||
|
|
||||||
def print_cpp(idl, fd, conf, eventname):
|
def print_cpp(idl, fd, conf, eventname):
|
||||||
for p in idl.productions:
|
for p in idl.productions:
|
||||||
@@ -186,7 +186,7 @@ def interfaces(iface):
|
|||||||
def allAttributes(iface):
|
def allAttributes(iface):
|
||||||
attributes = []
|
attributes = []
|
||||||
for i in interfaces(iface):
|
for i in interfaces(iface):
|
||||||
attrs = filter(lambda m: isinstance(m, xpidl.Attribute), i.members)
|
attrs = [m for m in i.members if isinstance(m, xpidl.Attribute)]
|
||||||
attributes.extend(attrs)
|
attributes.extend(attrs)
|
||||||
|
|
||||||
return attributes
|
return attributes
|
||||||
@@ -194,7 +194,7 @@ def allAttributes(iface):
|
|||||||
def write_cpp(eventname, iface, fd):
|
def write_cpp(eventname, iface, fd):
|
||||||
classname = "xpcAcc%s" % eventname
|
classname = "xpcAcc%s" % eventname
|
||||||
attributes = allAttributes(iface)
|
attributes = allAttributes(iface)
|
||||||
ccattributes = filter(lambda m: m.realtype.nativeType('in').endswith('*'), attributes)
|
ccattributes = [m for m in attributes if m.realtype.nativeType('in').endswith('*')]
|
||||||
fd.write("NS_IMPL_CYCLE_COLLECTION(%s" % classname)
|
fd.write("NS_IMPL_CYCLE_COLLECTION(%s" % classname)
|
||||||
for c in ccattributes:
|
for c in ccattributes:
|
||||||
fd.write(", m%s" % firstCap(c.name))
|
fd.write(", m%s" % firstCap(c.name))
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
'''Parses a given application.ini file and outputs the corresponding
|
'''Parses a given application.ini file and outputs the corresponding
|
||||||
XULAppData structure as a C++ header file'''
|
XULAppData structure as a C++ header file'''
|
||||||
|
|
||||||
import ConfigParser
|
import configparser
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def main(output, file):
|
def main(output, file):
|
||||||
config = ConfigParser.RawConfigParser()
|
config = configparser.RawConfigParser()
|
||||||
config.read(file)
|
config.read(file)
|
||||||
flags = set()
|
flags = set()
|
||||||
try:
|
try:
|
||||||
@@ -27,8 +27,7 @@ def main(output, file):
|
|||||||
'App:id', 'Gecko:minversion', 'Gecko:maxversion')
|
'App:id', 'Gecko:minversion', 'Gecko:maxversion')
|
||||||
missing = [var for var in expected if var not in appdata]
|
missing = [var for var in expected if var not in appdata]
|
||||||
if missing:
|
if missing:
|
||||||
print >>sys.stderr, \
|
print("Missing values in %s: %s" % (file, ', '.join(missing)), file=sys.stderr)
|
||||||
"Missing values in %s: %s" % (file, ', '.join(missing))
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not 'Crash Reporter:serverurl' in appdata:
|
if not 'Crash Reporter:serverurl' in appdata:
|
||||||
@@ -57,4 +56,4 @@ if __name__ == '__main__':
|
|||||||
if len(sys.argv) != 1:
|
if len(sys.argv) != 1:
|
||||||
main(sys.stdout, sys.argv[1])
|
main(sys.stdout, sys.argv[1])
|
||||||
else:
|
else:
|
||||||
print >>sys.stderr, "Usage: %s /path/to/application.ini" % sys.argv[0]
|
print("Usage: %s /path/to/application.ini" % sys.argv[0], file=sys.stderr)
|
||||||
@@ -34,7 +34,7 @@ def symlink(source, link_name):
|
|||||||
def check_run(args):
|
def check_run(args):
|
||||||
global DEBUG
|
global DEBUG
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print >> sys.stderr, ' '.join(args)
|
print(' '.join(args), file=sys.stderr)
|
||||||
r = subprocess.call(args)
|
r = subprocess.call(args)
|
||||||
assert r == 0
|
assert r == 0
|
||||||
|
|
||||||
@@ -43,11 +43,11 @@ def run_in(path, args):
|
|||||||
d = os.getcwd()
|
d = os.getcwd()
|
||||||
global DEBUG
|
global DEBUG
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print >> sys.stderr, 'cd "%s"' % path
|
print('cd "%s"' % path, file=sys.stderr)
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
check_run(args)
|
check_run(args)
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print >> sys.stderr, 'cd "%s"' % d
|
print('cd "%s"' % d, file=sys.stderr)
|
||||||
os.chdir(d)
|
os.chdir(d)
|
||||||
|
|
||||||
|
|
||||||
@@ -377,7 +377,7 @@ if __name__ == "__main__":
|
|||||||
extra_cflags2 = ["-fPIC"]
|
extra_cflags2 = ["-fPIC"]
|
||||||
extra_cxxflags2 = ["-fPIC", "-static-libstdc++"]
|
extra_cxxflags2 = ["-fPIC", "-static-libstdc++"]
|
||||||
|
|
||||||
if os.environ.has_key('LD_LIBRARY_PATH'):
|
if 'LD_LIBRARY_PATH' in os.environ:
|
||||||
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/:%s' % (gcc_dir, os.environ['LD_LIBRARY_PATH']);
|
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/:%s' % (gcc_dir, os.environ['LD_LIBRARY_PATH']);
|
||||||
else:
|
else:
|
||||||
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/' % gcc_dir
|
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/' % gcc_dir
|
||||||
|
|||||||
+3
-3
@@ -81,9 +81,9 @@ def process_files(files, output_filename, digests, strip):
|
|||||||
short_file = short_file.lstrip('/')
|
short_file = short_file.lstrip('/')
|
||||||
else:
|
else:
|
||||||
short_file = file
|
short_file = file
|
||||||
print >>output, '%s %s %s %s' % (hash, digest,
|
print('%s %s %s %s' % (hash, digest,
|
||||||
os.path.getsize(file),
|
os.path.getsize(file),
|
||||||
short_file)
|
short_file), file=output)
|
||||||
|
|
||||||
def setup_logging(level=logging.DEBUG):
|
def setup_logging(level=logging.DEBUG):
|
||||||
'''This function sets up the logging module using a speficiable logging
|
'''This function sets up the logging module using a speficiable logging
|
||||||
@@ -140,7 +140,7 @@ def main():
|
|||||||
try:
|
try:
|
||||||
for digest in options.digests:
|
for digest in options.digests:
|
||||||
hashlib.new(digest)
|
hashlib.new(digest)
|
||||||
except ValueError, ve:
|
except ValueError as ve:
|
||||||
logger.error('Could not create a "%s" hash object (%s)' %
|
logger.error('Could not create a "%s" hash object (%s)' %
|
||||||
(digest, ve.args[0]))
|
(digest, ve.args[0]))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import site
|
import site
|
||||||
import sys
|
import sys
|
||||||
import urllib2
|
import urllib.request, urllib.error, urllib.parse
|
||||||
import difflib
|
import difflib
|
||||||
|
|
||||||
FAILURE_CODE = 1
|
FAILURE_CODE = 1
|
||||||
@@ -40,10 +40,10 @@ def make_hg_url(hgHost, repoPath, protocol='https', revision=None,
|
|||||||
|
|
||||||
def readConfig(configfile, keys=[], required=[]):
|
def readConfig(configfile, keys=[], required=[]):
|
||||||
c = {}
|
c = {}
|
||||||
execfile(configfile, c)
|
exec(compile(open(configfile, "rb").read(), configfile, 'exec'), c)
|
||||||
for k in keys:
|
for k in keys:
|
||||||
c = c[k]
|
c = c[k]
|
||||||
items = c.keys()
|
items = list(c.keys())
|
||||||
err = False
|
err = False
|
||||||
for key in required:
|
for key in required:
|
||||||
if key not in items:
|
if key not in items:
|
||||||
@@ -126,7 +126,7 @@ def get_mozconfig(path, options):
|
|||||||
else:
|
else:
|
||||||
url = make_hg_url(options.hghost, options.branch, 'http',
|
url = make_hg_url(options.hghost, options.branch, 'http',
|
||||||
options.revision, path)
|
options.revision, path)
|
||||||
return urllib2.urlopen(url).readlines()
|
return urllib.request.urlopen(url).readlines()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ gyp_vars.update({
|
|||||||
'arm_neon': 0,
|
'arm_neon': 0,
|
||||||
'arm_neon_optional': 1,
|
'arm_neon_optional': 1,
|
||||||
|
|
||||||
'moz_webrtc_omx': 0,
|
|
||||||
'moz_webrtc_mediacodec': 0,
|
|
||||||
|
|
||||||
# Turn off multi monitor screen share
|
# Turn off multi monitor screen share
|
||||||
'multi_monitor_screenshare%' : 0,
|
'multi_monitor_screenshare%' : 0,
|
||||||
@@ -73,8 +71,6 @@ if CONFIG['ARM_ARCH']:
|
|||||||
if int(CONFIG['ARM_ARCH']) < 7:
|
if int(CONFIG['ARM_ARCH']) < 7:
|
||||||
gyp_vars['armv7'] = 0
|
gyp_vars['armv7'] = 0
|
||||||
gyp_vars['arm_neon_optional'] = 0
|
gyp_vars['arm_neon_optional'] = 0
|
||||||
elif os == 'Android':
|
|
||||||
gyp_vars['armv7'] = 1
|
|
||||||
else:
|
else:
|
||||||
# CPU detection for ARM works on Android only. armv7 always uses CPU
|
# CPU detection for ARM works on Android only. armv7 always uses CPU
|
||||||
# detection, so we have to set armv7=0 for non-Android target
|
# detection, so we have to set armv7=0 for non-Android target
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ flavors = {
|
|||||||
'Linux': 'linux',
|
'Linux': 'linux',
|
||||||
'Darwin': 'mac',
|
'Darwin': 'mac',
|
||||||
'SunOS': 'solaris',
|
'SunOS': 'solaris',
|
||||||
'GNU/kFreeBSD': 'freebsd',
|
'kFreeBSD': 'freebsd',
|
||||||
'DragonFly': 'dragonfly',
|
'DragonFly': 'dragonfly',
|
||||||
'FreeBSD': 'freebsd',
|
'FreeBSD': 'freebsd',
|
||||||
'NetBSD': 'netbsd',
|
'NetBSD': 'netbsd',
|
||||||
|
|||||||
+14
-9
@@ -12,7 +12,7 @@ import random
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import uuid
|
import uuid
|
||||||
import __builtin__
|
import builtins
|
||||||
|
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
|
|
||||||
@@ -170,11 +170,16 @@ def bootstrap(topsrcdir, mozilla_dir=None):
|
|||||||
if mozilla_dir is None:
|
if mozilla_dir is None:
|
||||||
mozilla_dir = topsrcdir
|
mozilla_dir = topsrcdir
|
||||||
|
|
||||||
# Ensure we are running Python 2.7+. We put this check here so we generate a
|
# Ensure we are not running Python 2.
|
||||||
# user-friendly error message rather than a cryptic stack trace on module
|
# We put this check here so we generate a user-friendly error message
|
||||||
# import.
|
# rather than a cryptic stack trace on module import.
|
||||||
if sys.version_info[0] != 2 or sys.version_info[1] < 7:
|
if sys.version_info[0] < 3 or sys.version_info[1] < 3:
|
||||||
print('Python 2.7 or above (but not Python 3) is required to run mach.')
|
print('Python 3.3 or above is required to run mach.')
|
||||||
|
print('You are running Python', platform.python_version())
|
||||||
|
sys.exit(1)
|
||||||
|
# This sanity check is overkill, but why not?
|
||||||
|
if sys.version_info[0] > 3:
|
||||||
|
print('Python 4.x or higher not supported. Use Python 3 instead.')
|
||||||
print('You are running Python', platform.python_version())
|
print('You are running Python', platform.python_version())
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@@ -335,7 +340,7 @@ def bootstrap(topsrcdir, mozilla_dir=None):
|
|||||||
# always load local repository configuration
|
# always load local repository configuration
|
||||||
mach.settings_paths.append(mozilla_dir)
|
mach.settings_paths.append(mozilla_dir)
|
||||||
|
|
||||||
for category, meta in CATEGORIES.items():
|
for category, meta in list(CATEGORIES.items()):
|
||||||
mach.define_category(category, meta['short'], meta['long'],
|
mach.define_category(category, meta['short'], meta['long'],
|
||||||
meta['priority'])
|
meta['priority'])
|
||||||
|
|
||||||
@@ -360,7 +365,7 @@ class ImportHook(object):
|
|||||||
self._modules = set()
|
self._modules = set()
|
||||||
|
|
||||||
def __call__(self, name, globals=None, locals=None, fromlist=None,
|
def __call__(self, name, globals=None, locals=None, fromlist=None,
|
||||||
level=-1):
|
level=0):
|
||||||
# name might be a relative import. Instead of figuring out what that
|
# name might be a relative import. Instead of figuring out what that
|
||||||
# resolves to, which is complex, just rely on the real import.
|
# resolves to, which is complex, just rely on the real import.
|
||||||
# Since we don't know the full module name, we can't check sys.modules,
|
# Since we don't know the full module name, we can't check sys.modules,
|
||||||
@@ -409,4 +414,4 @@ class ImportHook(object):
|
|||||||
|
|
||||||
|
|
||||||
# Install our hook
|
# Install our hook
|
||||||
__builtin__.__import__ = ImportHook(__builtin__.__import__)
|
builtins.__import__ = ImportHook(builtins.__import__)
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
# _declare_exceptions template, and add it to the return statement. Then
|
# _declare_exceptions template, and add it to the return statement. Then
|
||||||
# destructure in the assignment below the function declaration.
|
# destructure in the assignment below the function declaration.
|
||||||
@template
|
@template
|
||||||
@imports(_from='__builtin__', _import='Exception')
|
@imports(_from='builtins', _import='Exception')
|
||||||
def _declare_exceptions():
|
def _declare_exceptions():
|
||||||
class FatalCheckError(Exception):
|
class FatalCheckError(Exception):
|
||||||
'''An exception to throw from a function decorated with @checking.
|
'''An exception to throw from a function decorated with @checking.
|
||||||
|
|||||||
@@ -133,7 +133,8 @@ option(env='PYTHON', nargs=1, help='Python interpreter')
|
|||||||
@imports(_from='mozbuild.configure.util', _import='LineIO')
|
@imports(_from='mozbuild.configure.util', _import='LineIO')
|
||||||
@imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
|
@imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
|
||||||
@imports(_from='mozbuild.virtualenv', _import='verify_python_version')
|
@imports(_from='mozbuild.virtualenv', _import='verify_python_version')
|
||||||
@imports('distutils.sysconfig')
|
@imports(_from='mozpack.path', _import='normsep')
|
||||||
|
@imports('sysconfig')
|
||||||
def virtualenv_python(env_python, build_env, mozconfig, help):
|
def virtualenv_python(env_python, build_env, mozconfig, help):
|
||||||
if help:
|
if help:
|
||||||
return
|
return
|
||||||
@@ -165,6 +166,9 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
|
|||||||
os.path.join(topobjdir, '_virtualenv'), out,
|
os.path.join(topobjdir, '_virtualenv'), out,
|
||||||
os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt'))
|
os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt'))
|
||||||
|
|
||||||
|
if normsep(sys.executable) == normsep(manager.python_path):
|
||||||
|
return normsep(manager.python_path)
|
||||||
|
|
||||||
if python:
|
if python:
|
||||||
# If we're not in the virtualenv, we need the which module for
|
# If we're not in the virtualenv, we need the which module for
|
||||||
# find_program.
|
# find_program.
|
||||||
@@ -193,10 +197,10 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
|
|||||||
sys.exit(subprocess.call([python] + sys.argv))
|
sys.exit(subprocess.call([python] + sys.argv))
|
||||||
|
|
||||||
# We are now in the virtualenv
|
# We are now in the virtualenv
|
||||||
if not distutils.sysconfig.get_python_lib():
|
if not sysconfig.get_path("purelib"):
|
||||||
die('Could not determine python site packages directory')
|
die('Could not determine python site packages directory')
|
||||||
|
|
||||||
return python
|
return normsep(python)
|
||||||
|
|
||||||
set_config('PYTHON', virtualenv_python)
|
set_config('PYTHON', virtualenv_python)
|
||||||
add_old_configure_assignment('PYTHON', virtualenv_python)
|
add_old_configure_assignment('PYTHON', virtualenv_python)
|
||||||
@@ -212,7 +216,7 @@ def early_options():
|
|||||||
def early_options():
|
def early_options():
|
||||||
return set(
|
return set(
|
||||||
option.env
|
option.env
|
||||||
for option in __sandbox__._options.itervalues()
|
for option in __sandbox__._options.values()
|
||||||
if option.env
|
if option.env
|
||||||
)
|
)
|
||||||
return early_options
|
return early_options
|
||||||
@@ -240,17 +244,17 @@ def mozconfig_options(mozconfig, help):
|
|||||||
log.info(' %s' % arg)
|
log.info(' %s' % arg)
|
||||||
helper.add(arg, origin='mozconfig', args=helper._args)
|
helper.add(arg, origin='mozconfig', args=helper._args)
|
||||||
|
|
||||||
for key, value in mozconfig['env']['added'].iteritems():
|
for key, value in mozconfig['env']['added'].items():
|
||||||
add(key, value)
|
add(key, value)
|
||||||
os.environ[key] = value
|
os.environ[key] = value
|
||||||
for key, (_, value) in mozconfig['env']['modified'].iteritems():
|
for key, (_, value) in mozconfig['env']['modified'].items():
|
||||||
add(key, value)
|
add(key, value)
|
||||||
os.environ[key] = value
|
os.environ[key] = value
|
||||||
for key, value in mozconfig['vars']['added'].iteritems():
|
for key, value in mozconfig['vars']['added'].items():
|
||||||
# mozconfig_loader adds _IS_SET variables that are irrelevant
|
# mozconfig_loader adds _IS_SET variables that are irrelevant
|
||||||
if not key.endswith('_IS_SET'):
|
if not key.endswith('_IS_SET'):
|
||||||
add(key, value)
|
add(key, value)
|
||||||
for key, (_, value) in mozconfig['vars']['modified'].iteritems():
|
for key, (_, value) in mozconfig['vars']['modified'].items():
|
||||||
add(key, value)
|
add(key, value)
|
||||||
|
|
||||||
|
|
||||||
@@ -290,6 +294,7 @@ option('--target', nargs=1,
|
|||||||
@imports(_from='mozbuild.configure.constants', _import='Endianness')
|
@imports(_from='mozbuild.configure.constants', _import='Endianness')
|
||||||
@imports(_from='mozbuild.configure.constants', _import='Kernel')
|
@imports(_from='mozbuild.configure.constants', _import='Kernel')
|
||||||
@imports(_from='mozbuild.configure.constants', _import='OS')
|
@imports(_from='mozbuild.configure.constants', _import='OS')
|
||||||
|
@imports(_from='mozbuild.configure.constants', _import='OS_and_Kernel')
|
||||||
def split_triplet(triplet):
|
def split_triplet(triplet):
|
||||||
# The standard triplet is defined as
|
# The standard triplet is defined as
|
||||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||||
@@ -339,7 +344,7 @@ def split_triplet(triplet):
|
|||||||
if cpu.endswith('86') or (cpu.startswith('i') and '86' in cpu):
|
if cpu.endswith('86') or (cpu.startswith('i') and '86' in cpu):
|
||||||
canonical_cpu = 'x86'
|
canonical_cpu = 'x86'
|
||||||
endianness = 'little'
|
endianness = 'little'
|
||||||
elif cpu in ('x86_64', 'ia64'):
|
elif cpu == 'x86_64':
|
||||||
canonical_cpu = cpu
|
canonical_cpu = cpu
|
||||||
endianness = 'little'
|
endianness = 'little'
|
||||||
elif cpu in ('s390', 's390x'):
|
elif cpu in ('s390', 's390x'):
|
||||||
@@ -385,8 +390,8 @@ def split_triplet(triplet):
|
|||||||
alias=triplet,
|
alias=triplet,
|
||||||
cpu=CPU(canonical_cpu),
|
cpu=CPU(canonical_cpu),
|
||||||
bitness=CPU_bitness[canonical_cpu],
|
bitness=CPU_bitness[canonical_cpu],
|
||||||
kernel=Kernel(canonical_kernel),
|
kernel=OS_and_Kernel(canonical_kernel),
|
||||||
os=OS(canonical_os),
|
os=OS_and_Kernel(canonical_os),
|
||||||
endianness=Endianness(endianness),
|
endianness=Endianness(endianness),
|
||||||
raw_cpu=cpu,
|
raw_cpu=cpu,
|
||||||
raw_os=os,
|
raw_os=os,
|
||||||
@@ -400,7 +405,8 @@ def split_triplet(triplet):
|
|||||||
def config_sub(shell, triplet):
|
def config_sub(shell, triplet):
|
||||||
config_sub = os.path.join(os.path.dirname(__file__), '..',
|
config_sub = os.path.join(os.path.dirname(__file__), '..',
|
||||||
'autoconf', 'config.sub')
|
'autoconf', 'config.sub')
|
||||||
return subprocess.check_output([shell, config_sub, triplet]).strip()
|
return subprocess.check_output([shell, config_sub, triplet],
|
||||||
|
universal_newlines=True).strip()
|
||||||
|
|
||||||
|
|
||||||
@depends('--host', shell)
|
@depends('--host', shell)
|
||||||
@@ -410,7 +416,8 @@ def host(value, shell):
|
|||||||
if not value:
|
if not value:
|
||||||
config_guess = os.path.join(os.path.dirname(__file__), '..',
|
config_guess = os.path.join(os.path.dirname(__file__), '..',
|
||||||
'autoconf', 'config.guess')
|
'autoconf', 'config.guess')
|
||||||
host = subprocess.check_output([shell, config_guess]).strip()
|
host = subprocess.check_output([shell, config_guess],
|
||||||
|
universal_newlines=True).strip()
|
||||||
else:
|
else:
|
||||||
host = value[0]
|
host = value[0]
|
||||||
|
|
||||||
@@ -761,7 +768,7 @@ def enabled_in_nightly(milestone, _):
|
|||||||
def all_configure_options(_):
|
def all_configure_options(_):
|
||||||
result = []
|
result = []
|
||||||
previous = None
|
previous = None
|
||||||
for option in __sandbox__._options.itervalues():
|
for option in __sandbox__._options.values():
|
||||||
# __sandbox__._options contains items for both option.name and
|
# __sandbox__._options contains items for both option.name and
|
||||||
# option.env. But it's also an OrderedDict, meaning both are
|
# option.env. But it's also an OrderedDict, meaning both are
|
||||||
# consecutive.
|
# consecutive.
|
||||||
|
|||||||
@@ -3,13 +3,6 @@
|
|||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
@imports('codecs')
|
|
||||||
@imports('sys')
|
|
||||||
def encoded_open(path, mode):
|
|
||||||
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
|
|
||||||
return codecs.open(path, mode, encoding)
|
|
||||||
|
|
||||||
|
|
||||||
m4 = check_prog(
|
m4 = check_prog(
|
||||||
"M4",
|
"M4",
|
||||||
(
|
(
|
||||||
@@ -31,8 +24,10 @@ m4 = check_prog(
|
|||||||
@imports(_from='os.path', _import='exists')
|
@imports(_from='os.path', _import='exists')
|
||||||
@imports(_from='mozbuild.shellutil', _import='quote')
|
@imports(_from='mozbuild.shellutil', _import='quote')
|
||||||
@imports(_from='os', _import='environ')
|
@imports(_from='os', _import='environ')
|
||||||
|
@imports(_from='mozbuild.getencoding', _import='getencoding')
|
||||||
def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
|
def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
|
||||||
old_configure_assignments, build_project):
|
old_configure_assignments, build_project):
|
||||||
|
encoding = getencoding()
|
||||||
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
|
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
|
||||||
# which is actually necessary because this path actually ends up literally
|
# which is actually necessary because this path actually ends up literally
|
||||||
# as $0, and backslashes there breaks autoconf's detection of the source
|
# as $0, and backslashes there breaks autoconf's detection of the source
|
||||||
@@ -43,7 +38,6 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
|
|||||||
if not old_configure_dir.endswith('/js/src'):
|
if not old_configure_dir.endswith('/js/src'):
|
||||||
old_configure = os.path.join(old_configure_dir, 'js', 'src',
|
old_configure = os.path.join(old_configure_dir, 'js', 'src',
|
||||||
os.path.basename(old_configure))
|
os.path.basename(old_configure))
|
||||||
|
|
||||||
refresh = True
|
refresh = True
|
||||||
if exists(old_configure):
|
if exists(old_configure):
|
||||||
mtime = getmtime(old_configure)
|
mtime = getmtime(old_configure)
|
||||||
@@ -67,25 +61,21 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
|
|||||||
env['AWK'] = awk
|
env['AWK'] = awk
|
||||||
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
|
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
|
||||||
my_env = env
|
my_env = env
|
||||||
# Handle Python 2.7 not allowing unicode in the environment on Windows
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
my_env = dict()
|
|
||||||
for e in env:
|
|
||||||
my_env[e.encode('ascii','ignore')] = env[e].encode('ascii','ignore')
|
|
||||||
script = subprocess.check_output([
|
script = subprocess.check_output([
|
||||||
shell, autoconf,
|
shell, autoconf,
|
||||||
'--localdir=%s' % os.path.dirname(old_configure),
|
'--localdir=%s' % os.path.dirname(old_configure),
|
||||||
old_configure + '.in'], env=my_env)
|
old_configure + '.in'], env=my_env)
|
||||||
|
script = script.decode(encoding, errors='replace')
|
||||||
|
|
||||||
# Make old-configure append to config.log, where we put our own log.
|
# Make old-configure append to config.log, where we put our own log.
|
||||||
# This could be done with a m4 macro, but it's way easier this way
|
# This could be done with a m4 macro, but it's way easier this way
|
||||||
script = script.replace('>./config.log', '>>./config.log')
|
script = script.replace('>./config.log', '>>./config.log')
|
||||||
|
|
||||||
with open(old_configure, 'wb') as fh:
|
with open(old_configure, 'w', encoding=encoding, errors='replace') as fh:
|
||||||
fh.write(script)
|
fh.write(script)
|
||||||
|
|
||||||
cmd = [shell, old_configure]
|
cmd = [shell, old_configure]
|
||||||
with encoded_open('old-configure.vars', 'w') as out:
|
with open('old-configure.vars', 'w', encoding=encoding, errors='replace') as out:
|
||||||
log.debug('Injecting the following to old-configure:')
|
log.debug('Injecting the following to old-configure:')
|
||||||
def inject(command):
|
def inject(command):
|
||||||
print(command, file=out)
|
print(command, file=out)
|
||||||
@@ -162,6 +152,7 @@ def old_configure_options(*options):
|
|||||||
'--enable-jitspew',
|
'--enable-jitspew',
|
||||||
'--enable-js-lto',
|
'--enable-js-lto',
|
||||||
'--enable-leak-sanitizer',
|
'--enable-leak-sanitizer',
|
||||||
|
'--enable-libaom',
|
||||||
'--enable-libjpeg-turbo',
|
'--enable-libjpeg-turbo',
|
||||||
'--enable-libproxy',
|
'--enable-libproxy',
|
||||||
'--enable-llvm-hacks',
|
'--enable-llvm-hacks',
|
||||||
@@ -173,6 +164,7 @@ def old_configure_options(*options):
|
|||||||
'--enable-negotiateauth',
|
'--enable-negotiateauth',
|
||||||
'--enable-nfc',
|
'--enable-nfc',
|
||||||
'--enable-npapi',
|
'--enable-npapi',
|
||||||
|
'--enable-npapi-gtk2',
|
||||||
'--enable-nspr-build',
|
'--enable-nspr-build',
|
||||||
'--enable-official-branding',
|
'--enable-official-branding',
|
||||||
'--enable-official-vendor',
|
'--enable-official-vendor',
|
||||||
@@ -294,8 +286,11 @@ def old_configure_options(*options):
|
|||||||
@imports('subprocess')
|
@imports('subprocess')
|
||||||
@imports('sys')
|
@imports('sys')
|
||||||
@imports(_from='mozbuild.shellutil', _import='quote')
|
@imports(_from='mozbuild.shellutil', _import='quote')
|
||||||
|
@imports(_from='mozbuild.util', _import='exec_')
|
||||||
|
@imports(_from='mozbuild.getencoding', _import='getencoding')
|
||||||
def old_configure(prepare_configure, extra_old_configure_args, all_options,
|
def old_configure(prepare_configure, extra_old_configure_args, all_options,
|
||||||
*options):
|
*options):
|
||||||
|
encoding = getencoding()
|
||||||
cmd = prepare_configure
|
cmd = prepare_configure
|
||||||
|
|
||||||
# old-configure only supports the options listed in @old_configure_options
|
# old-configure only supports the options listed in @old_configure_options
|
||||||
@@ -332,7 +327,7 @@ def old_configure(prepare_configure, extra_old_configure_args, all_options,
|
|||||||
ret = subprocess.call(cmd)
|
ret = subprocess.call(cmd)
|
||||||
if ret:
|
if ret:
|
||||||
with log.queue_debug():
|
with log.queue_debug():
|
||||||
with encoded_open('config.log', 'r') as fh:
|
with open('config.log', 'r', encoding=encoding, errors='replace') as fh:
|
||||||
fh.seek(log_size)
|
fh.seek(log_size)
|
||||||
for line in fh:
|
for line in fh:
|
||||||
log.debug(line.rstrip())
|
log.debug(line.rstrip())
|
||||||
@@ -340,12 +335,12 @@ def old_configure(prepare_configure, extra_old_configure_args, all_options,
|
|||||||
sys.exit(ret)
|
sys.exit(ret)
|
||||||
|
|
||||||
raw_config = {}
|
raw_config = {}
|
||||||
with encoded_open('config.data', 'r') as fh:
|
with open('config.data', 'r', encoding=encoding, errors='replace') as fh:
|
||||||
code = compile(fh.read(), 'config.data', 'exec')
|
code = compile(fh.read(), 'config.data', 'exec')
|
||||||
# Every variation of the exec() function I tried led to:
|
# Every variation of the exec() function I tried led to:
|
||||||
# SyntaxError: unqualified exec is not allowed in function 'main' it
|
# SyntaxError: unqualified exec is not allowed in function 'main' it
|
||||||
# contains a nested function with free variables
|
# contains a nested function with free variables
|
||||||
exec code in raw_config
|
exec_(code, raw_config)
|
||||||
|
|
||||||
# Ensure all the flags known to old-configure appear in the
|
# Ensure all the flags known to old-configure appear in the
|
||||||
# @old_configure_options above.
|
# @old_configure_options above.
|
||||||
@@ -379,9 +374,9 @@ def set_old_configure_define(name, value):
|
|||||||
def post_old_configure(raw_config):
|
def post_old_configure(raw_config):
|
||||||
for k, v in raw_config['substs']:
|
for k, v in raw_config['substs']:
|
||||||
set_old_configure_config(
|
set_old_configure_config(
|
||||||
k[1:-1], v[1:-1] if isinstance(v, types.StringTypes) else v)
|
k[1:-1], v[1:-1] if isinstance(v, str) else v)
|
||||||
|
|
||||||
for k, v in dict(raw_config['defines']).iteritems():
|
for k, v in dict(raw_config['defines']).items():
|
||||||
set_old_configure_define(k[1:-1], v[1:-1])
|
set_old_configure_define(k[1:-1], v[1:-1])
|
||||||
|
|
||||||
set_old_configure_config('non_global_defines',
|
set_old_configure_config('non_global_defines',
|
||||||
|
|||||||
@@ -61,6 +61,44 @@ set_config('HAVE_YASM', have_yasm)
|
|||||||
# Until the YASM variable is not necessary in old-configure.
|
# Until the YASM variable is not necessary in old-configure.
|
||||||
add_old_configure_assignment('YASM', have_yasm)
|
add_old_configure_assignment('YASM', have_yasm)
|
||||||
|
|
||||||
|
# nasm detection
|
||||||
|
# ==============================================================
|
||||||
|
nasm = check_prog('NASM', ['nasm'], allow_missing=True)
|
||||||
|
|
||||||
|
@depends_if(nasm)
|
||||||
|
@checking('nasm version')
|
||||||
|
def nasm_version(nasm):
|
||||||
|
version = check_cmd_output(
|
||||||
|
nasm, '-v',
|
||||||
|
onerror=lambda: die('Failed to get nasm version.')
|
||||||
|
).splitlines()[0].split()[2]
|
||||||
|
return Version(version)
|
||||||
|
|
||||||
|
@depends(nasm, nasm_version)
|
||||||
|
def have_nasm(nasm, version):
|
||||||
|
if nasm and version >= Version('2.14'):
|
||||||
|
return True
|
||||||
|
|
||||||
|
set_config('HAVE_NASM', have_nasm)
|
||||||
|
|
||||||
|
@depends(have_nasm, target)
|
||||||
|
def nasm_asflags(have_nasm, target):
|
||||||
|
if have_nasm:
|
||||||
|
asflags = {
|
||||||
|
('OSX', 'x86'): '-f macho32',
|
||||||
|
('OSX', 'x86_64'): '-f macho64',
|
||||||
|
('WINNT', 'x86'): '-f win32',
|
||||||
|
('WINNT', 'x86_64'): '-f win64',
|
||||||
|
}.get((target.os, target.cpu), None)
|
||||||
|
if asflags is None:
|
||||||
|
if target.cpu == 'x86':
|
||||||
|
asflags = '-f elf32'
|
||||||
|
elif target.cpu == 'x86_64':
|
||||||
|
asflags = '-f elf64'
|
||||||
|
return asflags
|
||||||
|
|
||||||
|
set_config('NASM_ASFLAGS', nasm_asflags)
|
||||||
|
|
||||||
# MacOS deployment target version
|
# MacOS deployment target version
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
# This needs to happen before any compilation test is done.
|
# This needs to happen before any compilation test is done.
|
||||||
@@ -236,7 +274,7 @@ def get_compiler_info(compiler, language):
|
|||||||
('CPU', CPU_preprocessor_checks),
|
('CPU', CPU_preprocessor_checks),
|
||||||
('KERNEL', kernel_preprocessor_checks),
|
('KERNEL', kernel_preprocessor_checks),
|
||||||
):
|
):
|
||||||
for n, (value, condition) in enumerate(preprocessor_checks.iteritems()):
|
for n, (value, condition) in enumerate(preprocessor_checks.items()):
|
||||||
check += dedent('''\
|
check += dedent('''\
|
||||||
#%(if)s %(condition)s
|
#%(if)s %(condition)s
|
||||||
%%%(name)s "%(value)s"
|
%%%(name)s "%(value)s"
|
||||||
@@ -269,7 +307,7 @@ def get_compiler_info(compiler, language):
|
|||||||
# have non-ASCII characters. Treat the output as bytearray.
|
# have non-ASCII characters. Treat the output as bytearray.
|
||||||
data = {}
|
data = {}
|
||||||
for line in result.splitlines():
|
for line in result.splitlines():
|
||||||
if line.startswith(b'%'):
|
if line.startswith('%'):
|
||||||
k, _, v = line.partition(' ')
|
k, _, v = line.partition(' ')
|
||||||
k = k.lstrip('%')
|
k = k.lstrip('%')
|
||||||
data[k] = v.replace(' ', '').lstrip('"').rstrip('"')
|
data[k] = v.replace(' ', '').lstrip('"').rstrip('"')
|
||||||
@@ -397,10 +435,11 @@ def check_compiler(compiler, language, target):
|
|||||||
@imports('json')
|
@imports('json')
|
||||||
@imports('subprocess')
|
@imports('subprocess')
|
||||||
@imports('sys')
|
@imports('sys')
|
||||||
|
@imports(_from='locale', _import='getpreferredencoding')
|
||||||
def get_vc_paths(topsrcdir):
|
def get_vc_paths(topsrcdir):
|
||||||
|
encoding = getpreferredencoding(False)
|
||||||
def vswhere(args):
|
def vswhere(args):
|
||||||
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
|
return json.loads(subprocess.check_output([os.path.join(topsrcdir, 'build/win32/vswhere.exe'), '-format', 'json'] + args).decode(encoding, errors='replace'))
|
||||||
return json.loads(subprocess.check_output([os.path.join(topsrcdir, 'build/win32/vswhere.exe'), '-format', 'json'] + args).decode(encoding, 'replace'))
|
|
||||||
|
|
||||||
# Can't pass -requires with -legacy, so query each separately.
|
# Can't pass -requires with -legacy, so query each separately.
|
||||||
# Legacy versions first (VS2015)
|
# Legacy versions first (VS2015)
|
||||||
@@ -419,7 +458,7 @@ def get_vc_paths(topsrcdir):
|
|||||||
# Then VS2017 and newer.
|
# Then VS2017 and newer.
|
||||||
for install in vswhere(['-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64']):
|
for install in vswhere(['-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64']):
|
||||||
path = install['installationPath']
|
path = install['installationPath']
|
||||||
tools_version = open(os.path.join(path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'rb').read().strip()
|
tools_version = open(os.path.join(path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'r', encoding=encoding, errors='replace').read().strip()
|
||||||
tools_path = os.path.join(path, r'VC\Tools\MSVC', tools_version, r'bin\HostX64')
|
tools_path = os.path.join(path, r'VC\Tools\MSVC', tools_version, r'bin\HostX64')
|
||||||
yield (Version(install['installationVersion']), {
|
yield (Version(install['installationVersion']), {
|
||||||
'x64': [os.path.join(tools_path, 'x64')],
|
'x64': [os.path.join(tools_path, 'x64')],
|
||||||
@@ -601,7 +640,7 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
|
|||||||
if cross_compiling and other_compiler.type == 'clang':
|
if cross_compiling and other_compiler.type == 'clang':
|
||||||
return namespace(**{
|
return namespace(**{
|
||||||
k: [] if k == 'flags' else v
|
k: [] if k == 'flags' else v
|
||||||
for k, v in other_compiler.__dict__.iteritems()
|
for k, v in other_compiler.__dict__.items()
|
||||||
})
|
})
|
||||||
|
|
||||||
# Normally, we'd use `var` instead of `_var`, but the interaction with
|
# Normally, we'd use `var` instead of `_var`, but the interaction with
|
||||||
|
|||||||
@@ -25,15 +25,22 @@ def configure_error(message):
|
|||||||
@imports('sys')
|
@imports('sys')
|
||||||
@imports(_from='mozbuild.configure.util', _import='LineIO')
|
@imports(_from='mozbuild.configure.util', _import='LineIO')
|
||||||
@imports(_from='mozbuild.shellutil', _import='quote')
|
@imports(_from='mozbuild.shellutil', _import='quote')
|
||||||
|
@imports(_from='mozbuild.getencoding', _import='getencoding')
|
||||||
def check_cmd_output(*args, **kwargs):
|
def check_cmd_output(*args, **kwargs):
|
||||||
|
encoding = getencoding()
|
||||||
onerror = kwargs.pop('onerror', None)
|
onerror = kwargs.pop('onerror', None)
|
||||||
|
|
||||||
with log.queue_debug():
|
with log.queue_debug():
|
||||||
log.debug('Executing: `%s`', quote(*args))
|
log.debug('Executing: `%s`', quote(*args))
|
||||||
proc = subprocess.Popen(args, stdout=subprocess.PIPE,
|
proc = subprocess.Popen(args, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
|
||||||
stdout, stderr = proc.communicate()
|
stdout, stderr = proc.communicate()
|
||||||
retcode = proc.wait()
|
retcode = proc.wait()
|
||||||
|
|
||||||
|
stdout = stdout.decode(encoding, errors='replace')
|
||||||
|
stderr = stderr.decode(encoding, errors='replace')
|
||||||
|
|
||||||
if retcode == 0:
|
if retcode == 0:
|
||||||
return stdout
|
return stdout
|
||||||
|
|
||||||
@@ -70,7 +77,7 @@ def windows_binary_type(path):
|
|||||||
Returns WindowsBinaryType constant.
|
Returns WindowsBinaryType constant.
|
||||||
"""
|
"""
|
||||||
GetBinaryTypeW = ctypes.windll.kernel32.GetBinaryTypeW
|
GetBinaryTypeW = ctypes.windll.kernel32.GetBinaryTypeW
|
||||||
GetBinaryTypeW.argtypes = [wintypes.LPWSTR, wintypes.POINTER(wintypes.DWORD)]
|
GetBinaryTypeW.argtypes = [wintypes.LPWSTR, ctypes.POINTER(wintypes.DWORD)]
|
||||||
GetBinaryTypeW.restype = wintypes.BOOL
|
GetBinaryTypeW.restype = wintypes.BOOL
|
||||||
|
|
||||||
bin_type = wintypes.DWORD()
|
bin_type = wintypes.DWORD()
|
||||||
@@ -232,7 +239,7 @@ def unique_list(l):
|
|||||||
# ('19.0', 'arm', r'C:\...\amd64_arm\cl.exe')
|
# ('19.0', 'arm', r'C:\...\amd64_arm\cl.exe')
|
||||||
# ('19.0', 'x64', r'C:\...\amd64\cl.exe')
|
# ('19.0', 'x64', r'C:\...\amd64\cl.exe')
|
||||||
# ('19.0', 'x86', r'C:\...\amd64_x86\cl.exe')
|
# ('19.0', 'x86', r'C:\...\amd64_x86\cl.exe')
|
||||||
@imports(_import='_winreg', _as='winreg')
|
@imports(_import='winreg', _as='winreg')
|
||||||
@imports(_from='__builtin__', _import='WindowsError')
|
@imports(_from='__builtin__', _import='WindowsError')
|
||||||
@imports(_from='fnmatch', _import='fnmatch')
|
@imports(_from='fnmatch', _import='fnmatch')
|
||||||
def get_registry_values(pattern):
|
def get_registry_values(pattern):
|
||||||
@@ -295,7 +302,7 @@ def get_registry_values(pattern):
|
|||||||
keys = next_keys
|
keys = next_keys
|
||||||
|
|
||||||
|
|
||||||
@imports(_from='mozbuild.configure.util', _import='Version', _as='_Version')
|
@imports(_from='mozbuild.version', _import='RichVersion', _as='_Version')
|
||||||
def Version(v):
|
def Version(v):
|
||||||
'A version number that can be compared usefully.'
|
'A version number that can be compared usefully.'
|
||||||
return _Version(v)
|
return _Version(v)
|
||||||
|
|||||||
@@ -408,9 +408,12 @@ mt = check_prog('MT', depends_win()(lambda: ('mt.exe',)), input='MT',
|
|||||||
@depends_win(mt)
|
@depends_win(mt)
|
||||||
@checking('whether MT is really Microsoft Manifest Tool', lambda x: bool(x))
|
@checking('whether MT is really Microsoft Manifest Tool', lambda x: bool(x))
|
||||||
@imports('subprocess')
|
@imports('subprocess')
|
||||||
|
@imports(_from='locale', _import='getpreferredencoding')
|
||||||
def valid_mt(path):
|
def valid_mt(path):
|
||||||
|
encoding = getpreferredencoding(False)
|
||||||
try:
|
try:
|
||||||
out = subprocess.check_output([path]).splitlines()
|
out = subprocess.check_output([path])
|
||||||
|
out = out.decode(encoding, errors='replace').splitlines()
|
||||||
out = '\n'.join(l for l in out
|
out = '\n'.join(l for l in out
|
||||||
if 'Microsoft (R) Manifest Tool' in l)
|
if 'Microsoft (R) Manifest Tool' in l)
|
||||||
if out:
|
if out:
|
||||||
|
|||||||
+13
-13
@@ -58,7 +58,7 @@ def runUtil(util, args, inputdata = None):
|
|||||||
|
|
||||||
|
|
||||||
def createRandomFile(randomFile):
|
def createRandomFile(randomFile):
|
||||||
for count in xrange(0, 2048):
|
for count in range(0, 2048):
|
||||||
randomFile.write(chr(random.randint(0, 255)))
|
randomFile.write(chr(random.randint(0, 255)))
|
||||||
|
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ def createSSLServerCertificate(build, srcDir):
|
|||||||
iterator = iter(locations)
|
iterator = iter(locations)
|
||||||
|
|
||||||
# Skips the first entry, I don't know why: bug 879740
|
# Skips the first entry, I don't know why: bug 879740
|
||||||
iterator.next()
|
next(iterator)
|
||||||
|
|
||||||
locationsParam = ""
|
locationsParam = ""
|
||||||
firstLocation = ""
|
firstLocation = ""
|
||||||
@@ -148,7 +148,7 @@ def createSSLServerCertificate(build, srcDir):
|
|||||||
firstLocation = loc.host
|
firstLocation = loc.host
|
||||||
|
|
||||||
if not firstLocation:
|
if not firstLocation:
|
||||||
print "Nothing to generate, no automatic secure hosts specified"
|
print("Nothing to generate, no automatic secure hosts specified")
|
||||||
else:
|
else:
|
||||||
createRandomFile(rndfile)
|
createRandomFile(rndfile)
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ def createSSLServerCertificate(build, srcDir):
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
print "Specify --gen-server or --gen-ca"
|
print("Specify --gen-server or --gen-ca")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
build = MozbuildObject.from_environment()
|
build = MozbuildObject.from_environment()
|
||||||
@@ -170,23 +170,23 @@ certdir = os.path.join(build.topsrcdir, "build", "pgo", "certs")
|
|||||||
if sys.argv[1] == "--gen-server":
|
if sys.argv[1] == "--gen-server":
|
||||||
certificateStatus = createSSLServerCertificate(build, certdir)
|
certificateStatus = createSSLServerCertificate(build, certdir)
|
||||||
if certificateStatus:
|
if certificateStatus:
|
||||||
print "TEST-UNEXPECTED-FAIL | SSL Server Certificate generation"
|
print("TEST-UNEXPECTED-FAIL | SSL Server Certificate generation")
|
||||||
|
|
||||||
sys.exit(certificateStatus)
|
sys.exit(certificateStatus)
|
||||||
|
|
||||||
if sys.argv[1] == "--gen-ca":
|
if sys.argv[1] == "--gen-ca":
|
||||||
certificateStatus = createCertificateAuthority(build, certdir)
|
certificateStatus = createCertificateAuthority(build, certdir)
|
||||||
if certificateStatus:
|
if certificateStatus:
|
||||||
print "TEST-UNEXPECTED-FAIL | Certificate Authority generation"
|
print("TEST-UNEXPECTED-FAIL | Certificate Authority generation")
|
||||||
else:
|
else:
|
||||||
print "\n\n"
|
print("\n\n")
|
||||||
print "==================================================="
|
print("===================================================")
|
||||||
print " IMPORTANT:"
|
print(" IMPORTANT:")
|
||||||
print " To use this new certificate authority in tests"
|
print(" To use this new certificate authority in tests")
|
||||||
print " run 'make' at testing/mochitest"
|
print(" run 'make' at testing/mochitest")
|
||||||
print "==================================================="
|
print("===================================================")
|
||||||
|
|
||||||
sys.exit(certificateStatus)
|
sys.exit(certificateStatus)
|
||||||
|
|
||||||
print "Invalid option specified"
|
print("Invalid option specified")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@@ -77,7 +77,7 @@ if __name__ == '__main__':
|
|||||||
jarlog = os.getenv("JARLOG_FILE")
|
jarlog = os.getenv("JARLOG_FILE")
|
||||||
if jarlog:
|
if jarlog:
|
||||||
env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
|
env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
|
||||||
print "jarlog: %s" % env["MOZ_JAR_LOG_FILE"]
|
print("jarlog: %s" % env["MOZ_JAR_LOG_FILE"])
|
||||||
|
|
||||||
cmdargs = ["http://localhost:%d/index.html" % PORT]
|
cmdargs = ["http://localhost:%d/index.html" % PORT]
|
||||||
runner = FirefoxRunner(profile=profile,
|
runner = FirefoxRunner(profile=profile,
|
||||||
|
|||||||
+22
-11
@@ -3,7 +3,7 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
if not len(sys.argv) is 2 or not os.path.exists(sys.argv[1]):
|
if not len(sys.argv) == 2 or not os.path.exists(sys.argv[1]):
|
||||||
print("\nYou did not supply a valid path to check.")
|
print("\nYou did not supply a valid path to check.")
|
||||||
exit(1)
|
exit(1)
|
||||||
else:
|
else:
|
||||||
@@ -44,7 +44,8 @@ PP_DIRECTIVES = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
PP_FILES = []
|
PP_FILES = []
|
||||||
PP_BAD_FILES = []
|
PP_BAD_DIRECTIVE_FILES = []
|
||||||
|
PP_BAD_ENCODING_FILES = []
|
||||||
|
|
||||||
for root, directories, filenames in os.walk(DIST_PATH):
|
for root, directories, filenames in os.walk(DIST_PATH):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
@@ -52,21 +53,31 @@ for root, directories, filenames in os.walk(DIST_PATH):
|
|||||||
PP_FILES += [ os.path.join(root, filename).replace(os.sep, '/') ]
|
PP_FILES += [ os.path.join(root, filename).replace(os.sep, '/') ]
|
||||||
|
|
||||||
for file in PP_FILES:
|
for file in PP_FILES:
|
||||||
with open(file) as fp:
|
with open(file, encoding='utf-8') as fp:
|
||||||
marker = '%' if file.endswith(PP_SPECIAL_TYPES) else '#'
|
marker = '%' if file.endswith(PP_SPECIAL_TYPES) else '#'
|
||||||
directives = tuple(marker + directive for directive in PP_DIRECTIVES)
|
directives = tuple(marker + directive for directive in PP_DIRECTIVES)
|
||||||
for line in fp:
|
try:
|
||||||
if line.startswith(directives):
|
for line in fp:
|
||||||
PP_BAD_FILES += [ file.replace(DIST_PATH + '/', '') ]
|
if line.startswith(directives):
|
||||||
|
PP_BAD_DIRECTIVE_FILES += [ file.replace(DIST_PATH + '/', '') ]
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
PP_BAD_ENCODING_FILES += [ file.replace(DIST_PATH+ '/' , '') ]
|
||||||
|
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
PP_BAD_FILES = list(dict.fromkeys(PP_BAD_FILES))
|
PP_BAD_DIRECTIVE_FILES = list(dict.fromkeys(PP_BAD_DIRECTIVE_FILES))
|
||||||
|
PP_BAD_ENCODING_FILES = list(dict.fromkeys(PP_BAD_ENCODING_FILES))
|
||||||
|
|
||||||
print('Done!')
|
print('Done!')
|
||||||
|
|
||||||
if len(PP_BAD_FILES) > 0:
|
if len(PP_BAD_DIRECTIVE_FILES) > 0:
|
||||||
print("\nWARNING: The following {0} file(s) in {1} may require preprocessing:\n".format(len(PP_BAD_FILES), DIST_PATH))
|
print("\nWARNING: The following {0} file(s) in {1} may require preprocessing:\n".format(len(PP_BAD_DIRECTIVE_FILES), DIST_PATH))
|
||||||
for file in PP_BAD_FILES:
|
for file in PP_BAD_DIRECTIVE_FILES:
|
||||||
print(file)
|
print(file)
|
||||||
|
|
||||||
exit(0)
|
if len(PP_BAD_ENCODING_FILES) > 0:
|
||||||
|
print("\nWARNING: The following {0} file(s) in {1} are not valid UTF-8:\n".format(len(PP_BAD_ENCODING_FILES), DIST_PATH))
|
||||||
|
for file in PP_BAD_ENCODING_FILES:
|
||||||
|
print(file)
|
||||||
|
|
||||||
|
sys.exit(0)
|
||||||
@@ -10,4 +10,4 @@ with open(filename, 'rU') as fh:
|
|||||||
source = fh.read()
|
source = fh.read()
|
||||||
|
|
||||||
statements = pymake.parser.parsestring(source, filename)
|
statements = pymake.parser.parsestring(source, filename)
|
||||||
print statements.to_source()
|
print(statements.to_source())
|
||||||
@@ -4,9 +4,9 @@ import sys
|
|||||||
import pymake.parser
|
import pymake.parser
|
||||||
|
|
||||||
for f in sys.argv[1:]:
|
for f in sys.argv[1:]:
|
||||||
print "Parsing %s" % f
|
print("Parsing %s" % f)
|
||||||
fd = open(f, 'rU')
|
fd = open(f, 'rU')
|
||||||
s = fd.read()
|
s = fd.read()
|
||||||
fd.close()
|
fd.close()
|
||||||
stmts = pymake.parser.parsestring(s, f)
|
stmts = pymake.parser.parsestring(s, f)
|
||||||
print stmts
|
print(stmts)
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import errno, sys, os, shutil, time
|
import errno, sys, os, shutil, time
|
||||||
from getopt import getopt, GetoptError
|
from getopt import getopt, GetoptError
|
||||||
|
|
||||||
from process import PythonException
|
from .process import PythonException
|
||||||
|
|
||||||
__all__ = ["mkdir", "rm", "sleep", "touch"]
|
__all__ = ["mkdir", "rm", "sleep", "touch"]
|
||||||
|
|
||||||
@@ -13,8 +13,8 @@ def mkdir(args):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
opts, args = getopt(args, "p", ["parents"])
|
opts, args = getopt(args, "p", ["parents"])
|
||||||
except GetoptError, e:
|
except GetoptError as e:
|
||||||
raise PythonException, ("mkdir: %s" % e, 1)
|
raise PythonException("mkdir: %s" % e, 1)
|
||||||
parents = False
|
parents = False
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o in ('-p', '--parents'):
|
if o in ('-p', '--parents'):
|
||||||
@@ -25,11 +25,11 @@ def mkdir(args):
|
|||||||
os.makedirs(f)
|
os.makedirs(f)
|
||||||
else:
|
else:
|
||||||
os.mkdir(f)
|
os.mkdir(f)
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
if e.errno == errno.EEXIST and parents:
|
if e.errno == errno.EEXIST and parents:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise PythonException, ("mkdir: %s" % e, 1)
|
raise PythonException("mkdir: %s" % e, 1)
|
||||||
|
|
||||||
def rm(args):
|
def rm(args):
|
||||||
"""
|
"""
|
||||||
@@ -38,8 +38,8 @@ def rm(args):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
opts, args = getopt(args, "rRf", ["force", "recursive"])
|
opts, args = getopt(args, "rRf", ["force", "recursive"])
|
||||||
except GetoptError, e:
|
except GetoptError as e:
|
||||||
raise PythonException, ("rm: %s" % e, 1)
|
raise PythonException("rm: %s" % e, 1)
|
||||||
force = False
|
force = False
|
||||||
recursive = False
|
recursive = False
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
@@ -50,7 +50,7 @@ def rm(args):
|
|||||||
for f in args:
|
for f in args:
|
||||||
if os.path.isdir(f):
|
if os.path.isdir(f):
|
||||||
if not recursive:
|
if not recursive:
|
||||||
raise PythonException, ("rm: cannot remove '%s': Is a directory" % f, 1)
|
raise PythonException("rm: cannot remove '%s': Is a directory" % f, 1)
|
||||||
else:
|
else:
|
||||||
shutil.rmtree(f, force)
|
shutil.rmtree(f, force)
|
||||||
elif os.path.exists(f):
|
elif os.path.exists(f):
|
||||||
@@ -58,9 +58,9 @@ def rm(args):
|
|||||||
os.unlink(f)
|
os.unlink(f)
|
||||||
except:
|
except:
|
||||||
if not force:
|
if not force:
|
||||||
raise PythonException, ("rm: failed to remove '%s': %s" % (f, sys.exc_info()[0]), 1)
|
raise PythonException("rm: failed to remove '%s': %s" % (f, sys.exc_info()[0]), 1)
|
||||||
elif not force:
|
elif not force:
|
||||||
raise PythonException, ("rm: cannot remove '%s': No such file or directory" % f, 1)
|
raise PythonException("rm: cannot remove '%s': No such file or directory" % f, 1)
|
||||||
|
|
||||||
def sleep(args):
|
def sleep(args):
|
||||||
"""
|
"""
|
||||||
@@ -70,7 +70,7 @@ def sleep(args):
|
|||||||
values = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400}
|
values = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400}
|
||||||
for a in args:
|
for a in args:
|
||||||
multiplier = 1
|
multiplier = 1
|
||||||
for k, v in values.iteritems():
|
for k, v in values.items():
|
||||||
if a.endswith(k):
|
if a.endswith(k):
|
||||||
a = a[:-1]
|
a = a[:-1]
|
||||||
multiplier = v
|
multiplier = v
|
||||||
@@ -79,7 +79,7 @@ def sleep(args):
|
|||||||
f = float(a)
|
f = float(a)
|
||||||
total += f * multiplier
|
total += f * multiplier
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise PythonException, ("sleep: invalid time interval '%s'" % a, 1)
|
raise PythonException("sleep: invalid time interval '%s'" % a, 1)
|
||||||
time.sleep(total)
|
time.sleep(total)
|
||||||
|
|
||||||
def touch(args):
|
def touch(args):
|
||||||
@@ -88,8 +88,8 @@ def touch(args):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
opts, args = getopt(args, "t:")
|
opts, args = getopt(args, "t:")
|
||||||
except GetoptError, e:
|
except GetoptError as e:
|
||||||
raise PythonException, ("touch: %s" % e, 1)
|
raise PythonException("touch: %s" % e, 1)
|
||||||
opts = dict(opts)
|
opts = dict(opts)
|
||||||
times = None
|
times = None
|
||||||
if '-t' in opts:
|
if '-t' in opts:
|
||||||
@@ -97,7 +97,7 @@ def touch(args):
|
|||||||
from time import mktime, localtime
|
from time import mktime, localtime
|
||||||
m = re.match('^(?P<Y>(?:\d\d)?\d\d)?(?P<M>\d\d)(?P<D>\d\d)(?P<h>\d\d)(?P<m>\d\d)(?:\.(?P<s>\d\d))?$', opts['-t'])
|
m = re.match('^(?P<Y>(?:\d\d)?\d\d)?(?P<M>\d\d)(?P<D>\d\d)(?P<h>\d\d)(?P<m>\d\d)(?:\.(?P<s>\d\d))?$', opts['-t'])
|
||||||
if not m:
|
if not m:
|
||||||
raise PythonException, ("touch: invalid date format '%s'" % opts['-t'], 1)
|
raise PythonException("touch: invalid date format '%s'" % opts['-t'], 1)
|
||||||
def normalized_field(m, f):
|
def normalized_field(m, f):
|
||||||
if f == 'Y':
|
if f == 'Y':
|
||||||
if m.group(f) is None:
|
if m.group(f) is None:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ except when a submake specifies -j1 when the parent make is building in parallel
|
|||||||
|
|
||||||
import os, subprocess, sys, logging, time, traceback, re
|
import os, subprocess, sys, logging, time, traceback, re
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import data, parserdata, process, util
|
from . import data, parserdata, process, util
|
||||||
|
|
||||||
# TODO: If this ever goes from relocatable package to system-installed, this may need to be
|
# TODO: If this ever goes from relocatable package to system-installed, this may need to be
|
||||||
# a configured-in path.
|
# a configured-in path.
|
||||||
@@ -62,7 +62,7 @@ def parsemakeflags(env):
|
|||||||
return opts
|
return opts
|
||||||
|
|
||||||
def _version(*args):
|
def _version(*args):
|
||||||
print """pymake: GNU-compatible make program
|
print("""pymake: GNU-compatible make program
|
||||||
Copyright (C) 2009 The Mozilla Foundation <http://www.mozilla.org/>
|
Copyright (C) 2009 The Mozilla Foundation <http://www.mozilla.org/>
|
||||||
This is free software; see the source for copying conditions.
|
This is free software; see the source for copying conditions.
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
@@ -71,7 +71,7 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
DEALINGS IN THE SOFTWARE."""
|
DEALINGS IN THE SOFTWARE.""")
|
||||||
|
|
||||||
_log = logging.getLogger('pymake.execution')
|
_log = logging.getLogger('pymake.execution')
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ class _MakeContext(object):
|
|||||||
|
|
||||||
def remakecb(self, remade, error=None):
|
def remakecb(self, remade, error=None):
|
||||||
if error is not None:
|
if error is not None:
|
||||||
print error
|
print(error)
|
||||||
self.context.defer(self.cb, 2)
|
self.context.defer(self.cb, 2)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -124,15 +124,15 @@ class _MakeContext(object):
|
|||||||
self.makefile.include(f)
|
self.makefile.include(f)
|
||||||
self.makefile.finishparsing()
|
self.makefile.finishparsing()
|
||||||
self.makefile.remakemakefiles(self.remakecb)
|
self.makefile.remakemakefiles(self.remakecb)
|
||||||
except util.MakeError, e:
|
except util.MakeError as e:
|
||||||
print e
|
print(e)
|
||||||
self.context.defer(self.cb, 2)
|
self.context.defer(self.cb, 2)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(self.targets) == 0:
|
if len(self.targets) == 0:
|
||||||
if self.makefile.defaulttarget is None:
|
if self.makefile.defaulttarget is None:
|
||||||
print "No target specified and no default target found."
|
print("No target specified and no default target found.")
|
||||||
self.context.defer(self.cb, 2)
|
self.context.defer(self.cb, 2)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ class _MakeContext(object):
|
|||||||
|
|
||||||
if not len(self.realtargets):
|
if not len(self.realtargets):
|
||||||
if self.options.printdir:
|
if self.options.printdir:
|
||||||
print "make.py[%i]: Leaving directory '%s'" % (self.makelevel, self.workdir)
|
print("make.py[%i]: Leaving directory '%s'" % (self.makelevel, self.workdir))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
self.context.defer(self.cb, 0)
|
self.context.defer(self.cb, 0)
|
||||||
@@ -255,24 +255,24 @@ def main(args, env, cwd, cb):
|
|||||||
context = process.getcontext(options.jobcount)
|
context = process.getcontext(options.jobcount)
|
||||||
|
|
||||||
if options.printdir:
|
if options.printdir:
|
||||||
print "make.py[%i]: Entering directory '%s'" % (makelevel, workdir)
|
print("make.py[%i]: Entering directory '%s'" % (makelevel, workdir))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
if len(options.makefiles) == 0:
|
if len(options.makefiles) == 0:
|
||||||
if os.path.exists(util.normaljoin(workdir, 'Makefile')):
|
if os.path.exists(util.normaljoin(workdir, 'Makefile')):
|
||||||
options.makefiles.append('Makefile')
|
options.makefiles.append('Makefile')
|
||||||
else:
|
else:
|
||||||
print "No makefile found"
|
print("No makefile found")
|
||||||
cb(2)
|
cb(2)
|
||||||
return
|
return
|
||||||
|
|
||||||
ostmts, targets, overrides = parserdata.parsecommandlineargs(arguments)
|
ostmts, targets, overrides = parserdata.parsecommandlineargs(arguments)
|
||||||
|
|
||||||
_MakeContext(makeflags, makelevel, workdir, context, env, targets, options, ostmts, overrides, cb)
|
_MakeContext(makeflags, makelevel, workdir, context, env, targets, options, ostmts, overrides, cb)
|
||||||
except (util.MakeError), e:
|
except (util.MakeError) as e:
|
||||||
print e
|
print(e)
|
||||||
if options.printdir:
|
if options.printdir:
|
||||||
print "make.py[%i]: Leaving directory '%s'" % (makelevel, workdir)
|
print("make.py[%i]: Leaving directory '%s'" % (makelevel, workdir))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
cb(2)
|
cb(2)
|
||||||
return
|
return
|
||||||
+18
-18
@@ -3,8 +3,9 @@ A representation of makefile data structures.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging, re, os, sys
|
import logging, re, os, sys
|
||||||
import parserdata, parser, functions, process, util, implicit
|
from . import parserdata, parser, functions, process, util, implicit
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
|
from functools import reduce
|
||||||
|
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
str_type = basestring
|
str_type = basestring
|
||||||
@@ -405,7 +406,7 @@ class Expansion(BaseExpansion, list):
|
|||||||
if len(a) != len(b):
|
if len(a) != len(b):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for i in xrange(len(self)):
|
for i in range(len(self)):
|
||||||
e1, is_func1 = a[i]
|
e1, is_func1 = a[i]
|
||||||
e2, is_func2 = b[i]
|
e2, is_func2 = b[i]
|
||||||
|
|
||||||
@@ -447,7 +448,7 @@ class Variables(object):
|
|||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
||||||
def readfromenvironment(self, env):
|
def readfromenvironment(self, env):
|
||||||
for k, v in env.iteritems():
|
for k, v in env.items():
|
||||||
self.set(k, self.FLAVOR_RECURSIVE, self.SOURCE_ENVIRONMENT, v)
|
self.set(k, self.FLAVOR_RECURSIVE, self.SOURCE_ENVIRONMENT, v)
|
||||||
|
|
||||||
def get(self, name, expand=True):
|
def get(self, name, expand=True):
|
||||||
@@ -547,7 +548,7 @@ class Variables(object):
|
|||||||
self.set(k, flavor, source, value)
|
self.set(k, flavor, source, value)
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
for k, (flavor, source, value, valueexp) in self._map.iteritems():
|
for k, (flavor, source, value, valueexp) in self._map.items():
|
||||||
yield k, flavor, source, value
|
yield k, flavor, source, value
|
||||||
|
|
||||||
def __contains__(self, item):
|
def __contains__(self, item):
|
||||||
@@ -864,7 +865,7 @@ class RemakeRuleContext(object):
|
|||||||
assert error in (True, False)
|
assert error in (True, False)
|
||||||
|
|
||||||
if error:
|
if error:
|
||||||
print "<%s>: Found error" % self.target.target
|
print("<%s>: Found error" % self.target.target)
|
||||||
self.error = True
|
self.error = True
|
||||||
if didanything:
|
if didanything:
|
||||||
self.didanything = True
|
self.didanything = True
|
||||||
@@ -949,8 +950,8 @@ class RemakeRuleContext(object):
|
|||||||
self.target.didanything = True
|
self.target.didanything = True
|
||||||
try:
|
try:
|
||||||
self.commands = [c for c in self.rule.getcommands(self.target, self.makefile)]
|
self.commands = [c for c in self.rule.getcommands(self.target, self.makefile)]
|
||||||
except util.MakeError, e:
|
except util.MakeError as e:
|
||||||
print e
|
print(e)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
cb(error=True)
|
cb(error=True)
|
||||||
return
|
return
|
||||||
@@ -1283,9 +1284,9 @@ class Target(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.resolvedeps(makefile, targetstack, [], False)
|
self.resolvedeps(makefile, targetstack, [], False)
|
||||||
except util.MakeError, e:
|
except util.MakeError as e:
|
||||||
if printerror:
|
if printerror:
|
||||||
print e
|
print(e)
|
||||||
self.error = True
|
self.error = True
|
||||||
self.notifydone(makefile)
|
self.notifydone(makefile)
|
||||||
return
|
return
|
||||||
@@ -1397,7 +1398,7 @@ class _CommandWrapper(object):
|
|||||||
|
|
||||||
def _cb(self, res):
|
def _cb(self, res):
|
||||||
if res != 0 and not self.ignoreErrors:
|
if res != 0 and not self.ignoreErrors:
|
||||||
print "%s: command '%s' failed, return code %i" % (self.loc, self.cline, res)
|
print("%s: command '%s' failed, return code %i" % (self.loc, self.cline, res))
|
||||||
self.usercb(error=True)
|
self.usercb(error=True)
|
||||||
else:
|
else:
|
||||||
self.usercb(error=False)
|
self.usercb(error=False)
|
||||||
@@ -1591,7 +1592,7 @@ class _RemakeContext(object):
|
|||||||
assert error in (True, False)
|
assert error in (True, False)
|
||||||
|
|
||||||
if error and self.required:
|
if error and self.required:
|
||||||
print "Error remaking makefiles (ignored)"
|
print("Error remaking makefiles (ignored)")
|
||||||
|
|
||||||
if len(self.toremake):
|
if len(self.toremake):
|
||||||
target, self.required = self.toremake.pop(0)
|
target, self.required = self.toremake.pop(0)
|
||||||
@@ -1678,7 +1679,7 @@ class Makefile(object):
|
|||||||
self.variables.set('MAKECMDGOALS', Variables.FLAVOR_SIMPLE,
|
self.variables.set('MAKECMDGOALS', Variables.FLAVOR_SIMPLE,
|
||||||
Variables.SOURCE_AUTOMATIC, ' '.join(targets))
|
Variables.SOURCE_AUTOMATIC, ' '.join(targets))
|
||||||
|
|
||||||
for vname, val in implicit.variables.iteritems():
|
for vname, val in implicit.variables.items():
|
||||||
self.variables.set(vname,
|
self.variables.set(vname,
|
||||||
Variables.FLAVOR_SIMPLE,
|
Variables.FLAVOR_SIMPLE,
|
||||||
Variables.SOURCE_IMPLICIT, val)
|
Variables.SOURCE_IMPLICIT, val)
|
||||||
@@ -1750,11 +1751,10 @@ class Makefile(object):
|
|||||||
if value is None:
|
if value is None:
|
||||||
self._vpath = []
|
self._vpath = []
|
||||||
else:
|
else:
|
||||||
self._vpath = filter(lambda e: e != '',
|
self._vpath = [e for e in re.split('[%s\s]+' % os.pathsep,
|
||||||
re.split('[%s\s]+' % os.pathsep,
|
value.resolvestr(self, self.variables, ['VPATH'])) if e != '']
|
||||||
value.resolvestr(self, self.variables, ['VPATH'])))
|
|
||||||
|
|
||||||
targets = list(self._targets.itervalues())
|
targets = list(self._targets.values())
|
||||||
for t in targets:
|
for t in targets:
|
||||||
t.explicit = True
|
t.explicit = True
|
||||||
for r in t.rules:
|
for r in t.rules:
|
||||||
@@ -1825,7 +1825,7 @@ class Makefile(object):
|
|||||||
|
|
||||||
def getsubenvironment(self, variables):
|
def getsubenvironment(self, variables):
|
||||||
env = dict(self.env)
|
env = dict(self.env)
|
||||||
for vname, v in self.exportedvars.iteritems():
|
for vname, v in self.exportedvars.items():
|
||||||
if v:
|
if v:
|
||||||
flavor, source, val = variables.get(vname)
|
flavor, source, val = variables.get(vname)
|
||||||
if val is None:
|
if val is None:
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
Makefile functions.
|
Makefile functions.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import parser, util
|
from . import parser, util
|
||||||
import subprocess, os, logging, sys
|
import subprocess, os, logging, sys
|
||||||
from globrelative import glob
|
from .globrelative import glob
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
log = logging.getLogger('pymake.data')
|
log = logging.getLogger('pymake.data')
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ class Function(object):
|
|||||||
if len(self._arguments) != len(other._arguments):
|
if len(self._arguments) != len(other._arguments):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for i in xrange(len(self._arguments)):
|
for i in range(len(self._arguments)):
|
||||||
# According to the GNU make manual Section 8.1, whitespace around
|
# According to the GNU make manual Section 8.1, whitespace around
|
||||||
# arguments is *not* part of the argument's value. So, we do a
|
# arguments is *not* part of the argument's value. So, we do a
|
||||||
# whitespace-agnostic comparison.
|
# whitespace-agnostic comparison.
|
||||||
@@ -525,7 +525,7 @@ class JoinFunction(Function):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def iterjoin(l1, l2):
|
def iterjoin(l1, l2):
|
||||||
for i in xrange(0, max(len(l1), len(l2))):
|
for i in range(0, max(len(l1), len(l2))):
|
||||||
i1 = i < len(l1) and l1[i] or ''
|
i1 = i < len(l1) and l1[i] or ''
|
||||||
i2 = i < len(l2) and l2[i] or ''
|
i2 = i < len(l2) and l2[i] or ''
|
||||||
yield i1 + i2
|
yield i1 + i2
|
||||||
@@ -670,7 +670,7 @@ class CallFunction(Function):
|
|||||||
|
|
||||||
v = data.Variables(parent=variables)
|
v = data.Variables(parent=variables)
|
||||||
v.set('0', data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, vname)
|
v.set('0', data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, vname)
|
||||||
for i in xrange(1, len(self._arguments)):
|
for i in range(1, len(self._arguments)):
|
||||||
param = self._arguments[i].resolvestr(makefile, variables, setting)
|
param = self._arguments[i].resolvestr(makefile, variables, setting)
|
||||||
v.set(str(i), data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, param)
|
v.set(str(i), data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, param)
|
||||||
|
|
||||||
@@ -770,7 +770,7 @@ class ShellFunction(Function):
|
|||||||
__slots__ = Function.__slots__
|
__slots__ = Function.__slots__
|
||||||
|
|
||||||
def resolve(self, makefile, variables, fd, setting):
|
def resolve(self, makefile, variables, fd, setting):
|
||||||
from process import prepare_command
|
from .process import prepare_command
|
||||||
cline = self._arguments[0].resolvestr(makefile, variables, setting)
|
cline = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||||
executable, cline = prepare_command(cline, makefile.workdir, self.loc)
|
executable, cline = prepare_command(cline, makefile.workdir, self.loc)
|
||||||
|
|
||||||
@@ -785,8 +785,8 @@ class ShellFunction(Function):
|
|||||||
try:
|
try:
|
||||||
p = subprocess.Popen(cline, executable=executable, env=makefile.env, shell=False,
|
p = subprocess.Popen(cline, executable=executable, env=makefile.env, shell=False,
|
||||||
stdout=subprocess.PIPE, cwd=makefile.workdir)
|
stdout=subprocess.PIPE, cwd=makefile.workdir)
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
print >>sys.stderr, "Error executing command %s" % cline[0], e
|
print("Error executing command %s" % cline[0], e, file=sys.stderr)
|
||||||
return
|
return
|
||||||
finally:
|
finally:
|
||||||
os.environ['PATH'] = oldpath
|
os.environ['PATH'] = oldpath
|
||||||
@@ -830,7 +830,7 @@ class InfoFunction(Function):
|
|||||||
|
|
||||||
def resolve(self, makefile, variables, fd, setting):
|
def resolve(self, makefile, variables, fd, setting):
|
||||||
v = self._arguments[0].resolvestr(makefile, variables, setting)
|
v = self._arguments[0].resolvestr(makefile, variables, setting)
|
||||||
print v
|
print(v)
|
||||||
|
|
||||||
functionmap = {
|
functionmap = {
|
||||||
'subst': SubstFunction,
|
'subst': SubstFunction,
|
||||||
@@ -870,4 +870,4 @@ functionmap = {
|
|||||||
'info': InfoFunction,
|
'info': InfoFunction,
|
||||||
}
|
}
|
||||||
|
|
||||||
import data
|
from . import data
|
||||||
@@ -7,7 +7,7 @@ Filename globbing like the python glob module with minor differences:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os, re, fnmatch
|
import os, re, fnmatch
|
||||||
import util
|
from . import util
|
||||||
|
|
||||||
_globcheck = re.compile('[[*?]')
|
_globcheck = re.compile('[[*?]')
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ def globpattern(dir, pattern):
|
|||||||
if not leaf.startswith('.')]
|
if not leaf.startswith('.')]
|
||||||
|
|
||||||
leaves = fnmatch.filter(leaves, pattern)
|
leaves = fnmatch.filter(leaves, pattern)
|
||||||
leaves = filter(lambda l: os.path.exists(util.normaljoin(dir, l)), leaves)
|
leaves = [l for l in leaves if os.path.exists(util.normaljoin(dir, l))]
|
||||||
|
|
||||||
leaves.sort()
|
leaves.sort()
|
||||||
return leaves
|
return leaves
|
||||||
@@ -34,7 +34,7 @@ coming.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging, re, os, sys
|
import logging, re, os, sys
|
||||||
import data, functions, util, parserdata
|
from . import data, functions, util, parserdata
|
||||||
|
|
||||||
_log = logging.getLogger('pymake.parser')
|
_log = logging.getLogger('pymake.parser')
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ _alltokens = re.compile(r'''\\*\# | # hash mark preceeded by any number of backs
|
|||||||
:: |
|
:: |
|
||||||
(?:\$(?:$|[\(\{](?:%s)\s+|.)) | # dollar sign followed by EOF, a function keyword with whitespace, or any character
|
(?:\$(?:$|[\(\{](?:%s)\s+|.)) | # dollar sign followed by EOF, a function keyword with whitespace, or any character
|
||||||
:(?![\\/]) | # colon followed by anything except a slash (Windows path detection)
|
:(?![\\/]) | # colon followed by anything except a slash (Windows path detection)
|
||||||
[=#{}();,|'"]''' % '|'.join(functions.functionmap.iterkeys()), re.VERBOSE)
|
[=#{}();,|'"]''' % '|'.join(iter(functions.functionmap.keys())), re.VERBOSE)
|
||||||
|
|
||||||
def iterdata(d, offset, tokenlist, it):
|
def iterdata(d, offset, tokenlist, it):
|
||||||
"""
|
"""
|
||||||
@@ -336,7 +336,7 @@ _conditionkeywords = {
|
|||||||
'ifndef': ifndef
|
'ifndef': ifndef
|
||||||
}
|
}
|
||||||
|
|
||||||
_conditiontokens = tuple(_conditionkeywords.iterkeys())
|
_conditiontokens = tuple(_conditionkeywords.keys())
|
||||||
_conditionre = re.compile(r'(%s)(?:$|\s+)' % '|'.join(_conditiontokens))
|
_conditionre = re.compile(r'(%s)(?:$|\s+)' % '|'.join(_conditiontokens))
|
||||||
|
|
||||||
_directivestokenlist = _conditiontokens + \
|
_directivestokenlist = _conditiontokens + \
|
||||||
@@ -691,7 +691,7 @@ def parsemakesyntax(d, offset, stopon, iterfunc):
|
|||||||
while True: # this is not a for loop because `di` changes during the function
|
while True: # this is not a for loop because `di` changes during the function
|
||||||
assert stacktop is not None
|
assert stacktop is not None
|
||||||
try:
|
try:
|
||||||
s, token, tokenoffset, offset = di.next()
|
s, token, tokenoffset, offset = next(di)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import logging, re, os
|
import logging, re, os
|
||||||
import data, parser, functions, util
|
from . import data, parser, functions, util
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
from pymake.globrelative import hasglob, glob
|
from pymake.globrelative import hasglob, glob
|
||||||
|
|
||||||
_log = logging.getLogger('pymake.data')
|
_log = logging.getLogger('pymake.data')
|
||||||
@@ -76,7 +76,7 @@ def parsecommandlineargs(args):
|
|||||||
overrides = []
|
overrides = []
|
||||||
stmts = StatementList()
|
stmts = StatementList()
|
||||||
r = []
|
r = []
|
||||||
for i in xrange(0, len(args)):
|
for i in range(0, len(args)):
|
||||||
a = args[i]
|
a = args[i]
|
||||||
|
|
||||||
vname, t, val = util.strpartition(a, ':=')
|
vname, t, val = util.strpartition(a, ':=')
|
||||||
@@ -195,7 +195,7 @@ class Rule(Statement):
|
|||||||
|
|
||||||
deps = list(_expandwildcards(makefile, data.stripdotslashes(self.depexp.resolvesplit(makefile, makefile.variables))))
|
deps = list(_expandwildcards(makefile, data.stripdotslashes(self.depexp.resolvesplit(makefile, makefile.variables))))
|
||||||
if ispattern:
|
if ispattern:
|
||||||
rule = data.PatternRule(targets, map(data.Pattern, deps), self.doublecolon, loc=self.targetexp.loc)
|
rule = data.PatternRule(targets, list(map(data.Pattern, deps)), self.doublecolon, loc=self.targetexp.loc)
|
||||||
makefile.appendimplicitrule(rule)
|
makefile.appendimplicitrule(rule)
|
||||||
else:
|
else:
|
||||||
rule = data.Rule(deps, self.doublecolon, loc=self.targetexp.loc, weakdeps=False)
|
rule = data.Rule(deps, self.doublecolon, loc=self.targetexp.loc, weakdeps=False)
|
||||||
@@ -207,7 +207,7 @@ class Rule(Statement):
|
|||||||
context.currule = rule
|
context.currule = rule
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sRule %s: %s" % (indent, self.targetexp, self.depexp)
|
print("%sRule %s: %s" % (indent, self.targetexp, self.depexp), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
sep = ':'
|
sep = ':'
|
||||||
@@ -285,7 +285,7 @@ class StaticPatternRule(Statement):
|
|||||||
context.currule = rule
|
context.currule = rule
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sStaticPatternRule %s: %s: %s" % (indent, self.targetexp, self.patternexp, self.depexp)
|
print("%sStaticPatternRule %s: %s: %s" % (indent, self.targetexp, self.patternexp, self.depexp), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
sep = ':'
|
sep = ':'
|
||||||
@@ -339,7 +339,7 @@ class Command(Statement):
|
|||||||
context.currule.addcommand(self.exp)
|
context.currule.addcommand(self.exp)
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sCommand %s" % (indent, self.exp,)
|
print("%sCommand %s" % (indent, self.exp,), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
# Commands have some interesting quirks when it comes to source
|
# Commands have some interesting quirks when it comes to source
|
||||||
@@ -438,7 +438,7 @@ class SetVariable(Statement):
|
|||||||
v.set(vname, flavor, self.source, value)
|
v.set(vname, flavor, self.source, value)
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sSetVariable<%s> %s %s\n%s %r" % (indent, self.valueloc, self.vnameexp, self.token, indent, self.value)
|
print("%sSetVariable<%s> %s %s\n%s %r" % (indent, self.valueloc, self.vnameexp, self.token, indent, self.value), file=fd)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if not isinstance(other, SetVariable):
|
if not isinstance(other, SetVariable):
|
||||||
@@ -452,7 +452,7 @@ class SetVariable(Statement):
|
|||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
chars = []
|
chars = []
|
||||||
for i in xrange(0, len(self.value)):
|
for i in range(0, len(self.value)):
|
||||||
c = self.value[i]
|
c = self.value[i]
|
||||||
|
|
||||||
# Literal # is escaped in variable assignment otherwise it would be
|
# Literal # is escaped in variable assignment otherwise it would be
|
||||||
@@ -651,14 +651,14 @@ class ConditionBlock(Statement):
|
|||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sConditionBlock" % (indent,)
|
print("%sConditionBlock" % (indent,), file=fd)
|
||||||
|
|
||||||
indent2 = indent + ' '
|
indent2 = indent + ' '
|
||||||
for c, statements in self._groups:
|
for c, statements in self._groups:
|
||||||
print >>fd, "%s Condition %s" % (indent, c)
|
print("%s Condition %s" % (indent, c), file=fd)
|
||||||
statements.dump(fd, indent2)
|
statements.dump(fd, indent2)
|
||||||
print >>fd, "%s ~Condition" % (indent,)
|
print("%s ~Condition" % (indent,), file=fd)
|
||||||
print >>fd, "%s~ConditionBlock" % (indent,)
|
print("%s~ConditionBlock" % (indent,), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
lines = []
|
lines = []
|
||||||
@@ -681,7 +681,7 @@ class ConditionBlock(Statement):
|
|||||||
if len(self) != len(other):
|
if len(self) != len(other):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for i in xrange(0, len(self)):
|
for i in range(0, len(self)):
|
||||||
our_condition, our_statements = self[i]
|
our_condition, our_statements = self[i]
|
||||||
other_condition, other_statements = other[i]
|
other_condition, other_statements = other[i]
|
||||||
|
|
||||||
@@ -793,7 +793,7 @@ class Include(Statement):
|
|||||||
makefile.include(f, self.required, loc=self.exp.loc, weak=self.weak)
|
makefile.include(f, self.required, loc=self.exp.loc, weak=self.weak)
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sInclude %s" % (indent, self.exp)
|
print("%sInclude %s" % (indent, self.exp), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
prefix = ''
|
prefix = ''
|
||||||
@@ -840,7 +840,7 @@ class VPathDirective(Statement):
|
|||||||
makefile.addvpath(pattern, dirs)
|
makefile.addvpath(pattern, dirs)
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sVPath %s" % (indent, self.exp)
|
print("%sVPath %s" % (indent, self.exp), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
return 'vpath %s' % self.exp.to_source()
|
return 'vpath %s' % self.exp.to_source()
|
||||||
@@ -885,7 +885,7 @@ class ExportDirective(Statement):
|
|||||||
makefile.exportedvars[v] = True
|
makefile.exportedvars[v] = True
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sExport (single=%s) %s" % (indent, self.single, self.exp)
|
print("%sExport (single=%s) %s" % (indent, self.single, self.exp), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
return ('export %s' % self.exp.to_source()).rstrip()
|
return ('export %s' % self.exp.to_source()).rstrip()
|
||||||
@@ -915,7 +915,7 @@ class UnexportDirective(Statement):
|
|||||||
makefile.exportedvars[v] = False
|
makefile.exportedvars[v] = False
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sUnexport %s" % (indent, self.exp)
|
print("%sUnexport %s" % (indent, self.exp), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
return 'unexport %s' % self.exp.to_source()
|
return 'unexport %s' % self.exp.to_source()
|
||||||
@@ -947,7 +947,7 @@ class EmptyDirective(Statement):
|
|||||||
raise data.DataError("Line expands to non-empty value", self.exp.loc)
|
raise data.DataError("Line expands to non-empty value", self.exp.loc)
|
||||||
|
|
||||||
def dump(self, fd, indent):
|
def dump(self, fd, indent):
|
||||||
print >>fd, "%sEmptyDirective: %s" % (indent, self.exp)
|
print("%sEmptyDirective: %s" % (indent, self.exp), file=fd)
|
||||||
|
|
||||||
def to_source(self):
|
def to_source(self):
|
||||||
return self.exp.to_source()
|
return self.exp.to_source()
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import site
|
|||||||
from collections import deque
|
from collections import deque
|
||||||
# XXXkhuey Work around http://bugs.python.org/issue1731717
|
# XXXkhuey Work around http://bugs.python.org/issue1731717
|
||||||
subprocess._cleanup = lambda: None
|
subprocess._cleanup = lambda: None
|
||||||
import command, util
|
from . import command, util
|
||||||
if sys.platform=='win32':
|
if sys.platform=='win32':
|
||||||
import win32process
|
from . import win32process
|
||||||
|
|
||||||
_log = logging.getLogger('pymake.process')
|
_log = logging.getLogger('pymake.process')
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ def tokens2re(tokens):
|
|||||||
# which matches the pattern and captures it in a named match group.
|
# which matches the pattern and captures it in a named match group.
|
||||||
# The group names and patterns come are given as a dict in the function
|
# The group names and patterns come are given as a dict in the function
|
||||||
# argument.
|
# argument.
|
||||||
nonescaped = r'(?<!\\)(?:%s)' % '|'.join('(?P<%s>%s)' % (name, value) for name, value in tokens.iteritems())
|
nonescaped = r'(?<!\\)(?:%s)' % '|'.join('(?P<%s>%s)' % (name, value) for name, value in tokens.items())
|
||||||
# The final pattern matches either the above pattern, or an escaped
|
# The final pattern matches either the above pattern, or an escaped
|
||||||
# backslash, captured in the "escape" match group.
|
# backslash, captured in the "escape" match group.
|
||||||
return re.compile('(?:%s|%s)' % (nonescaped, r'(?P<escape>\\\\)'))
|
return re.compile('(?:%s|%s)' % (nonescaped, r'(?P<escape>\\\\)'))
|
||||||
@@ -115,7 +115,7 @@ class ClineSplitter(list):
|
|||||||
self._push(self.cline[:m.start()])
|
self._push(self.cline[:m.start()])
|
||||||
self.cline = self.cline[m.end():]
|
self.cline = self.cline[m.end():]
|
||||||
|
|
||||||
match = dict([(name, value) for name, value in m.groupdict().items() if value])
|
match = dict([(name, value) for name, value in list(m.groupdict().items()) if value])
|
||||||
if 'quote' in match:
|
if 'quote' in match:
|
||||||
# " or ' start a quoted string
|
# " or ' start a quoted string
|
||||||
if match['quote'] == '"':
|
if match['quote'] == '"':
|
||||||
@@ -129,7 +129,7 @@ class ClineSplitter(list):
|
|||||||
elif 'special' in match:
|
elif 'special' in match:
|
||||||
# Unquoted, non-escaped special characters need to be sent to a
|
# Unquoted, non-escaped special characters need to be sent to a
|
||||||
# shell.
|
# shell.
|
||||||
raise MetaCharacterException, match['special']
|
raise MetaCharacterException(match['special'])
|
||||||
elif 'whitespace' in match:
|
elif 'whitespace' in match:
|
||||||
# Whitespaces terminate current argument.
|
# Whitespaces terminate current argument.
|
||||||
self._next()
|
self._next()
|
||||||
@@ -145,7 +145,7 @@ class ClineSplitter(list):
|
|||||||
self.glob = True
|
self.glob = True
|
||||||
self._push(m.group(0))
|
self._push(m.group(0))
|
||||||
else:
|
else:
|
||||||
raise Exception, "Shouldn't reach here"
|
raise Exception("Shouldn't reach here")
|
||||||
if self.arg:
|
if self.arg:
|
||||||
self._next()
|
self._next()
|
||||||
|
|
||||||
@@ -153,20 +153,20 @@ class ClineSplitter(list):
|
|||||||
# Single quoted strings are preserved, except for the final quote
|
# Single quoted strings are preserved, except for the final quote
|
||||||
index = self.cline.find("'")
|
index = self.cline.find("'")
|
||||||
if index == -1:
|
if index == -1:
|
||||||
raise Exception, 'Unterminated quoted string in command'
|
raise Exception('Unterminated quoted string in command')
|
||||||
self._push(self.cline[:index])
|
self._push(self.cline[:index])
|
||||||
self.cline = self.cline[index+1:]
|
self.cline = self.cline[index+1:]
|
||||||
|
|
||||||
def _parse_doubly_quoted(self):
|
def _parse_doubly_quoted(self):
|
||||||
if not self.cline:
|
if not self.cline:
|
||||||
raise Exception, 'Unterminated quoted string in command'
|
raise Exception('Unterminated quoted string in command')
|
||||||
while self.cline:
|
while self.cline:
|
||||||
m = _doubly_quoted_tokens.search(self.cline)
|
m = _doubly_quoted_tokens.search(self.cline)
|
||||||
if not m:
|
if not m:
|
||||||
raise Exception, 'Unterminated quoted string in command'
|
raise Exception('Unterminated quoted string in command')
|
||||||
self._push(self.cline[:m.start()])
|
self._push(self.cline[:m.start()])
|
||||||
self.cline = self.cline[m.end():]
|
self.cline = self.cline[m.end():]
|
||||||
match = dict([(name, value) for name, value in m.groupdict().items() if value])
|
match = dict([(name, value) for name, value in list(m.groupdict().items()) if value])
|
||||||
if 'quote' in match:
|
if 'quote' in match:
|
||||||
# a double quote ends the quoted string, so go back to
|
# a double quote ends the quoted string, so go back to
|
||||||
# unquoted parsing
|
# unquoted parsing
|
||||||
@@ -175,7 +175,7 @@ class ClineSplitter(list):
|
|||||||
# Unquoted, non-escaped special characters in a doubly quoted
|
# Unquoted, non-escaped special characters in a doubly quoted
|
||||||
# string still have a special meaning and need to be sent to a
|
# string still have a special meaning and need to be sent to a
|
||||||
# shell.
|
# shell.
|
||||||
raise MetaCharacterException, match['special']
|
raise MetaCharacterException(match['special'])
|
||||||
elif 'escape' in match:
|
elif 'escape' in match:
|
||||||
# Escaped backslashes turn into a single backslash
|
# Escaped backslashes turn into a single backslash
|
||||||
self._push('\\')
|
self._push('\\')
|
||||||
@@ -194,7 +194,7 @@ def clinetoargv(cline, cwd):
|
|||||||
str = _escapednewlines.sub('', cline)
|
str = _escapednewlines.sub('', cline)
|
||||||
try:
|
try:
|
||||||
args = ClineSplitter(str, cwd)
|
args = ClineSplitter(str, cwd)
|
||||||
except MetaCharacterException, e:
|
except MetaCharacterException as e:
|
||||||
return None, e.char
|
return None, e.char
|
||||||
|
|
||||||
if len(args) and args[0].find('=') != -1:
|
if len(args) and args[0].find('=') != -1:
|
||||||
@@ -327,12 +327,12 @@ class PopenJob(Job):
|
|||||||
# general overview of "subprocess PATH semantics and portability".
|
# general overview of "subprocess PATH semantics and portability".
|
||||||
oldpath = os.environ['PATH']
|
oldpath = os.environ['PATH']
|
||||||
try:
|
try:
|
||||||
if self.env is not None and self.env.has_key('PATH'):
|
if self.env is not None and 'PATH' in self.env:
|
||||||
os.environ['PATH'] = self.env['PATH']
|
os.environ['PATH'] = self.env['PATH']
|
||||||
p = subprocess.Popen(self.argv, executable=self.executable, shell=self.shell, env=self.env, cwd=self.cwd)
|
p = subprocess.Popen(self.argv, executable=self.executable, shell=self.shell, env=self.env, cwd=self.cwd)
|
||||||
return p.wait()
|
return p.wait()
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
print >>sys.stderr, e
|
print(e, file=sys.stderr)
|
||||||
return -127
|
return -127
|
||||||
finally:
|
finally:
|
||||||
os.environ['PATH'] = oldpath
|
os.environ['PATH'] = oldpath
|
||||||
@@ -383,30 +383,30 @@ class PythonJob(Job):
|
|||||||
try:
|
try:
|
||||||
__import__(self.module)
|
__import__(self.module)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print >>sys.stderr, 'Error importing %s: %s' % (
|
print('Error importing %s: %s' % (
|
||||||
self.module, e)
|
self.module, e), file=sys.stderr)
|
||||||
return -127
|
return -127
|
||||||
|
|
||||||
m = sys.modules[self.module]
|
m = sys.modules[self.module]
|
||||||
if self.method not in m.__dict__:
|
if self.method not in m.__dict__:
|
||||||
print >>sys.stderr, "No method named '%s' in module %s" % (self.method, self.module)
|
print("No method named '%s' in module %s" % (self.method, self.module), file=sys.stderr)
|
||||||
return -127
|
return -127
|
||||||
rv = m.__dict__[self.method](self.argv)
|
rv = m.__dict__[self.method](self.argv)
|
||||||
if rv != 0 and rv is not None:
|
if rv != 0 and rv is not None:
|
||||||
print >>sys.stderr, (
|
print((
|
||||||
"Native command '%s %s' returned value '%s'" %
|
"Native command '%s %s' returned value '%s'" %
|
||||||
(self.module, self.method, rv))
|
(self.module, self.method, rv)), file=sys.stderr)
|
||||||
return (rv if isinstance(rv, int) else 1)
|
return (rv if isinstance(rv, int) else 1)
|
||||||
|
|
||||||
except PythonException, e:
|
except PythonException as e:
|
||||||
print >>sys.stderr, e
|
print(e, file=sys.stderr)
|
||||||
return e.exitcode
|
return e.exitcode
|
||||||
except:
|
except:
|
||||||
e = sys.exc_info()[1]
|
e = sys.exc_info()[1]
|
||||||
if isinstance(e, SystemExit) and (e.code == 0 or e.code is None):
|
if isinstance(e, SystemExit) and (e.code == 0 or e.code is None):
|
||||||
pass # sys.exit(0) is not a failure
|
pass # sys.exit(0) is not a failure
|
||||||
else:
|
else:
|
||||||
print >>sys.stderr, e
|
print(e, file=sys.stderr)
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return -127
|
return -127
|
||||||
finally:
|
finally:
|
||||||
@@ -461,7 +461,7 @@ class ParallelContext(object):
|
|||||||
|
|
||||||
def _docall_generic(self, pool, job, cb, echo, justprint):
|
def _docall_generic(self, pool, job, cb, echo, justprint):
|
||||||
if echo is not None:
|
if echo is not None:
|
||||||
print echo
|
print(echo)
|
||||||
processcb = job.get_callback(ParallelContext._condition)
|
processcb = job.get_callback(ParallelContext._condition)
|
||||||
if justprint:
|
if justprint:
|
||||||
processcb(0)
|
processcb(0)
|
||||||
@@ -491,7 +491,7 @@ class ParallelContext(object):
|
|||||||
def _checkdone():
|
def _checkdone():
|
||||||
jobs = []
|
jobs = []
|
||||||
for c in ParallelContext._allcontexts:
|
for c in ParallelContext._allcontexts:
|
||||||
for i in xrange(0, len(c.running)):
|
for i in range(0, len(c.running)):
|
||||||
if c.running[i][0].done:
|
if c.running[i][0].done:
|
||||||
jobs.append(c.running[i])
|
jobs.append(c.running[i])
|
||||||
for j in jobs:
|
for j in jobs:
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ else:
|
|||||||
return str[:offset], token, str[offset + len(token):]
|
return str[:offset], token, str[offset + len(token):]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from __builtin__ import any
|
from builtins import any
|
||||||
except ImportError:
|
except ImportError:
|
||||||
def any(it):
|
def any(it):
|
||||||
for i in it:
|
for i in it:
|
||||||
@@ -138,7 +138,7 @@ class MostUsedCache(object):
|
|||||||
return item.o
|
return item.o
|
||||||
|
|
||||||
def verify(self):
|
def verify(self):
|
||||||
for k, v in self.d.iteritems():
|
for k, v in self.d.items():
|
||||||
if v.o:
|
if v.o:
|
||||||
assert v in self.active
|
assert v in self.active
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import pymake.data, pymake.functions, pymake.util
|
import pymake.data, pymake.functions, pymake.util
|
||||||
import unittest
|
import unittest
|
||||||
import re
|
import re
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
def multitest(cls):
|
def multitest(cls):
|
||||||
for name in cls.testdata.iterkeys():
|
for name in cls.testdata.keys():
|
||||||
def m(self, name=name):
|
def m(self, name=name):
|
||||||
return self.runSingle(*self.testdata[name])
|
return self.runSingle(*self.testdata[name])
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ class LRUTest(unittest.TestCase):
|
|||||||
c = pymake.util.LRUCache(3, self.spaceFunc, lambda k, v: k % 2)
|
c = pymake.util.LRUCache(3, self.spaceFunc, lambda k, v: k % 2)
|
||||||
self.assertEqual(tuple(c.debugitems()), ())
|
self.assertEqual(tuple(c.debugitems()), ())
|
||||||
|
|
||||||
for i in xrange(0, len(self.expected)):
|
for i in range(0, len(self.expected)):
|
||||||
k, e, fc, di = self.expected[i]
|
k, e, fc, di = self.expected[i]
|
||||||
|
|
||||||
v = c.get(k)
|
v = c.get(k)
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ class MakefileCorupusTest(TestBase):
|
|||||||
|
|
||||||
self.assertEqual(len(statements), len(new_statements))
|
self.assertEqual(len(statements), len(new_statements))
|
||||||
|
|
||||||
for i in xrange(0, len(statements)):
|
for i in range(0, len(statements)):
|
||||||
original = statements[i]
|
original = statements[i]
|
||||||
formatted = new_statements[i]
|
formatted = new_statements[i]
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import pymake.data, pymake.parser, pymake.parserdata, pymake.functions
|
|||||||
import unittest
|
import unittest
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
def multitest(cls):
|
def multitest(cls):
|
||||||
for name in cls.testdata.iterkeys():
|
for name in cls.testdata.keys():
|
||||||
def m(self, name=name):
|
def m(self, name=name):
|
||||||
return self.runSingle(*self.testdata[name])
|
return self.runSingle(*self.testdata[name])
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ class IterTest(TestBase):
|
|||||||
self.assertEqual(actual, expected)
|
self.assertEqual(actual, expected)
|
||||||
|
|
||||||
if ifunc == pymake.parser.itermakefilechars:
|
if ifunc == pymake.parser.itermakefilechars:
|
||||||
print "testing %r" % expected
|
print("testing %r" % expected)
|
||||||
self.assertEqual(pymake.parser.flattenmakesyntax(d, 0), expected)
|
self.assertEqual(pymake.parser.flattenmakesyntax(d, 0), expected)
|
||||||
|
|
||||||
multitest(IterTest)
|
multitest(IterTest)
|
||||||
@@ -207,7 +207,7 @@ class MakeSyntaxTest(TestBase):
|
|||||||
def compareRecursive(self, actual, expected, path):
|
def compareRecursive(self, actual, expected, path):
|
||||||
self.assertEqual(len(actual), len(expected),
|
self.assertEqual(len(actual), len(expected),
|
||||||
"compareRecursive: %s %r" % (path, actual))
|
"compareRecursive: %s %r" % (path, actual))
|
||||||
for i in xrange(0, len(actual)):
|
for i in range(0, len(actual)):
|
||||||
ipath = path + [i]
|
ipath = path + [i]
|
||||||
|
|
||||||
a, isfunc = actual[i]
|
a, isfunc = actual[i]
|
||||||
@@ -217,7 +217,7 @@ class MakeSyntaxTest(TestBase):
|
|||||||
else:
|
else:
|
||||||
self.assertEqual(type(a), getattr(pymake.functions, e['type']),
|
self.assertEqual(type(a), getattr(pymake.functions, e['type']),
|
||||||
"compareRecursive: %s" % (ipath,))
|
"compareRecursive: %s" % (ipath,))
|
||||||
for k, v in e.iteritems():
|
for k, v in e.items():
|
||||||
if k == 'type':
|
if k == 'type':
|
||||||
pass
|
pass
|
||||||
elif k[0] == '[':
|
elif k[0] == '[':
|
||||||
@@ -264,7 +264,7 @@ class VariableTest(TestBase):
|
|||||||
|
|
||||||
m = pymake.data.Makefile()
|
m = pymake.data.Makefile()
|
||||||
stmts.execute(m)
|
stmts.execute(m)
|
||||||
for k, v in self.expected.iteritems():
|
for k, v in self.expected.items():
|
||||||
flavor, source, val = m.variables.get(k)
|
flavor, source, val = m.variables.get(k)
|
||||||
if val is None:
|
if val is None:
|
||||||
self.assertEqual(val, v, 'variable named %s' % k)
|
self.assertEqual(val, v, 'variable named %s' % k)
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ def runTest(makefile, make, logfile, options):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if os.path.exists(opts.tempdir): shutil.rmtree(opts.tempdir)
|
if os.path.exists(opts.tempdir): shutil.rmtree(opts.tempdir)
|
||||||
os.mkdir(opts.tempdir, 0755)
|
os.mkdir(opts.tempdir, 0o755)
|
||||||
|
|
||||||
logfd = open(logfile, 'w')
|
logfd = open(logfile, 'w')
|
||||||
p = Popen(make + options['commandline'], stdout=logfd, stderr=STDOUT, env=options['env'])
|
p = Popen(make + options['commandline'], stdout=logfd, stderr=STDOUT, env=options['env'])
|
||||||
@@ -78,15 +78,15 @@ def runTest(makefile, make, logfile, options):
|
|||||||
logfd.close()
|
logfd.close()
|
||||||
|
|
||||||
if stdout.find('TEST-FAIL') != -1:
|
if stdout.find('TEST-FAIL') != -1:
|
||||||
print stdout
|
print(stdout)
|
||||||
return False, "FAIL (TEST-FAIL printed)"
|
return False, "FAIL (TEST-FAIL printed)"
|
||||||
|
|
||||||
if options['grepfor'] and stdout.find(options['grepfor']) == -1:
|
if options['grepfor'] and stdout.find(options['grepfor']) == -1:
|
||||||
print stdout
|
print(stdout)
|
||||||
return False, "FAIL (%s not in output)" % options['grepfor']
|
return False, "FAIL (%s not in output)" % options['grepfor']
|
||||||
|
|
||||||
if options['returncode'] == 0 and stdout.find('TEST-PASS') == -1:
|
if options['returncode'] == 0 and stdout.find('TEST-PASS') == -1:
|
||||||
print stdout
|
print(stdout)
|
||||||
return False, 'FAIL (No TEST-PASS printed)'
|
return False, 'FAIL (No TEST-PASS printed)'
|
||||||
|
|
||||||
if options['returncode'] != 0:
|
if options['returncode'] != 0:
|
||||||
@@ -94,7 +94,7 @@ def runTest(makefile, make, logfile, options):
|
|||||||
|
|
||||||
return True, 'PASS'
|
return True, 'PASS'
|
||||||
|
|
||||||
print "%-30s%-28s%-28s" % ("Test:", "gmake:", "pymake:")
|
print("%-30s%-28s%-28s" % ("Test:", "gmake:", "pymake:"))
|
||||||
|
|
||||||
gmakefails = 0
|
gmakefails = 0
|
||||||
pymakefails = 0
|
pymakefails = 0
|
||||||
@@ -144,7 +144,7 @@ for makefile in makefiles:
|
|||||||
if sys.platform in data:
|
if sys.platform in data:
|
||||||
d['returncode'] = data[sys.platform]
|
d['returncode'] = data[sys.platform]
|
||||||
elif key == 'environment':
|
elif key == 'environment':
|
||||||
for k, v in data.iteritems():
|
for k, v in data.items():
|
||||||
d['env'][k] = v
|
d['env'][k] = v
|
||||||
elif key == 'grep-for':
|
elif key == 'grep-for':
|
||||||
d['grepfor'] = data
|
d['grepfor'] = data
|
||||||
@@ -153,7 +153,7 @@ for makefile in makefiles:
|
|||||||
elif key == 'skip':
|
elif key == 'skip':
|
||||||
d['skip'] = True
|
d['skip'] = True
|
||||||
else:
|
else:
|
||||||
print >>sys.stderr, "%s: Unexpected #T key: %s" % (makefile, key)
|
print("%s: Unexpected #T key: %s" % (makefile, key), file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
mdata.close()
|
mdata.close()
|
||||||
@@ -190,12 +190,12 @@ for makefile in makefiles:
|
|||||||
else:
|
else:
|
||||||
pymakemsg = "OK (known fail)"
|
pymakemsg = "OK (known fail)"
|
||||||
|
|
||||||
print "%-30.30s%-28.28s%-28.28s" % (os.path.basename(makefile),
|
print("%-30.30s%-28.28s%-28.28s" % (os.path.basename(makefile),
|
||||||
gmakemsg, pymakemsg)
|
gmakemsg, pymakemsg))
|
||||||
|
|
||||||
print
|
print()
|
||||||
print "Summary:"
|
print("Summary:")
|
||||||
print "%-30s%-28s%-28s" % ("", "gmake:", "pymake:")
|
print("%-30s%-28s%-28s" % ("", "gmake:", "pymake:"))
|
||||||
|
|
||||||
if gmakefails == 0:
|
if gmakefails == 0:
|
||||||
gmakemsg = 'PASS'
|
gmakemsg = 'PASS'
|
||||||
@@ -207,7 +207,7 @@ if pymakefails == 0:
|
|||||||
else:
|
else:
|
||||||
pymakemsg = 'FAIL (%i failures)' % pymakefails
|
pymakemsg = 'FAIL (%i failures)' % pymakefails
|
||||||
|
|
||||||
print "%-30.30s%-28.28s%-28.28s" % ('', gmakemsg, pymakemsg)
|
print("%-30.30s%-28.28s%-28.28s" % ('', gmakemsg, pymakemsg))
|
||||||
|
|
||||||
shutil.rmtree(opts.tempdir)
|
shutil.rmtree(opts.tempdir)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from os import path
|
|||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
from urllib2 import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
from release.paths import makeCandidatesDir
|
from release.paths import makeCandidatesDir
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ def findOldBuildIDs(product, version, buildNumber, platforms,
|
|||||||
id = getBuildID(platform, product, version, n, nightlyDir,
|
id = getBuildID(platform, product, version, n, nightlyDir,
|
||||||
server)
|
server)
|
||||||
ids[platform].append(id)
|
ids[platform].append(id)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
log.error("Hit exception: %s" % e)
|
log.error("Hit exception: %s" % e)
|
||||||
return ids
|
return ids
|
||||||
|
|
||||||
@@ -87,10 +87,10 @@ def readBranchConfig(dir, localconfig, branch, required=[]):
|
|||||||
|
|
||||||
def readConfig(configfile, keys=[], required=[]):
|
def readConfig(configfile, keys=[], required=[]):
|
||||||
c = {}
|
c = {}
|
||||||
execfile(configfile, c)
|
exec(compile(open(configfile, "rb").read(), configfile, 'exec'), c)
|
||||||
for k in keys:
|
for k in keys:
|
||||||
c = c[k]
|
c = c[k]
|
||||||
items = c.keys()
|
items = list(c.keys())
|
||||||
err = False
|
err = False
|
||||||
for key in required:
|
for key in required:
|
||||||
if key not in items:
|
if key not in items:
|
||||||
@@ -137,7 +137,7 @@ def getReleaseName(product, version, buildNumber):
|
|||||||
|
|
||||||
|
|
||||||
def getRepoMatchingBranch(branch, sourceRepositories):
|
def getRepoMatchingBranch(branch, sourceRepositories):
|
||||||
for sr in sourceRepositories.values():
|
for sr in list(sourceRepositories.values()):
|
||||||
if branch in sr['path']:
|
if branch in sr['path']:
|
||||||
return sr
|
return sr
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import difflib
|
import difflib
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import urllib2
|
import urllib.request, urllib.error, urllib.parse
|
||||||
from util.commands import run_cmd, get_output
|
from util.commands import run_cmd, get_output
|
||||||
from util.hg import get_repo_name, make_hg_url
|
from util.hg import get_repo_name, make_hg_url
|
||||||
from subprocess import CalledProcessError
|
from subprocess import CalledProcessError
|
||||||
|
|||||||
+29
-24
@@ -13,9 +13,11 @@ import re
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import pickle
|
import pickle
|
||||||
|
from locale import getpreferredencoding
|
||||||
|
|
||||||
import mozpack.path as mozpath
|
import mozpack.path as mozpath
|
||||||
|
|
||||||
|
encoding = getpreferredencoding(False)
|
||||||
|
|
||||||
class Pool(object):
|
class Pool(object):
|
||||||
def __new__(cls, size):
|
def __new__(cls, size):
|
||||||
@@ -27,7 +29,7 @@ class Pool(object):
|
|||||||
return super(Pool, cls).__new__(cls)
|
return super(Pool, cls).__new__(cls)
|
||||||
|
|
||||||
def imap_unordered(self, fn, iterable):
|
def imap_unordered(self, fn, iterable):
|
||||||
return itertools.imap(fn, iterable)
|
return map(fn, iterable)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
pass
|
pass
|
||||||
@@ -60,7 +62,7 @@ class File(object):
|
|||||||
|
|
||||||
modified = True
|
modified = True
|
||||||
if os.path.exists(self._path):
|
if os.path.exists(self._path):
|
||||||
if open(self._path, 'rb').read() == self._content:
|
if open(self._path, 'r', encoding=encoding, errors='replace').read() == self._content:
|
||||||
modified = False
|
modified = False
|
||||||
self._modified = modified
|
self._modified = modified
|
||||||
return modified
|
return modified
|
||||||
@@ -131,11 +133,11 @@ def maybe_clear_cache(data):
|
|||||||
is_set = cache.get('ac_cv_env_%s_set' % precious) == 'set'
|
is_set = cache.get('ac_cv_env_%s_set' % precious) == 'set'
|
||||||
value = cache.get('ac_cv_env_%s_value' % precious) if is_set else None
|
value = cache.get('ac_cv_env_%s_value' % precious) if is_set else None
|
||||||
if value != env.get(precious):
|
if value != env.get(precious):
|
||||||
print 'Removing %s because of %s value change from:' \
|
print('Removing %s because of %s value change from:' \
|
||||||
% (data['cache-file'], precious)
|
% (data['cache-file'], precious))
|
||||||
print ' %s' % (value if value is not None else 'undefined')
|
print(' %s' % (value if value is not None else 'undefined'))
|
||||||
print 'to:'
|
print('to:')
|
||||||
print ' %s' % env.get(precious, 'undefined')
|
print(' %s' % env.get(precious, 'undefined'))
|
||||||
os.remove(data['cache-file'])
|
os.remove(data['cache-file'])
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@@ -160,9 +162,11 @@ def get_config_files(data):
|
|||||||
|
|
||||||
# Scan the config.status output for information about configuration files
|
# Scan the config.status output for information about configuration files
|
||||||
# it generates.
|
# it generates.
|
||||||
config_status_output = subprocess.check_output(
|
raw_output = subprocess.check_output(
|
||||||
[data['shell'], '-c', '%s --help' % config_status],
|
[data['shell'], '-c', '%s --help' % config_status],
|
||||||
stderr=subprocess.STDOUT).splitlines()
|
stderr=subprocess.STDOUT)
|
||||||
|
config_status_output = raw_output.decode(encoding,
|
||||||
|
errors='replace').splitlines()
|
||||||
state = None
|
state = None
|
||||||
for line in config_status_output:
|
for line in config_status_output:
|
||||||
if line.startswith('Configuration') and line.endswith(':'):
|
if line.startswith('Configuration') and line.endswith(':'):
|
||||||
@@ -183,7 +187,6 @@ def get_config_files(data):
|
|||||||
|
|
||||||
return config_files, command_files
|
return config_files, command_files
|
||||||
|
|
||||||
|
|
||||||
def prepare(srcdir, objdir, shell, args):
|
def prepare(srcdir, objdir, shell, args):
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--target', type=str)
|
parser.add_argument('--target', type=str)
|
||||||
@@ -232,7 +235,7 @@ def prepare(srcdir, objdir, shell, args):
|
|||||||
'args': others,
|
'args': others,
|
||||||
'shell': shell,
|
'shell': shell,
|
||||||
'srcdir': srcdir,
|
'srcdir': srcdir,
|
||||||
'env': environ,
|
'env': {str(k): str(v) for k, v in environ.items()},
|
||||||
}
|
}
|
||||||
|
|
||||||
if args.cache_file:
|
if args.cache_file:
|
||||||
@@ -249,9 +252,9 @@ def prepare(srcdir, objdir, shell, args):
|
|||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno != errno.EEXIST:
|
if e.errno != errno.EEXIST:
|
||||||
raise
|
raise
|
||||||
|
for k, v in data.items():
|
||||||
with open(data_file, 'wb') as f:
|
with open(data_file, 'wb') as f:
|
||||||
pickle.dump(data, f)
|
pickle.dump(data, f)
|
||||||
|
|
||||||
|
|
||||||
def prefix_lines(text, prefix):
|
def prefix_lines(text, prefix):
|
||||||
@@ -261,7 +264,6 @@ def prefix_lines(text, prefix):
|
|||||||
def run(objdir):
|
def run(objdir):
|
||||||
ret = 0
|
ret = 0
|
||||||
output = ''
|
output = ''
|
||||||
|
|
||||||
with open(os.path.join(objdir, CONFIGURE_DATA), 'rb') as f:
|
with open(os.path.join(objdir, CONFIGURE_DATA), 'rb') as f:
|
||||||
data = pickle.load(f)
|
data = pickle.load(f)
|
||||||
|
|
||||||
@@ -333,14 +335,16 @@ def run(objdir):
|
|||||||
# We're going to run it ourselves.
|
# We're going to run it ourselves.
|
||||||
command += ['--no-create']
|
command += ['--no-create']
|
||||||
|
|
||||||
print prefix_lines('configuring', relobjdir)
|
print(prefix_lines('configuring', relobjdir))
|
||||||
print prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir)
|
print(prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
try:
|
try:
|
||||||
output += subprocess.check_output(command,
|
raw_output = subprocess.check_output(command,
|
||||||
stderr=subprocess.STDOUT, cwd=objdir, env=data['env'])
|
stderr=subprocess.STDOUT, cwd=objdir, env=data['env'])
|
||||||
|
output += raw_output.decode(encoding, errors='replace')
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
return relobjdir, e.returncode, e.output
|
err = e.output.decode(encoding, errors='replace')
|
||||||
|
return relobjdir, e.returncode, err
|
||||||
|
|
||||||
# Leave config.status with a new timestamp if configure is newer than
|
# Leave config.status with a new timestamp if configure is newer than
|
||||||
# its original mtime.
|
# its original mtime.
|
||||||
@@ -368,12 +372,13 @@ def run(objdir):
|
|||||||
|
|
||||||
if not skip_config_status:
|
if not skip_config_status:
|
||||||
if skip_configure:
|
if skip_configure:
|
||||||
print prefix_lines('running config.status', relobjdir)
|
print(prefix_lines('running config.status', relobjdir))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
try:
|
try:
|
||||||
output += subprocess.check_output([data['shell'], '-c',
|
raw_output = subprocess.check_output([data['shell'], '-c',
|
||||||
'./config.status'], stderr=subprocess.STDOUT, cwd=objdir,
|
'./config.status'], stderr=subprocess.STDOUT, cwd=objdir,
|
||||||
env=data['env'])
|
env=data['env'])
|
||||||
|
output += raw_output.decode(encoding, errors='replace')
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
ret = e.returncode
|
ret = e.returncode
|
||||||
output += e.output
|
output += e.output
|
||||||
@@ -395,9 +400,9 @@ def subconfigure(args):
|
|||||||
args, others = parser.parse_known_args(args)
|
args, others = parser.parse_known_args(args)
|
||||||
subconfigures = args.subconfigures
|
subconfigures = args.subconfigures
|
||||||
if args.list:
|
if args.list:
|
||||||
subconfigures.extend(open(args.list, 'rb').read().splitlines())
|
subconfigures.extend(open(args.list, 'r', encoding=encoding, errors='replace').read().splitlines())
|
||||||
if args.skip:
|
if args.skip:
|
||||||
skips = set(open(args.skip, 'rb').read().splitlines())
|
skips = set(open(args.skip, 'r', encoding=encoding, errors='replace').read().splitlines())
|
||||||
subconfigures = [s for s in subconfigures if s not in skips]
|
subconfigures = [s for s in subconfigures if s not in skips]
|
||||||
|
|
||||||
if not subconfigures:
|
if not subconfigures:
|
||||||
@@ -410,7 +415,7 @@ def subconfigure(args):
|
|||||||
pool = Pool(len(subconfigures))
|
pool = Pool(len(subconfigures))
|
||||||
for relobjdir, returncode, output in \
|
for relobjdir, returncode, output in \
|
||||||
pool.imap_unordered(run, subconfigures):
|
pool.imap_unordered(run, subconfigures):
|
||||||
print prefix_lines(output, relobjdir)
|
print(prefix_lines(output, relobjdir))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
ret = max(returncode, ret)
|
ret = max(returncode, ret)
|
||||||
if ret:
|
if ret:
|
||||||
|
|||||||
@@ -290,11 +290,6 @@ fi
|
|||||||
if [ -n "$LD_LIBRARY_PATH_64" ]; then
|
if [ -n "$LD_LIBRARY_PATH_64" ]; then
|
||||||
LD_LIBRARY_PATH_64=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARY_PATH_64:+":$LD_LIBRARY_PATH_64"}
|
LD_LIBRARY_PATH_64=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARY_PATH_64:+":$LD_LIBRARY_PATH_64"}
|
||||||
fi
|
fi
|
||||||
#
|
|
||||||
#
|
|
||||||
## Set SHLIB_PATH for HPUX
|
|
||||||
SHLIB_PATH=${MOZ_DIST_BIN}:${MRE_HOME}${SHLIB_PATH:+":$SHLIB_PATH"}
|
|
||||||
#
|
|
||||||
## Set LIBPATH for AIX
|
## Set LIBPATH for AIX
|
||||||
LIBPATH=${MOZ_DIST_BIN}:${MRE_HOME}${LIBPATH:+":$LIBPATH"}
|
LIBPATH=${MOZ_DIST_BIN}:${MRE_HOME}${LIBPATH:+":$LIBPATH"}
|
||||||
#
|
#
|
||||||
@@ -339,7 +334,6 @@ then
|
|||||||
fi
|
fi
|
||||||
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
|
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
|
||||||
echo " LIBRARY_PATH=$LIBRARY_PATH"
|
echo " LIBRARY_PATH=$LIBRARY_PATH"
|
||||||
echo " SHLIB_PATH=$SHLIB_PATH"
|
|
||||||
echo " LIBPATH=$LIBPATH"
|
echo " LIBPATH=$LIBPATH"
|
||||||
echo " ADDON_PATH=$ADDON_PATH"
|
echo " ADDON_PATH=$ADDON_PATH"
|
||||||
echo " MOZ_PROGRAM=$MOZ_PROGRAM"
|
echo " MOZ_PROGRAM=$MOZ_PROGRAM"
|
||||||
@@ -350,7 +344,7 @@ then
|
|||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
|
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
|
||||||
export SHLIB_PATH LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH
|
export LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH
|
||||||
|
|
||||||
if [ $moz_debug -eq 1 ]
|
if [ $moz_debug -eq 1 ]
|
||||||
then
|
then
|
||||||
|
|||||||
+17
-17
@@ -104,10 +104,10 @@ def DoSSHCommand(command, user, host, port=None, ssh_key=None):
|
|||||||
try:
|
try:
|
||||||
output = f(cmdline, stderr=STDOUT).strip()
|
output = f(cmdline, stderr=STDOUT).strip()
|
||||||
except CalledProcessError as e:
|
except CalledProcessError as e:
|
||||||
print "failed ssh command output:"
|
print("failed ssh command output:")
|
||||||
print '=' * 20
|
print('=' * 20)
|
||||||
print e.output
|
print(e.output)
|
||||||
print '=' * 20
|
print('=' * 20)
|
||||||
raise
|
raise
|
||||||
return output
|
return output
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ def DoSCPFile(file, remote_path, user, host, port=None, ssh_key=None,
|
|||||||
"""Upload file to user@host:remote_path using scp. Optionally use
|
"""Upload file to user@host:remote_path using scp. Optionally use
|
||||||
port and ssh_key, if provided."""
|
port and ssh_key, if provided."""
|
||||||
if log:
|
if log:
|
||||||
print 'Uploading %s' % file
|
print('Uploading %s' % file)
|
||||||
cmdline = ["scp"]
|
cmdline = ["scp"]
|
||||||
AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
|
AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
|
||||||
cmdline.extend([WindowsPathToMsysPath(file),
|
cmdline.extend([WindowsPathToMsysPath(file),
|
||||||
@@ -221,8 +221,8 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
|
|||||||
if not host or not user:
|
if not host or not user:
|
||||||
return {}
|
return {}
|
||||||
if (not path and not upload_to_temp_dir) or (path and upload_to_temp_dir):
|
if (not path and not upload_to_temp_dir) or (path and upload_to_temp_dir):
|
||||||
print "One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be " + \
|
print("One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be " + \
|
||||||
"defined."
|
"defined.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if upload_to_temp_dir:
|
if upload_to_temp_dir:
|
||||||
@@ -269,18 +269,18 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
|
|||||||
|
|
||||||
if post_upload_command is not None:
|
if post_upload_command is not None:
|
||||||
if verbose:
|
if verbose:
|
||||||
print "Running post-upload command: " + post_upload_command
|
print("Running post-upload command: " + post_upload_command)
|
||||||
file_list = '"' + '" "'.join(remote_files) + '"'
|
file_list = '"' + '" "'.join(remote_files) + '"'
|
||||||
output = DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
|
output = DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
|
||||||
# We print since mozharness may parse URLs from the output stream.
|
# We print since mozharness may parse URLs from the output stream.
|
||||||
print output
|
print(output)
|
||||||
properties = GetUrlProperties(output, package)
|
properties = GetUrlProperties(output, package)
|
||||||
finally:
|
finally:
|
||||||
if upload_to_temp_dir:
|
if upload_to_temp_dir:
|
||||||
DoSSHCommand("rm -rf %s" % path, user, host, port=port,
|
DoSSHCommand("rm -rf %s" % path, user, host, port=port,
|
||||||
ssh_key=ssh_key)
|
ssh_key=ssh_key)
|
||||||
if verbose:
|
if verbose:
|
||||||
print "Upload complete"
|
print("Upload complete")
|
||||||
return properties
|
return properties
|
||||||
|
|
||||||
def CopyFilesLocally(path, files, verbose=False, base_path=None, package=None):
|
def CopyFilesLocally(path, files, verbose=False, base_path=None, package=None):
|
||||||
@@ -299,7 +299,7 @@ def CopyFilesLocally(path, files, verbose=False, base_path=None, package=None):
|
|||||||
if not os.path.exists(target_path):
|
if not os.path.exists(target_path):
|
||||||
os.makedirs(target_path)
|
os.makedirs(target_path)
|
||||||
if verbose:
|
if verbose:
|
||||||
print "Copying " + file + " to " + target_path
|
print("Copying " + file + " to " + target_path)
|
||||||
shutil.copy(file, target_path)
|
shutil.copy(file, target_path)
|
||||||
|
|
||||||
def WriteProperties(files, properties_file, url_properties, package):
|
def WriteProperties(files, properties_file, url_properties, package):
|
||||||
@@ -341,20 +341,20 @@ if __name__ == '__main__':
|
|||||||
help="Name of the main package.")
|
help="Name of the main package.")
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
if len(args) < 1:
|
if len(args) < 1:
|
||||||
print "You must specify at least one file to upload"
|
print("You must specify at least one file to upload")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if not options.properties_file:
|
if not options.properties_file:
|
||||||
print "You must specify a --properties-file"
|
print("You must specify a --properties-file")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if host == "localhost":
|
if host == "localhost":
|
||||||
if upload_to_temp_dir:
|
if upload_to_temp_dir:
|
||||||
print "Cannot use UPLOAD_TO_TEMP with UPLOAD_HOST=localhost"
|
print("Cannot use UPLOAD_TO_TEMP with UPLOAD_HOST=localhost")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if post_upload_command:
|
if post_upload_command:
|
||||||
# POST_UPLOAD_COMMAND is difficult to extract from the mozharness
|
# POST_UPLOAD_COMMAND is difficult to extract from the mozharness
|
||||||
# scripts, so just ignore it until it's no longer used anywhere
|
# scripts, so just ignore it until it's no longer used anywhere
|
||||||
print "Ignoring POST_UPLOAD_COMMAND with UPLOAD_HOST=localhost"
|
print("Ignoring POST_UPLOAD_COMMAND with UPLOAD_HOST=localhost")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if host == "localhost":
|
if host == "localhost":
|
||||||
@@ -370,6 +370,6 @@ if __name__ == '__main__':
|
|||||||
package=options.package, verbose=True)
|
package=options.package, verbose=True)
|
||||||
|
|
||||||
WriteProperties(args, options.properties_file, url_properties, options.package)
|
WriteProperties(args, options.properties_file, url_properties, options.package)
|
||||||
except IOError, (strerror):
|
except IOError as strerror:
|
||||||
print strerror
|
print(strerror)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@@ -36,7 +36,7 @@ def count_ctors(filename):
|
|||||||
# Even if we have .ctors, we shouldn't have any constructors in .ctors.
|
# Even if we have .ctors, we shouldn't have any constructors in .ctors.
|
||||||
# Complain if .ctors does not look how we expect it to.
|
# Complain if .ctors does not look how we expect it to.
|
||||||
if have_ctors and n_ctors_ctors != 0:
|
if have_ctors and n_ctors_ctors != 0:
|
||||||
print >>sys.stderr, "Unexpected .ctors contents for", filename
|
print("Unexpected .ctors contents for", filename, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return n_init_array_ctors
|
return n_init_array_ctors
|
||||||
if have_ctors:
|
if have_ctors:
|
||||||
@@ -44,7 +44,7 @@ def count_ctors(filename):
|
|||||||
|
|
||||||
# We didn't find anything; somebody switched initialization mechanisms on
|
# We didn't find anything; somebody switched initialization mechanisms on
|
||||||
# us, or the binary is completely busted. Complain either way.
|
# us, or the binary is completely busted. Complain either way.
|
||||||
print >>sys.stderr, "Couldn't find .init_array or .ctors in", filename
|
print("Couldn't find .init_array or .ctors in", filename, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@@ -60,5 +60,5 @@ if __name__ == '__main__':
|
|||||||
}]}
|
}]}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
print "PERFHERDER_DATA: %s" % json.dumps(perfherder_data)
|
print("PERFHERDER_DATA: %s" % json.dumps(perfherder_data))
|
||||||
|
|
||||||
+7
-7
@@ -2,8 +2,8 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from urlparse import urlsplit
|
from urllib.parse import urlsplit
|
||||||
from ConfigParser import RawConfigParser
|
from configparser import RawConfigParser
|
||||||
|
|
||||||
from util.commands import run_cmd, get_output, remove_path
|
from util.commands import run_cmd, get_output, remove_path
|
||||||
from util.retry import retry
|
from util.retry import retry
|
||||||
@@ -105,7 +105,7 @@ def purge(dest):
|
|||||||
try:
|
try:
|
||||||
run_cmd(['hg', '--config', 'extensions.purge=', 'purge',
|
run_cmd(['hg', '--config', 'extensions.purge=', 'purge',
|
||||||
'-a', '--all', dest], cwd=dest)
|
'-a', '--all', dest], cwd=dest)
|
||||||
except subprocess.CalledProcessError, e:
|
except subprocess.CalledProcessError as e:
|
||||||
log.debug('purge failed: %s' % e)
|
log.debug('purge failed: %s' % e)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ def out(src, remote, **kwargs):
|
|||||||
branch = "default"
|
branch = "default"
|
||||||
revs.append((rev, branch))
|
revs.append((rev, branch))
|
||||||
return revs
|
return revs
|
||||||
except subprocess.CalledProcessError, inst:
|
except subprocess.CalledProcessError as inst:
|
||||||
# In some situations, some versions of Mercurial return "1"
|
# In some situations, some versions of Mercurial return "1"
|
||||||
# if no changes are found, so we need to ignore this return code
|
# if no changes are found, so we need to ignore this return code
|
||||||
if inst.returncode == 1:
|
if inst.returncode == 1:
|
||||||
@@ -500,7 +500,7 @@ def apply_and_push(localrepo, remote, changer, max_attempts=10,
|
|||||||
push(src=localrepo, remote=remote, ssh_username=ssh_username,
|
push(src=localrepo, remote=remote, ssh_username=ssh_username,
|
||||||
ssh_key=ssh_key, force=force)
|
ssh_key=ssh_key, force=force)
|
||||||
return
|
return
|
||||||
except subprocess.CalledProcessError, e:
|
except subprocess.CalledProcessError as e:
|
||||||
log.debug("Hit error when trying to push: %s" % str(e))
|
log.debug("Hit error when trying to push: %s" % str(e))
|
||||||
if n == max_attempts:
|
if n == max_attempts:
|
||||||
log.debug("Tried %d times, giving up" % max_attempts)
|
log.debug("Tried %d times, giving up" % max_attempts)
|
||||||
@@ -515,7 +515,7 @@ def apply_and_push(localrepo, remote, changer, max_attempts=10,
|
|||||||
try:
|
try:
|
||||||
run_cmd(['hg', '--config', 'ui.merge=internal:merge',
|
run_cmd(['hg', '--config', 'ui.merge=internal:merge',
|
||||||
'rebase'], cwd=localrepo)
|
'rebase'], cwd=localrepo)
|
||||||
except subprocess.CalledProcessError, e:
|
except subprocess.CalledProcessError as e:
|
||||||
log.debug("Failed to rebase: %s" % str(e))
|
log.debug("Failed to rebase: %s" % str(e))
|
||||||
update(localrepo, branch=branch)
|
update(localrepo, branch=branch)
|
||||||
for r in reversed(new_revs):
|
for r in reversed(new_revs):
|
||||||
@@ -578,7 +578,7 @@ def adjust_paths(dest, **paths):
|
|||||||
config.add_section('paths')
|
config.add_section('paths')
|
||||||
|
|
||||||
changed = False
|
changed = False
|
||||||
for path_name, path_value in paths.items():
|
for path_name, path_value in list(paths.items()):
|
||||||
if (not config.has_option('paths', path_name) or
|
if (not config.has_option('paths', path_name) or
|
||||||
config.get('paths', path_name) != path_value):
|
config.get('paths', path_name) != path_value):
|
||||||
changed = True
|
changed = True
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ mozbuild.pth:python/mozbuild
|
|||||||
mozversioncontrol.pth:python/mozversioncontrol
|
mozversioncontrol.pth:python/mozversioncontrol
|
||||||
mozlint.pth:python/mozlint
|
mozlint.pth:python/mozlint
|
||||||
pymake.pth:build/pymake
|
pymake.pth:build/pymake
|
||||||
optional:setup.py:python/psutil:build_ext:--inplace
|
|
||||||
optional:psutil.pth:python/psutil
|
optional:psutil.pth:python/psutil
|
||||||
which.pth:python/which
|
which.pth:python/which
|
||||||
ply.pth:other-licenses/ply/
|
ply.pth:other-licenses/ply/
|
||||||
@@ -29,6 +28,7 @@ moztreedocs.pth:tools/docs
|
|||||||
packages.txt:testing/mozbase/packages.txt
|
packages.txt:testing/mozbase/packages.txt
|
||||||
objdir:build
|
objdir:build
|
||||||
gyp.pth:media/webrtc/trunk/tools/gyp/pylib
|
gyp.pth:media/webrtc/trunk/tools/gyp/pylib
|
||||||
|
six.pth:python/requests/requests/packages/urllib3/packages
|
||||||
pyasn1.pth:python/pyasn1
|
pyasn1.pth:python/pyasn1
|
||||||
pyasn1_modules.pth:python/pyasn1-modules
|
pyasn1_modules.pth:python/pyasn1-modules
|
||||||
bitstring.pth:python/bitstring
|
bitstring.pth:python/bitstring
|
||||||
|
|||||||
+13
-11
@@ -23,8 +23,8 @@ BINSCOPE_OUTPUT_LOGFILE = r".\binscope_xml_output.log"
|
|||||||
|
|
||||||
# usage
|
# usage
|
||||||
if len(sys.argv) < 3:
|
if len(sys.argv) < 3:
|
||||||
print """usage : autobinscope.by path_to_binary path_to_symbols [log_file_path]"
|
print("""usage : autobinscope.by path_to_binary path_to_symbols [log_file_path]"
|
||||||
log_file_path is optional, log will be written to .\binscope_xml_output.log by default"""
|
log_file_path is optional, log will be written to .\binscope_xml_output.log by default""")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
binary_path = sys.argv[1]
|
binary_path = sys.argv[1]
|
||||||
@@ -40,7 +40,7 @@ else:
|
|||||||
try:
|
try:
|
||||||
binscope_path = os.environ['BINSCOPE']
|
binscope_path = os.environ['BINSCOPE']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print "BINSCOPE environment variable is not set, can't check DEP/ASLR etc. status."
|
print("BINSCOPE environment variable is not set, can't check DEP/ASLR etc. status.")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -51,13 +51,15 @@ try:
|
|||||||
"/c", "CompilerVersionCheck", "/c", "SafeSEHCheck", "/c", "SNCheck",
|
"/c", "CompilerVersionCheck", "/c", "SafeSEHCheck", "/c", "SNCheck",
|
||||||
"/c", "DBCheck"], stdout=subprocess.PIPE)
|
"/c", "DBCheck"], stdout=subprocess.PIPE)
|
||||||
|
|
||||||
except WindowsError, (errno, strerror):
|
except OSError as e:
|
||||||
|
errno = e.errno
|
||||||
|
strerror = e.strerror or str(e)
|
||||||
if errno != 2 and errno != 3:
|
if errno != 2 and errno != 3:
|
||||||
print "Unexpected error ! \nError " + str(errno) + " : " + strerror + "\nExiting !\n"
|
print("Unexpected error ! \nError " + str(errno) + " : " + strerror + "\nExiting !\n")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
print "Could not locate binscope at location : %s\n" % binscope_path
|
print("Could not locate binscope at location : %s\n" % binscope_path)
|
||||||
print "Binscope wasn't installed or the BINSCOPE env variable wasn't set correctly, skipping this check and exiting..."
|
print("Binscope wasn't installed or the BINSCOPE env variable wasn't set correctly, skipping this check and exiting...")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
proc.wait()
|
proc.wait()
|
||||||
@@ -66,10 +68,10 @@ output = proc.communicate()[0]
|
|||||||
|
|
||||||
# is this a PASS or a FAIL ?
|
# is this a PASS or a FAIL ?
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
print "Error count: %d" % proc.returncode
|
print("Error count: %d" % proc.returncode)
|
||||||
print "TEST-UNEXPECTED-FAIL | autobinscope.py | %s is missing a needed Windows protection, such as /GS or ASLR" % binary_path
|
print("TEST-UNEXPECTED-FAIL | autobinscope.py | %s is missing a needed Windows protection, such as /GS or ASLR" % binary_path)
|
||||||
logfile = open(log_file_path, "r")
|
logfile = open(log_file_path, "r")
|
||||||
for line in logfile:
|
for line in logfile:
|
||||||
print(line),
|
print((line), end=' ')
|
||||||
else:
|
else:
|
||||||
print "TEST-PASS | autobinscope.py | %s succeeded" % binary_path
|
print("TEST-PASS | autobinscope.py | %s succeeded" % binary_path)
|
||||||
@@ -39,6 +39,6 @@ def MergePGOFiles(basename, pgddir, pgcdir):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
print >>sys.stderr, "Usage: pgomerge.py <binary basename> <dist/bin>"
|
print("Usage: pgomerge.py <binary basename> <dist/bin>", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2])
|
MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2])
|
||||||
@@ -40,9 +40,9 @@ if __name__ == '__main__':
|
|||||||
0, # no inherit
|
0, # no inherit
|
||||||
int(pid))
|
int(pid))
|
||||||
if handle:
|
if handle:
|
||||||
print "Process %s:" % pid
|
print("Process %s:" % pid)
|
||||||
vsize, peak_vsize = get_vmsize(handle)
|
vsize, peak_vsize = get_vmsize(handle)
|
||||||
print "peak vsize: %d" % peak_vsize
|
print("peak vsize: %d" % peak_vsize)
|
||||||
ctypes.windll.kernel32.CloseHandle(handle)
|
ctypes.windll.kernel32.CloseHandle(handle)
|
||||||
else:
|
else:
|
||||||
print "Couldn't open process %s" % pid
|
print("Couldn't open process %s" % pid)
|
||||||
@@ -200,7 +200,7 @@ def format_manifest(manifest):
|
|||||||
|
|
||||||
def write_zip(zip_path, prefix=None):
|
def write_zip(zip_path, prefix=None):
|
||||||
"""Write toolchain data to a zip file."""
|
"""Write toolchain data to a zip file."""
|
||||||
if isinstance(prefix, unicode):
|
if isinstance(prefix, str):
|
||||||
prefix = prefix.encode('utf-8')
|
prefix = prefix.encode('utf-8')
|
||||||
|
|
||||||
with JarWriter(file=zip_path, optimize=False, compress=5) as zip:
|
with JarWriter(file=zip_path, optimize=False, compress=5) as zip:
|
||||||
@@ -226,7 +226,7 @@ def write_zip(zip_path, prefix=None):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
print('usage: %s create-zip <path-prefix>' % sys.argv[0])
|
print(('usage: %s create-zip <path-prefix>' % sys.argv[0]))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
assert sys.argv[1] == 'create-zip'
|
assert sys.argv[1] == 'create-zip'
|
||||||
@@ -244,7 +244,7 @@ if __name__ == '__main__':
|
|||||||
sha256.update(data)
|
sha256.update(data)
|
||||||
sha512.update(data)
|
sha512.update(data)
|
||||||
|
|
||||||
print('Hashes of %s (size=%d)' % (destzip, len(data)))
|
print(('Hashes of %s (size=%d)' % (destzip, len(data))))
|
||||||
print('SHA-1: %s' % sha1.hexdigest())
|
print(('SHA-1: %s' % sha1.hexdigest()))
|
||||||
print('SHA-256: %s' % sha256.hexdigest())
|
print(('SHA-256: %s' % sha256.hexdigest()))
|
||||||
print('SHA-512: %s' % sha512.hexdigest())
|
print(('SHA-512: %s' % sha512.hexdigest()))
|
||||||
@@ -66,7 +66,7 @@ endif
|
|||||||
|
|
||||||
SH := /bin/sh
|
SH := /bin/sh
|
||||||
PERL ?= perl
|
PERL ?= perl
|
||||||
PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
|
PYTHON ?= $(shell which python3 > /dev/null 2>&1 && echo python3 || echo python)
|
||||||
|
|
||||||
CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
|
CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
|
||||||
ifdef CONFIG_GUESS_SCRIPT
|
ifdef CONFIG_GUESS_SCRIPT
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if topsrcdir == '':
|
|||||||
topsrcdir = '.'
|
topsrcdir = '.'
|
||||||
|
|
||||||
def check_call_noisy(cmd, *args, **kwargs):
|
def check_call_noisy(cmd, *args, **kwargs):
|
||||||
print "Executing command:", cmd
|
print("Executing command:", cmd)
|
||||||
check_call(cmd, *args, **kwargs)
|
check_call(cmd, *args, **kwargs)
|
||||||
|
|
||||||
def do_hg_pull(dir, repository, hg):
|
def do_hg_pull(dir, repository, hg):
|
||||||
@@ -67,22 +67,22 @@ def do_cvs_export(modules, tag, cvsroot, cvs):
|
|||||||
cvs_module = module_tuple[1]
|
cvs_module = module_tuple[1]
|
||||||
fullpath = os.path.join(topsrcdir, module)
|
fullpath = os.path.join(topsrcdir, module)
|
||||||
if os.path.exists(fullpath):
|
if os.path.exists(fullpath):
|
||||||
print "Removing '%s'" % fullpath
|
print("Removing '%s'" % fullpath)
|
||||||
shutil.rmtree(fullpath)
|
shutil.rmtree(fullpath)
|
||||||
|
|
||||||
(parent, leaf) = os.path.split(module)
|
(parent, leaf) = os.path.split(module)
|
||||||
print "CVS export begin: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
|
print("CVS export begin: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC"))
|
||||||
check_call_noisy([cvs, '-d', cvsroot,
|
check_call_noisy([cvs, '-d', cvsroot,
|
||||||
'export', '-r', tag, '-d', leaf, cvs_module],
|
'export', '-r', tag, '-d', leaf, cvs_module],
|
||||||
cwd=os.path.join(topsrcdir, parent))
|
cwd=os.path.join(topsrcdir, parent))
|
||||||
print "CVS export end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
|
print("CVS export end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC"))
|
||||||
|
|
||||||
def toggle_trailing_blank_line(depname):
|
def toggle_trailing_blank_line(depname):
|
||||||
"""If the trailing line is empty, then we'll delete it.
|
"""If the trailing line is empty, then we'll delete it.
|
||||||
Otherwise we'll add a blank line."""
|
Otherwise we'll add a blank line."""
|
||||||
lines = open(depname, "r").readlines()
|
lines = open(depname, "r").readlines()
|
||||||
if not lines:
|
if not lines:
|
||||||
print >>sys.stderr, "unexpected short file"
|
print("unexpected short file", file=sys.stderr)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not lines[-1].strip():
|
if not lines[-1].strip():
|
||||||
@@ -95,7 +95,7 @@ def toggle_trailing_blank_line(depname):
|
|||||||
def get_trailing_blank_line_state(depname):
|
def get_trailing_blank_line_state(depname):
|
||||||
lines = open(depname, "r").readlines()
|
lines = open(depname, "r").readlines()
|
||||||
if not lines:
|
if not lines:
|
||||||
print >>sys.stderr, "unexpected short file"
|
print("unexpected short file", file=sys.stderr)
|
||||||
return "no blank line"
|
return "no blank line"
|
||||||
|
|
||||||
if not lines[-1].strip():
|
if not lines[-1].strip():
|
||||||
@@ -104,18 +104,18 @@ def get_trailing_blank_line_state(depname):
|
|||||||
return "no blank line"
|
return "no blank line"
|
||||||
|
|
||||||
def update_nspr_or_nss(tag, depfile, destination, hgpath):
|
def update_nspr_or_nss(tag, depfile, destination, hgpath):
|
||||||
print "reverting to HG version of %s to get its blank line state" % depfile
|
print("reverting to HG version of %s to get its blank line state" % depfile)
|
||||||
check_call_noisy([options.hg, 'revert', depfile])
|
check_call_noisy([options.hg, 'revert', depfile])
|
||||||
old_state = get_trailing_blank_line_state(depfile)
|
old_state = get_trailing_blank_line_state(depfile)
|
||||||
print "old state of %s is: %s" % (depfile, old_state)
|
print("old state of %s is: %s" % (depfile, old_state))
|
||||||
do_hg_replace(destination, hgpath, tag, HG_EXCLUSIONS, options.hg)
|
do_hg_replace(destination, hgpath, tag, HG_EXCLUSIONS, options.hg)
|
||||||
new_state = get_trailing_blank_line_state(depfile)
|
new_state = get_trailing_blank_line_state(depfile)
|
||||||
print "new state of %s is: %s" % (depfile, new_state)
|
print("new state of %s is: %s" % (depfile, new_state))
|
||||||
if old_state == new_state:
|
if old_state == new_state:
|
||||||
print "toggling blank line in: ", depfile
|
print("toggling blank line in: ", depfile)
|
||||||
toggle_trailing_blank_line(depfile)
|
toggle_trailing_blank_line(depfile)
|
||||||
tag_file = destination + "/TAG-INFO"
|
tag_file = destination + "/TAG-INFO"
|
||||||
print >>file(tag_file, "w"), tag
|
print(tag, file=file(tag_file, "w"))
|
||||||
|
|
||||||
o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname")
|
o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname")
|
||||||
o.add_option("--skip-mozilla", dest="skip_mozilla",
|
o.add_option("--skip-mozilla", dest="skip_mozilla",
|
||||||
@@ -139,7 +139,7 @@ except IndexError:
|
|||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
if action in ('checkout', 'co'):
|
if action in ('checkout', 'co'):
|
||||||
print >>sys.stderr, "Warning: client.py checkout is obsolete."
|
print("Warning: client.py checkout is obsolete.", file=sys.stderr)
|
||||||
pass
|
pass
|
||||||
elif action in ('update_nspr'):
|
elif action in ('update_nspr'):
|
||||||
tag, = args[1:]
|
tag, = args[1:]
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class ZipFile(zipfile.ZipFile):
|
|||||||
date_time=time.localtime(time.time()))
|
date_time=time.localtime(time.time()))
|
||||||
zinfo.compress_type = self.compression
|
zinfo.compress_type = self.compression
|
||||||
# Add some standard UNIX file access permissions (-rw-r--r--).
|
# Add some standard UNIX file access permissions (-rw-r--r--).
|
||||||
zinfo.external_attr = (0x81a4 & 0xFFFF) << 16L
|
zinfo.external_attr = (0x81a4 & 0xFFFF) << 16
|
||||||
else:
|
else:
|
||||||
zinfo = zinfo_or_arcname
|
zinfo = zinfo_or_arcname
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class ZipFile(zipfile.ZipFile):
|
|||||||
# as the old, reuse the existing entry.
|
# as the old, reuse the existing entry.
|
||||||
|
|
||||||
doSeek = False # store if we need to seek to the eof after overwriting
|
doSeek = False # store if we need to seek to the eof after overwriting
|
||||||
if self.NameToInfo.has_key(zinfo.filename):
|
if zinfo.filename in self.NameToInfo:
|
||||||
# Find the last ZipInfo with our name.
|
# Find the last ZipInfo with our name.
|
||||||
# Last, because that's catching multiple overwrites
|
# Last, because that's catching multiple overwrites
|
||||||
i = len(self.filelist)
|
i = len(self.filelist)
|
||||||
@@ -109,14 +109,14 @@ class ZipFile(zipfile.ZipFile):
|
|||||||
# adjust file mode if we originally just wrote, now we rewrite
|
# adjust file mode if we originally just wrote, now we rewrite
|
||||||
self.fp.close()
|
self.fp.close()
|
||||||
self.fp = open(self.filename, 'r+b')
|
self.fp = open(self.filename, 'r+b')
|
||||||
all = map(lambda zi: (zi, True), self.filelist) + \
|
all = [(zi, True) for zi in self.filelist] + \
|
||||||
map(lambda zi: (zi, False), self._remove)
|
[(zi, False) for zi in self._remove]
|
||||||
all.sort(lambda l, r: cmp(l[0].header_offset, r[0].header_offset))
|
all.sort(lambda l, r: cmp(l[0].header_offset, r[0].header_offset))
|
||||||
# empty _remove for multiple closes
|
# empty _remove for multiple closes
|
||||||
self._remove = []
|
self._remove = []
|
||||||
|
|
||||||
lengths = [all[i+1][0].header_offset - all[i][0].header_offset
|
lengths = [all[i+1][0].header_offset - all[i][0].header_offset
|
||||||
for i in xrange(len(all)-1)]
|
for i in range(len(all)-1)]
|
||||||
lengths.append(self.end - all[-1][0].header_offset)
|
lengths.append(self.end - all[-1][0].header_offset)
|
||||||
to_pos = 0
|
to_pos = 0
|
||||||
for (zi, keep), length in zip(all, lengths):
|
for (zi, keep), length in zip(all, lengths):
|
||||||
|
|||||||
@@ -0,0 +1,354 @@
|
|||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*
|
||||||
|
* C++ replacement for mozbuild/action/cl.py that wraps cl.exe on Windows.
|
||||||
|
* This is a Windows-only host tool, built well before XPCOM.
|
||||||
|
*/
|
||||||
|
#include <windows.h>
|
||||||
|
#include <string> // We don't use XPCOM string classes here.
|
||||||
|
#include <vector>
|
||||||
|
#include <fstream>
|
||||||
|
#include <algorithm>
|
||||||
|
#pragma warning(disable:4530)
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
/* Make passed argv into a command line for cl.exe */
|
||||||
|
static wstring quoteArg(const wstring& aCmdArgv) {
|
||||||
|
bool addQuotes = aCmdArgv.find_first_of(L" \t\"") != wstring::npos;
|
||||||
|
|
||||||
|
if (!addQuotes) {
|
||||||
|
return aCmdArgv;
|
||||||
|
}
|
||||||
|
|
||||||
|
wstring out = L"\"";
|
||||||
|
size_t backslash = 0;
|
||||||
|
|
||||||
|
for (wchar_t ch : aCmdArgv) {
|
||||||
|
if (ch == L'\\') {
|
||||||
|
backslash++;
|
||||||
|
} else if (ch == L'"') {
|
||||||
|
// Escape all backslashes before a quote
|
||||||
|
out.append(backslash * 2, L'\\');
|
||||||
|
backslash = 0;
|
||||||
|
out += L"\\\"";
|
||||||
|
} else {
|
||||||
|
out.append(backslash, L'\\');
|
||||||
|
backslash = 0;
|
||||||
|
out += ch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
out.append(backslash * 2, L'\\');
|
||||||
|
out += L"\"";
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We need to detect the showIncludes prefix to extract raw paths for
|
||||||
|
dep files, and drop the lines from display to avoid console spam. */
|
||||||
|
static string showIncludesPrefixDetection(const string& aLine) {
|
||||||
|
// Look for absolute Windows paths
|
||||||
|
size_t pos = string::npos;
|
||||||
|
|
||||||
|
// Drive letter: C:\...
|
||||||
|
for (size_t i = 0; i + 2 < aLine.size(); i++) {
|
||||||
|
if (isalpha((unsigned char)aLine[i]) &&
|
||||||
|
aLine[i + 1] == ':' &&
|
||||||
|
(aLine[i + 2] == '\\' || aLine[i + 2] == '/')) {
|
||||||
|
pos = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UNC path: \\server\share
|
||||||
|
if (pos == string::npos) {
|
||||||
|
if (aLine.size() >= 2 && aLine[0] == '\\' && aLine[1] == '\\') {
|
||||||
|
pos = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pos == string::npos) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prefix is everything before the path
|
||||||
|
return aLine.substr(0, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Extract the header path from an include line using the known prefix */
|
||||||
|
static string extractHeaderPath(const string& aLine, const string& aPrefix) {
|
||||||
|
if (aLine.rfind(aPrefix, 0) != 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Strip prefix
|
||||||
|
string path = aLine.substr(aPrefix.size());
|
||||||
|
|
||||||
|
// Trim leading whitespace
|
||||||
|
while (!path.empty() && (path[0] == ' ' || path[0] == '\t')) {
|
||||||
|
path.erase(0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove trailing newline
|
||||||
|
if (!path.empty() && (path.back() == '\n' || path.back() == '\r')) {
|
||||||
|
path.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Sanitize a dependency path for Makefile depfiles.
|
||||||
|
Performs:
|
||||||
|
1. Strip trailing CR/LF
|
||||||
|
2. Strip leading MSVC indentation
|
||||||
|
3. Normalize slashes to '/'
|
||||||
|
4. Escape spaces and backslashes for Make */
|
||||||
|
static string sanitizeMakeDeps(string aLine) {
|
||||||
|
// 1. Strip trailing CR/LF
|
||||||
|
while (!aLine.empty() && (aLine.back() == '\r' || aLine.back() == '\n')) {
|
||||||
|
aLine.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Strip leading indentation (MSVC indents include lines)
|
||||||
|
while (!aLine.empty() && (aLine.front() == ' ' || aLine.front() == '\t')) {
|
||||||
|
aLine.erase(aLine.begin());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Normalize slashes
|
||||||
|
for (char& ch : aLine) {
|
||||||
|
if (ch == '\\') {
|
||||||
|
ch = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. Escape for Make
|
||||||
|
string out;
|
||||||
|
out.reserve(aLine.size() * 2);
|
||||||
|
|
||||||
|
for (char ch : aLine) {
|
||||||
|
if (ch == ' ') {
|
||||||
|
out += "\\ ";
|
||||||
|
} else if (ch == '\\') {
|
||||||
|
// After normalization this shouldn't occur, but safe anyway
|
||||||
|
out += "\\\\";
|
||||||
|
} else {
|
||||||
|
out += ch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* MSYS1 does not use wide APIs, so ensure we get the narrow version here. */
|
||||||
|
static string getWinEnvVar(const char* aName) {
|
||||||
|
char buffer[32768];
|
||||||
|
DWORD length = GetEnvironmentVariableA(aName, buffer, sizeof(buffer));
|
||||||
|
|
||||||
|
if (length == 0 || length >= sizeof(buffer)) {
|
||||||
|
return string();
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(buffer, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Exclude system headers by ignoring anything not in our directories.
|
||||||
|
* We don't know where people will put their objdir, so it has to be
|
||||||
|
* tracked separately.
|
||||||
|
*/
|
||||||
|
static bool isProjectDep(const string& aPath,
|
||||||
|
const string& aTopSrcDir,
|
||||||
|
const string& aTopObjDir) {
|
||||||
|
// We need forward slashes for our build system.
|
||||||
|
auto norm = [](string aStr) {
|
||||||
|
replace(aStr.begin(), aStr.end(), '\\', '/');
|
||||||
|
return aStr;
|
||||||
|
};
|
||||||
|
|
||||||
|
string path = norm(aPath);
|
||||||
|
string topSrcDir = norm(aTopSrcDir);
|
||||||
|
string topObjDir = norm(aTopObjDir);
|
||||||
|
|
||||||
|
// Must be absolute or relative under one of the two roots
|
||||||
|
return (path.rfind(topSrcDir, 0) == 0) ||
|
||||||
|
(path.rfind(topObjDir, 0) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Read stdout from the compiler pipe line-by-line, filtering include
|
||||||
|
lines and collecting dependency paths. */
|
||||||
|
static vector<string> processOutput(HANDLE aReadPipe) {
|
||||||
|
string lineBuf;
|
||||||
|
vector<string> deps;
|
||||||
|
string topSrcDir = getWinEnvVar("CL_TOPSRCDIR");
|
||||||
|
string topObjDir = getWinEnvVar("CL_TOPOBJDIR");
|
||||||
|
char buffer[4096];
|
||||||
|
DWORD bytesRead;
|
||||||
|
|
||||||
|
string includePrefix;
|
||||||
|
bool prefixFound = false;
|
||||||
|
|
||||||
|
while (ReadFile(aReadPipe, buffer, sizeof(buffer), &bytesRead, nullptr)) {
|
||||||
|
lineBuf.append(buffer, bytesRead);
|
||||||
|
|
||||||
|
size_t pos;
|
||||||
|
while ((pos = lineBuf.find('\n')) != string::npos) {
|
||||||
|
string line = lineBuf.substr(0, pos + 1);
|
||||||
|
lineBuf.erase(0, pos + 1);
|
||||||
|
|
||||||
|
if (!prefixFound) {
|
||||||
|
string maybe = showIncludesPrefixDetection(line);
|
||||||
|
if (!maybe.empty()) {
|
||||||
|
includePrefix = maybe;
|
||||||
|
prefixFound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If prefix is known and this line starts with it, it's an include line
|
||||||
|
if (prefixFound && line.rfind(includePrefix, 0) == 0) {
|
||||||
|
string header = extractHeaderPath(line, includePrefix);
|
||||||
|
if (!header.empty()) {
|
||||||
|
header = sanitizeMakeDeps(header);
|
||||||
|
if (isProjectDep(header, topSrcDir, topObjDir)) {
|
||||||
|
deps.push_back(header);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// This is an include line, don't print it
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, just print
|
||||||
|
fwrite(line.data(), 1, line.size(), stdout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!lineBuf.empty()) {
|
||||||
|
fwrite(lineBuf.data(), 1, lineBuf.size(), stdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
return deps;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Convert a UTF-16 wide string to a UTF-8 narrow string. */
|
||||||
|
static string wideToUtf8(const wstring& aWide) {
|
||||||
|
if (aWide.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
int len = WideCharToMultiByte(CP_UTF8, 0, aWide.c_str(), -1, nullptr, 0, nullptr, nullptr);
|
||||||
|
|
||||||
|
string out(len - 1, '\0');
|
||||||
|
|
||||||
|
WideCharToMultiByte(CP_UTF8, 0, aWide.c_str(), -1, &out[0], len - 1, nullptr, nullptr);
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Compute the .pp depfile path next to the given object file. */
|
||||||
|
static string makeDepfilePath(const string& aObjUtf8) {
|
||||||
|
size_t pos = aObjUtf8.find_last_of("/\\");
|
||||||
|
string dir = (pos == string::npos) ? "" : aObjUtf8.substr(0, pos + 1);
|
||||||
|
string base = (pos == string::npos) ? aObjUtf8 : aObjUtf8.substr(pos + 1);
|
||||||
|
|
||||||
|
return dir + ".deps/" + base + ".pp";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Write a Make-style dependency file for the given object and dep list. */
|
||||||
|
static void writeDepfile(const wstring& aObjFile, const vector<string>& aDeps) {
|
||||||
|
string objUtf8 = wideToUtf8(aObjFile);
|
||||||
|
string ppName = makeDepfilePath(objUtf8);
|
||||||
|
|
||||||
|
ofstream out(ppName);
|
||||||
|
out << objUtf8 << ":";
|
||||||
|
|
||||||
|
for (auto& dep : aDeps) {
|
||||||
|
out << " " << dep;
|
||||||
|
}
|
||||||
|
|
||||||
|
out << "\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
int wmain(int argc, wchar_t** argv) {
|
||||||
|
if (argc < 2) {
|
||||||
|
fwprintf(stderr, L"Usage: action_cl.exe <compiler> [args...]\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const wchar_t* compiler = argv[1];
|
||||||
|
|
||||||
|
// Build command line
|
||||||
|
wstring cmd = quoteArg(compiler);
|
||||||
|
wstring objFile;
|
||||||
|
wstring sourceFile;
|
||||||
|
cmd += L" -showIncludes";
|
||||||
|
|
||||||
|
for (int i = 2; i < argc; i++) {
|
||||||
|
cmd += L" ";
|
||||||
|
cmd += quoteArg(argv[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<wchar_t> cmdLine(cmd.begin(), cmd.end());
|
||||||
|
cmdLine.push_back(L'\0');
|
||||||
|
|
||||||
|
for (int i = 2; i < argc; i++) {
|
||||||
|
wstring arg = argv[i];
|
||||||
|
|
||||||
|
if (arg.rfind(L"/Fo", 0) == 0 || arg.rfind(L"-Fo", 0) == 0) {
|
||||||
|
objFile = arg.substr(3); // strip /Fo or -Fo
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!arg.empty() && arg[0] != L'-' && arg[0] != L'/') {
|
||||||
|
sourceFile = arg; // last non-flag argument is the source file
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create pipe for capturing stdout
|
||||||
|
HANDLE readPipe, writePipe;
|
||||||
|
SECURITY_ATTRIBUTES sa = { sizeof(sa), nullptr, TRUE };
|
||||||
|
|
||||||
|
if (!CreatePipe(&readPipe, &writePipe, &sa, 0)) {
|
||||||
|
fwprintf(stderr, L"Failed to create pipe\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetHandleInformation(readPipe, HANDLE_FLAG_INHERIT, 0);
|
||||||
|
|
||||||
|
STARTUPINFOW si = { sizeof(si) };
|
||||||
|
si.dwFlags = STARTF_USESTDHANDLES;
|
||||||
|
si.hStdOutput = writePipe;
|
||||||
|
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||||
|
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||||
|
PROCESS_INFORMATION pi;
|
||||||
|
|
||||||
|
BOOL ok = CreateProcessW(nullptr, cmdLine.data(), nullptr, nullptr, TRUE, 0, nullptr, nullptr, &si, &pi);
|
||||||
|
|
||||||
|
CloseHandle(writePipe);
|
||||||
|
|
||||||
|
if (!ok) {
|
||||||
|
fwprintf(stderr, L"Failed to launch compiler: %ls (error %lu)\n", compiler, GetLastError());
|
||||||
|
CloseHandle(readPipe);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read compiler output and collect dependencies
|
||||||
|
auto deps = processOutput(readPipe);
|
||||||
|
CloseHandle(readPipe);
|
||||||
|
|
||||||
|
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||||
|
|
||||||
|
DWORD exitCode = 0;
|
||||||
|
GetExitCodeProcess(pi.hProcess, &exitCode);
|
||||||
|
|
||||||
|
// Write the depfile only if we know the output object path
|
||||||
|
if (!objFile.empty()) {
|
||||||
|
string srcUtf8 = wideToUtf8(sourceFile);
|
||||||
|
deps.insert(deps.begin(), sanitizeMakeDeps(srcUtf8));
|
||||||
|
writeDepfile(objFile, deps);
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseHandle(pi.hProcess);
|
||||||
|
CloseHandle(pi.hThread);
|
||||||
|
|
||||||
|
return exitCode;
|
||||||
|
}
|
||||||
@@ -275,7 +275,7 @@ def check_style():
|
|||||||
edges[inclname] = set()
|
edges[inclname] = set()
|
||||||
|
|
||||||
# Process all the JS files.
|
# Process all the JS files.
|
||||||
for filename in js_names.keys():
|
for filename in list(js_names.keys()):
|
||||||
inclname = js_names[filename]
|
inclname = js_names[filename]
|
||||||
file_kind = FileKind.get(filename)
|
file_kind = FileKind.get(filename)
|
||||||
if file_kind == FileKind.C or file_kind == FileKind.CPP or \
|
if file_kind == FileKind.C or file_kind == FileKind.CPP or \
|
||||||
|
|||||||
+4
-3
@@ -120,8 +120,8 @@ CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
|
|||||||
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
|
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
|
||||||
|
|
||||||
ifdef _MSC_VER
|
ifdef _MSC_VER
|
||||||
CC_WRAPPER ?= $(call py_action,cl)
|
CC_WRAPPER ?= $(DEPTH)/config/action_cl$(BIN_SUFFIX)
|
||||||
CXX_WRAPPER ?= $(call py_action,cl)
|
CXX_WRAPPER ?= $(DEPTH)/config/action_cl$(BIN_SUFFIX)
|
||||||
endif # _MSC_VER
|
endif # _MSC_VER
|
||||||
|
|
||||||
CC := $(CC_WRAPPER) $(CC)
|
CC := $(CC_WRAPPER) $(CC)
|
||||||
@@ -562,7 +562,8 @@ endif
|
|||||||
|
|
||||||
PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply
|
PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply
|
||||||
|
|
||||||
export CL_INCLUDES_PREFIX
|
export CL_TOPOBJDIR = $(MOZ_BUILD_ROOT)
|
||||||
|
export CL_TOPSRCDIR = $(EXTERNAL_SOURCE_DIR)
|
||||||
# Make sure that the build system can handle non-ASCII characters
|
# Make sure that the build system can handle non-ASCII characters
|
||||||
# in environment variables to prevent it from breking silently on
|
# in environment variables to prevent it from breking silently on
|
||||||
# non-English systems.
|
# non-English systems.
|
||||||
|
|||||||
@@ -56,10 +56,12 @@ def generate_precomplete(root_path):
|
|||||||
precomplete_file = open(precomplete_file_path, "wb")
|
precomplete_file = open(precomplete_file_path, "wb")
|
||||||
rel_file_path_list, rel_dir_path_list = get_build_entries(root_path)
|
rel_file_path_list, rel_dir_path_list = get_build_entries(root_path)
|
||||||
for rel_file_path in rel_file_path_list:
|
for rel_file_path in rel_file_path_list:
|
||||||
precomplete_file.writelines("remove \""+rel_file_path+"\"\n")
|
line = "remove \""+rel_file_path+"\"\n"
|
||||||
|
precomplete_file.write(line.encode('utf-8'))
|
||||||
|
|
||||||
for rel_dir_path in rel_dir_path_list:
|
for rel_dir_path in rel_dir_path_list:
|
||||||
precomplete_file.writelines("rmdir \""+rel_dir_path+"\"\n")
|
line = "rmdir \""+rel_dir_path+"\"\n"
|
||||||
|
precomplete_file.write(line.encode('utf-8'))
|
||||||
|
|
||||||
precomplete_file.close()
|
precomplete_file.close()
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ def ensureParentDir(file):
|
|||||||
if dir and not os.path.exists(dir):
|
if dir and not os.path.exists(dir):
|
||||||
try:
|
try:
|
||||||
os.makedirs(dir)
|
os.makedirs(dir)
|
||||||
except OSError, error:
|
except OSError as error:
|
||||||
if error.errno != errno.EEXIST:
|
if error.errno != errno.EEXIST:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@@ -140,4 +140,4 @@ class ExpandArgs(list):
|
|||||||
return [relativize(arg)]
|
return [relativize(arg)]
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print " ".join(ExpandArgs(sys.argv[1:]))
|
print(" ".join(ExpandArgs(sys.argv[1:])))
|
||||||
@@ -305,11 +305,11 @@ class SectionFinder(object):
|
|||||||
return syms
|
return syms
|
||||||
|
|
||||||
def print_command(out, args):
|
def print_command(out, args):
|
||||||
print >>out, "Executing: " + " ".join(args)
|
print("Executing: " + " ".join(args), file=out)
|
||||||
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
|
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
|
||||||
print >>out, tmp + ":"
|
print(tmp + ":", file=out)
|
||||||
with open(tmp) as file:
|
with open(tmp) as file:
|
||||||
print >>out, "".join([" " + l for l in file.readlines()])
|
print("".join([" " + l for l in file.readlines()]), file=out)
|
||||||
out.flush()
|
out.flush()
|
||||||
|
|
||||||
def main(args, proc_callback=None):
|
def main(args, proc_callback=None):
|
||||||
@@ -339,14 +339,14 @@ def main(args, proc_callback=None):
|
|||||||
proc = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
proc = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
|
||||||
if proc_callback:
|
if proc_callback:
|
||||||
proc_callback(proc)
|
proc_callback(proc)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
print >>sys.stderr, 'error: Launching', args, ':', e
|
print('error: Launching', args, ':', e, file=sys.stderr)
|
||||||
raise e
|
raise e
|
||||||
(stdout, stderr) = proc.communicate()
|
(stdout, stderr) = proc.communicate()
|
||||||
if proc.returncode and not options.verbose:
|
if proc.returncode and not options.verbose:
|
||||||
print_command(sys.stderr, args)
|
print_command(sys.stderr, args)
|
||||||
sys.stderr.write(stdout)
|
sys.stderr.buffer.write(stdout)
|
||||||
sys.stderr.flush()
|
sys.stderr.buffer.flush()
|
||||||
if proc.returncode:
|
if proc.returncode:
|
||||||
return proc.returncode
|
return proc.returncode
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -38,4 +38,4 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
ensureParentDir(options.output)
|
ensureParentDir(options.output)
|
||||||
with open(options.output, 'w') as outfile:
|
with open(options.output, 'w') as outfile:
|
||||||
print >>outfile, generate(args)
|
print(generate(args), file=outfile)
|
||||||
Vendored
+2
@@ -101,6 +101,8 @@ else:
|
|||||||
ASFLAGS += ['-no-integrated-as']
|
ASFLAGS += ['-no-integrated-as']
|
||||||
elif CONFIG['FFI_TARGET'] == 'AARCH64':
|
elif CONFIG['FFI_TARGET'] == 'AARCH64':
|
||||||
ffi_srcs = ('sysv.S', 'ffi.c')
|
ffi_srcs = ('sysv.S', 'ffi.c')
|
||||||
|
elif CONFIG['FFI_TARGET'] == 'LOONGARCH64':
|
||||||
|
ffi_srcs = ('ffi.c', 'sysv.S')
|
||||||
elif CONFIG['FFI_TARGET'] == 'X86':
|
elif CONFIG['FFI_TARGET'] == 'X86':
|
||||||
ffi_srcs = ('ffi.c', 'sysv.S', 'win32.S')
|
ffi_srcs = ('ffi.c', 'sysv.S', 'win32.S')
|
||||||
elif CONFIG['FFI_TARGET'] == 'X86_64':
|
elif CONFIG['FFI_TARGET'] == 'X86_64':
|
||||||
|
|||||||
Vendored
+4
-1
@@ -29,7 +29,10 @@ if CONFIG['MOZ_WEBM_ENCODER']:
|
|||||||
external_dirs += ['media/libvpx']
|
external_dirs += ['media/libvpx']
|
||||||
|
|
||||||
if CONFIG['MOZ_AV1']:
|
if CONFIG['MOZ_AV1']:
|
||||||
external_dirs += ['media/libaom']
|
if CONFIG['AV1_USE_AOM']:
|
||||||
|
external_dirs += ['media/libaom']
|
||||||
|
else:
|
||||||
|
external_dirs += ['media/libdav1d']
|
||||||
|
|
||||||
external_dirs += ['media/libpng']
|
external_dirs += ['media/libpng']
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(addprefix $(TOPOBJDIR)/
|
|||||||
--track install_$(subst /,_,$*).track \
|
--track install_$(subst /,_,$*).track \
|
||||||
$(TOPOBJDIR)/$* \
|
$(TOPOBJDIR)/$* \
|
||||||
-DAB_CD=en-US \
|
-DAB_CD=en-US \
|
||||||
-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/browser/locales/en-US/profile \
|
-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/$(MOZ_BUILD_APP)/locales/en-US/profile \
|
||||||
$(ACDEFINES) \
|
$(ACDEFINES) \
|
||||||
install_$(subst /,_,$*)
|
install_$(subst /,_,$*)
|
||||||
|
|
||||||
|
|||||||
@@ -95,12 +95,12 @@ def count_lines():
|
|||||||
"""Keep track of the amount of times individual lines occur, in order to
|
"""Keep track of the amount of times individual lines occur, in order to
|
||||||
prioritize the errors which occur most frequently."""
|
prioritize the errors which occur most frequently."""
|
||||||
counts = {}
|
counts = {}
|
||||||
for string,count in blacklist.items():
|
for string,count in list(blacklist.items()):
|
||||||
for line in string.split("\n"):
|
for line in string.split("\n"):
|
||||||
counts[line] = counts.get(line, 0) + count
|
counts[line] = counts.get(line, 0) + count
|
||||||
|
|
||||||
lines = []
|
lines = []
|
||||||
for k,v in counts.items():
|
for k,v in list(counts.items()):
|
||||||
lines.append("{0:6}: {1}".format(v, k))
|
lines.append("{0:6}: {1}".format(v, k))
|
||||||
|
|
||||||
lines.sort()
|
lines.sort()
|
||||||
|
|||||||
+2
-2
@@ -18,7 +18,7 @@ def periodically_print_status(proc):
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
idleTime += 0.5
|
idleTime += 0.5
|
||||||
if idleTime > 20 * 60:
|
if idleTime > 20 * 60:
|
||||||
print "Still linking, 20 minutes passed..."
|
print("Still linking, 20 minutes passed...")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
idleTime = 0
|
idleTime = 0
|
||||||
|
|
||||||
@@ -42,6 +42,6 @@ def wrap_linker(args):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
print >>sys.stderr, "Usage: link.py <commandline>"
|
print("Usage: link.py <commandline>", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
sys.exit(wrap_linker(sys.argv[1:]))
|
sys.exit(wrap_linker(sys.argv[1:]))
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
# Referenced by milestone.py.
|
# Referenced by milestone.py.
|
||||||
#--------------------------------------------------------
|
#--------------------------------------------------------
|
||||||
|
|
||||||
6.8.1
|
6.9.0
|
||||||
@@ -23,11 +23,19 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
|
|||||||
'nsinstall.c',
|
'nsinstall.c',
|
||||||
'pathsub.c',
|
'pathsub.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
# stdc++compat depends on config/export, so avoid a circular
|
# stdc++compat depends on config/export, so avoid a circular
|
||||||
# dependency added by HostProgram depending on stdc++compat,
|
# dependency added by HostProgram depending on stdc++compat,
|
||||||
# while the program here is in C.
|
# while the program here is in C.
|
||||||
HostProgram('nsinstall_real', c_only=True)
|
HostProgram('nsinstall_real', c_only=True)
|
||||||
|
|
||||||
|
if CONFIG['HOST_OS_ARCH'] == 'WINNT':
|
||||||
|
HOST_SOURCES +=[
|
||||||
|
'action_cl.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
|
HostProgram('action_cl')
|
||||||
|
|
||||||
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
|
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
|
||||||
DEFINES['GKMEDIAS_SHARED_LIBRARY'] = True
|
DEFINES['GKMEDIAS_SHARED_LIBRARY'] = True
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -5,7 +5,7 @@
|
|||||||
from unittest import TextTestRunner as _TestRunner, TestResult as _TestResult
|
from unittest import TextTestRunner as _TestRunner, TestResult as _TestResult
|
||||||
import unittest
|
import unittest
|
||||||
import inspect
|
import inspect
|
||||||
from StringIO import StringIO
|
from io import StringIO
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ class MockedOpen(object):
|
|||||||
'''
|
'''
|
||||||
def __init__(self, files = {}):
|
def __init__(self, files = {}):
|
||||||
self.files = {}
|
self.files = {}
|
||||||
for name, content in files.iteritems():
|
for name, content in files.items():
|
||||||
self.files[normcase(os.path.abspath(name))] = content
|
self.files[normcase(os.path.abspath(name))] = content
|
||||||
|
|
||||||
def __call__(self, name, mode = 'r'):
|
def __call__(self, name, mode = 'r'):
|
||||||
@@ -158,19 +158,19 @@ class MockedOpen(object):
|
|||||||
return file
|
return file
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
import __builtin__
|
import builtins
|
||||||
self.open = __builtin__.open
|
self.open = builtins.open
|
||||||
self._orig_path_exists = os.path.exists
|
self._orig_path_exists = os.path.exists
|
||||||
self._orig_path_isdir = os.path.isdir
|
self._orig_path_isdir = os.path.isdir
|
||||||
self._orig_path_isfile = os.path.isfile
|
self._orig_path_isfile = os.path.isfile
|
||||||
__builtin__.open = self
|
builtins.open = self
|
||||||
os.path.exists = self._wrapped_exists
|
os.path.exists = self._wrapped_exists
|
||||||
os.path.isdir = self._wrapped_isdir
|
os.path.isdir = self._wrapped_isdir
|
||||||
os.path.isfile = self._wrapped_isfile
|
os.path.isfile = self._wrapped_isfile
|
||||||
|
|
||||||
def __exit__(self, type, value, traceback):
|
def __exit__(self, type, value, traceback):
|
||||||
import __builtin__
|
import builtins
|
||||||
__builtin__.open = self.open
|
builtins.open = self.open
|
||||||
os.path.exists = self._orig_path_exists
|
os.path.exists = self._orig_path_exists
|
||||||
os.path.isdir = self._orig_path_isdir
|
os.path.isdir = self._orig_path_isdir
|
||||||
os.path.isfile = self._orig_path_isfile
|
os.path.isfile = self._orig_path_isfile
|
||||||
|
|||||||
+3
-6
@@ -149,7 +149,7 @@ def _nsinstall_internal(argv):
|
|||||||
|
|
||||||
# nsinstall as a native command is always UTF-8
|
# nsinstall as a native command is always UTF-8
|
||||||
def nsinstall(argv):
|
def nsinstall(argv):
|
||||||
return _nsinstall_internal([unicode(arg, "utf-8") for arg in argv])
|
return _nsinstall_internal([str(arg, "utf-8") for arg in argv])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# sys.argv corrupts characters outside the system code page on Windows
|
# sys.argv corrupts characters outside the system code page on Windows
|
||||||
@@ -173,10 +173,7 @@ if __name__ == '__main__':
|
|||||||
# The first argv will be "python", the second will be the .py file
|
# The first argv will be "python", the second will be the .py file
|
||||||
argv = argv_arr[1:argc.value]
|
argv = argv_arr[1:argc.value]
|
||||||
else:
|
else:
|
||||||
# For consistency, do it on Unix as well
|
# On Py3, we shouldn't do this for non-Windows. sys.argv is UTF-8 (or ASCII on old Unix).
|
||||||
if sys.stdin.encoding is not None:
|
argv = sys.argv
|
||||||
argv = [unicode(arg, sys.stdin.encoding) for arg in sys.argv]
|
|
||||||
else:
|
|
||||||
argv = [unicode(arg) for arg in sys.argv]
|
|
||||||
|
|
||||||
sys.exit(_nsinstall_internal(argv[1:]))
|
sys.exit(_nsinstall_internal(argv[1:]))
|
||||||
@@ -5,27 +5,27 @@
|
|||||||
import configobj
|
import configobj
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
from StringIO import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
try:
|
try:
|
||||||
(file, section, key) = sys.argv[1:]
|
(file, section, key) = sys.argv[1:]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print "Usage: printconfigsetting.py <file> <section> <setting>"
|
print("Usage: printconfigsetting.py <file> <section> <setting>")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
with open(file) as fh:
|
with open(file) as fh:
|
||||||
content = re.sub('^\s*;', '#', fh.read(), flags=re.M)
|
content = re.sub(r'^\s*;', '#', fh.read(), flags=re.M)
|
||||||
|
|
||||||
c = configobj.ConfigObj(StringIO(content))
|
c = configobj.ConfigObj(StringIO(content))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
s = c[section]
|
s = c[section]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print >>sys.stderr, "Section [%s] not found." % section
|
print("Section [%s] not found." % section, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print s[key]
|
print(s[key])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print >>sys.stderr, "Key %s not found." % key
|
print("Key %s not found." % key, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@@ -9,7 +9,7 @@ Run a python script, adding extra directories to the python path.
|
|||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
def usage():
|
def usage():
|
||||||
print >>sys.stderr, "pythonpath.py -I directory script.py [args...]"
|
print("pythonpath.py -I directory script.py [args...]", file=sys.stderr)
|
||||||
sys.exit(150)
|
sys.exit(150)
|
||||||
|
|
||||||
paths = []
|
paths = []
|
||||||
@@ -45,7 +45,7 @@ def main(args):
|
|||||||
frozenglobals['__name__'] = '__main__'
|
frozenglobals['__name__'] = '__main__'
|
||||||
frozenglobals['__file__'] = script
|
frozenglobals['__file__'] = script
|
||||||
|
|
||||||
execfile(script, frozenglobals)
|
exec(compile(open(script, "rb").read(), script, 'exec'), frozenglobals)
|
||||||
|
|
||||||
# Freeze scope here ... why this makes things work I have no idea ...
|
# Freeze scope here ... why this makes things work I have no idea ...
|
||||||
frozenglobals = globals()
|
frozenglobals = globals()
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def rebuild_check(args):
|
|||||||
deps = args[1:]
|
deps = args[1:]
|
||||||
t = mtime(target)
|
t = mtime(target)
|
||||||
if t < 0:
|
if t < 0:
|
||||||
print target
|
print(target)
|
||||||
return
|
return
|
||||||
|
|
||||||
newer = []
|
newer = []
|
||||||
@@ -31,13 +31,13 @@ def rebuild_check(args):
|
|||||||
newer.append(dep)
|
newer.append(dep)
|
||||||
|
|
||||||
if newer and removed:
|
if newer and removed:
|
||||||
print 'Rebuilding %s because %s changed and %s was removed' % (target, ', '.join(newer), ', '.join(removed))
|
print('Rebuilding %s because %s changed and %s was removed' % (target, ', '.join(newer), ', '.join(removed)))
|
||||||
elif newer:
|
elif newer:
|
||||||
print 'Rebuilding %s because %s changed' % (target, ', '.join(newer))
|
print('Rebuilding %s because %s changed' % (target, ', '.join(newer)))
|
||||||
elif removed:
|
elif removed:
|
||||||
print 'Rebuilding %s because %s was removed' % (target, ', '.join(removed))
|
print('Rebuilding %s because %s was removed' % (target, ', '.join(removed)))
|
||||||
else:
|
else:
|
||||||
print 'Rebuilding %s for an unknown reason' % target
|
print('Rebuilding %s for an unknown reason' % target)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -335,8 +335,6 @@ curses.h
|
|||||||
cxxabi.h
|
cxxabi.h
|
||||||
DateTimeUtils.h
|
DateTimeUtils.h
|
||||||
dbus/dbus.h
|
dbus/dbus.h
|
||||||
dbus/dbus-glib.h
|
|
||||||
dbus/dbus-glib-lowlevel.h
|
|
||||||
ddeml.h
|
ddeml.h
|
||||||
Debug.h
|
Debug.h
|
||||||
dem.h
|
dem.h
|
||||||
@@ -450,7 +448,6 @@ gtk/gtkx.h
|
|||||||
gtk/gtkunixprint.h
|
gtk/gtkunixprint.h
|
||||||
HIToolbox/HIToolbox.h
|
HIToolbox/HIToolbox.h
|
||||||
hlink.h
|
hlink.h
|
||||||
ia64/sys/inline.h
|
|
||||||
Icons.h
|
Icons.h
|
||||||
iconv.h
|
iconv.h
|
||||||
ieeefp.h
|
ieeefp.h
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from tempfile import mkdtemp
|
|||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
import mozunit
|
import mozunit
|
||||||
|
|
||||||
from UserString import UserString
|
from collections import UserString
|
||||||
# Create a controlled configuration for use by expandlibs
|
# Create a controlled configuration for use by expandlibs
|
||||||
config_win = {
|
config_win = {
|
||||||
'AR': 'lib',
|
'AR': 'lib',
|
||||||
@@ -120,8 +120,7 @@ class ReplicateTests(type):
|
|||||||
del dict[name]
|
del dict[name]
|
||||||
return type.__new__(cls, clsName, bases, dict)
|
return type.__new__(cls, clsName, bases, dict)
|
||||||
|
|
||||||
class TestCaseWithTmpDir(unittest.TestCase):
|
class TestCaseWithTmpDir(unittest.TestCase, metaclass=ReplicateTests):
|
||||||
__metaclass__ = ReplicateTests
|
|
||||||
def init(self):
|
def init(self):
|
||||||
self.tmpdir = os.path.abspath(mkdtemp(dir=os.curdir))
|
self.tmpdir = os.path.abspath(mkdtemp(dir=os.curdir))
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
# Unicode strings means non-ASCII children can be deleted properly on
|
# Unicode strings means non-ASCII children can be deleted properly on
|
||||||
# Windows
|
# Windows
|
||||||
if sys.stdin.encoding is None:
|
if sys.stdin.encoding is None:
|
||||||
tmpdir = unicode(self.tmpdir)
|
tmpdir = str(self.tmpdir)
|
||||||
else:
|
else:
|
||||||
tmpdir = unicode(self.tmpdir, sys.stdin.encoding)
|
tmpdir = str(self.tmpdir, sys.stdin.encoding)
|
||||||
rmtree(tmpdir)
|
rmtree(tmpdir)
|
||||||
|
|
||||||
# utility methods for tests
|
# utility methods for tests
|
||||||
@@ -50,14 +50,14 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
"Test nsinstall -D <dir>"
|
"Test nsinstall -D <dir>"
|
||||||
testdir = os.path.join(self.tmpdir, "test")
|
testdir = os.path.join(self.tmpdir, "test")
|
||||||
self.assertEqual(nsinstall(["-D", testdir]), 0)
|
self.assertEqual(nsinstall(["-D", testdir]), 0)
|
||||||
self.assert_(os.path.isdir(testdir))
|
self.assertTrue(os.path.isdir(testdir))
|
||||||
|
|
||||||
def test_nsinstall_basic(self):
|
def test_nsinstall_basic(self):
|
||||||
"Test nsinstall <file> <dir>"
|
"Test nsinstall <file> <dir>"
|
||||||
testfile = self.touch("testfile")
|
testfile = self.touch("testfile")
|
||||||
testdir = self.mkdirs("testdir")
|
testdir = self.mkdirs("testdir")
|
||||||
self.assertEqual(nsinstall([testfile, testdir]), 0)
|
self.assertEqual(nsinstall([testfile, testdir]), 0)
|
||||||
self.assert_(os.path.isfile(os.path.join(testdir, "testfile")))
|
self.assertTrue(os.path.isfile(os.path.join(testdir, "testfile")))
|
||||||
|
|
||||||
def test_nsinstall_basic_recursive(self):
|
def test_nsinstall_basic_recursive(self):
|
||||||
"Test nsinstall <dir> <dest dir>"
|
"Test nsinstall <dir> <dest dir>"
|
||||||
@@ -76,12 +76,12 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
'-X', Xdir]), 0)
|
'-X', Xdir]), 0)
|
||||||
|
|
||||||
testdir = os.path.join(destdir, "sourcedir")
|
testdir = os.path.join(destdir, "sourcedir")
|
||||||
self.assert_(os.path.isdir(testdir))
|
self.assertTrue(os.path.isdir(testdir))
|
||||||
self.assert_(os.path.isfile(os.path.join(testdir, "testfile")))
|
self.assertTrue(os.path.isfile(os.path.join(testdir, "testfile")))
|
||||||
self.assert_(not os.path.exists(os.path.join(testdir, "Xfile")))
|
self.assertTrue(not os.path.exists(os.path.join(testdir, "Xfile")))
|
||||||
self.assert_(os.path.isdir(os.path.join(testdir, "copieddir")))
|
self.assertTrue(os.path.isdir(os.path.join(testdir, "copieddir")))
|
||||||
self.assert_(os.path.isfile(os.path.join(testdir, "copieddir", "testfile2")))
|
self.assertTrue(os.path.isfile(os.path.join(testdir, "copieddir", "testfile2")))
|
||||||
self.assert_(not os.path.exists(os.path.join(testdir, "Xdir")))
|
self.assertTrue(not os.path.exists(os.path.join(testdir, "Xdir")))
|
||||||
|
|
||||||
def test_nsinstall_multiple(self):
|
def test_nsinstall_multiple(self):
|
||||||
"Test nsinstall <three files> <dest dir>"
|
"Test nsinstall <three files> <dest dir>"
|
||||||
@@ -91,7 +91,7 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
testdir = self.mkdirs("testdir")
|
testdir = self.mkdirs("testdir")
|
||||||
self.assertEqual(nsinstall(testfiles + [testdir]), 0)
|
self.assertEqual(nsinstall(testfiles + [testdir]), 0)
|
||||||
for f in testfiles:
|
for f in testfiles:
|
||||||
self.assert_(os.path.isfile(os.path.join(testdir,
|
self.assertTrue(os.path.isfile(os.path.join(testdir,
|
||||||
os.path.basename(f))))
|
os.path.basename(f))))
|
||||||
|
|
||||||
def test_nsinstall_dir_exists(self):
|
def test_nsinstall_dir_exists(self):
|
||||||
@@ -99,7 +99,7 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
srcdir = self.mkdirs("test")
|
srcdir = self.mkdirs("test")
|
||||||
destdir = self.mkdirs("testdir/test")
|
destdir = self.mkdirs("testdir/test")
|
||||||
self.assertEqual(nsinstall([srcdir, os.path.dirname(destdir)]), 0)
|
self.assertEqual(nsinstall([srcdir, os.path.dirname(destdir)]), 0)
|
||||||
self.assert_(os.path.isdir(destdir))
|
self.assertTrue(os.path.isdir(destdir))
|
||||||
|
|
||||||
def test_nsinstall_t(self):
|
def test_nsinstall_t(self):
|
||||||
"Test that nsinstall -t works (preserve timestamp)"
|
"Test that nsinstall -t works (preserve timestamp)"
|
||||||
@@ -110,7 +110,7 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
os.utime(testfile, (t, t))
|
os.utime(testfile, (t, t))
|
||||||
self.assertEqual(nsinstall(["-t", testfile, testdir]), 0)
|
self.assertEqual(nsinstall(["-t", testfile, testdir]), 0)
|
||||||
destfile = os.path.join(testdir, "testfile")
|
destfile = os.path.join(testdir, "testfile")
|
||||||
self.assert_(os.path.isfile(destfile))
|
self.assertTrue(os.path.isfile(destfile))
|
||||||
self.assertEqual(os.stat(testfile).st_mtime,
|
self.assertEqual(os.stat(testfile).st_mtime,
|
||||||
os.stat(destfile).st_mtime)
|
os.stat(destfile).st_mtime)
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
self.assertEqual(nsinstall(["-m", "{0:04o}"
|
self.assertEqual(nsinstall(["-m", "{0:04o}"
|
||||||
.format(mode), testfile, testdir]), 0)
|
.format(mode), testfile, testdir]), 0)
|
||||||
destfile = os.path.join(testdir, "testfile")
|
destfile = os.path.join(testdir, "testfile")
|
||||||
self.assert_(os.path.isfile(destfile))
|
self.assertTrue(os.path.isfile(destfile))
|
||||||
self.assertEqual(os.stat(testfile).st_mode,
|
self.assertEqual(os.stat(testfile).st_mode,
|
||||||
os.stat(destfile).st_mode)
|
os.stat(destfile).st_mode)
|
||||||
|
|
||||||
@@ -136,25 +136,25 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
testdir = self.mkdirs("testdir")
|
testdir = self.mkdirs("testdir")
|
||||||
destdir = os.path.join(testdir, "subdir")
|
destdir = os.path.join(testdir, "subdir")
|
||||||
self.assertEqual(nsinstall(["-d", testfile, destdir]), 0)
|
self.assertEqual(nsinstall(["-d", testfile, destdir]), 0)
|
||||||
self.assert_(os.path.isdir(os.path.join(destdir, "testfile")))
|
self.assertTrue(os.path.isdir(os.path.join(destdir, "testfile")))
|
||||||
|
|
||||||
if RUN_NON_ASCII_TESTS:
|
if RUN_NON_ASCII_TESTS:
|
||||||
def test_nsinstall_non_ascii(self):
|
def test_nsinstall_non_ascii(self):
|
||||||
"Test that nsinstall handles non-ASCII files"
|
"Test that nsinstall handles non-ASCII files"
|
||||||
filename = u"\u2325\u3452\u2415\u5081"
|
filename = "\u2325\u3452\u2415\u5081"
|
||||||
testfile = self.touch(filename)
|
testfile = self.touch(filename)
|
||||||
testdir = self.mkdirs(u"\u4241\u1D04\u1414")
|
testdir = self.mkdirs("\u4241\u1D04\u1414")
|
||||||
self.assertEqual(nsinstall([testfile.encode("utf-8"),
|
self.assertEqual(nsinstall([testfile.encode("utf-8"),
|
||||||
testdir.encode("utf-8")]), 0)
|
testdir.encode("utf-8")]), 0)
|
||||||
|
|
||||||
destfile = os.path.join(testdir, filename)
|
destfile = os.path.join(testdir, filename)
|
||||||
self.assert_(os.path.isfile(destfile))
|
self.assertTrue(os.path.isfile(destfile))
|
||||||
|
|
||||||
def test_nsinstall_non_ascii_subprocess(self):
|
def test_nsinstall_non_ascii_subprocess(self):
|
||||||
"Test that nsinstall as a subprocess handles non-ASCII files"
|
"Test that nsinstall as a subprocess handles non-ASCII files"
|
||||||
filename = u"\u2325\u3452\u2415\u5081"
|
filename = "\u2325\u3452\u2415\u5081"
|
||||||
testfile = self.touch(filename)
|
testfile = self.touch(filename)
|
||||||
testdir = self.mkdirs(u"\u4241\u1D04\u1414")
|
testdir = self.mkdirs("\u4241\u1D04\u1414")
|
||||||
# We don't use subprocess because it can't handle Unicode on
|
# We don't use subprocess because it can't handle Unicode on
|
||||||
# Windows <http://bugs.python.org/issue1759845>. mozprocess calls
|
# Windows <http://bugs.python.org/issue1759845>. mozprocess calls
|
||||||
# CreateProcessW directly so it's perfect.
|
# CreateProcessW directly so it's perfect.
|
||||||
@@ -166,7 +166,7 @@ class TestNsinstall(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertEqual(rv, 0)
|
self.assertEqual(rv, 0)
|
||||||
destfile = os.path.join(testdir, filename)
|
destfile = os.path.join(testdir, filename)
|
||||||
self.assert_(os.path.isfile(destfile))
|
self.assertTrue(os.path.isfile(destfile))
|
||||||
|
|
||||||
#TODO: implement -R, -l, -L and test them!
|
#TODO: implement -R, -l, -L and test them!
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import sys
|
|||||||
import random
|
import random
|
||||||
import copy
|
import copy
|
||||||
from string import letters
|
from string import letters
|
||||||
|
from functools import reduce
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Test case infrastructure for MozZipFile.
|
Test case infrastructure for MozZipFile.
|
||||||
@@ -38,7 +39,7 @@ leafs = (
|
|||||||
'firstdir/oneleaf',
|
'firstdir/oneleaf',
|
||||||
'seconddir/twoleaf',
|
'seconddir/twoleaf',
|
||||||
'thirddir/with/sub/threeleaf')
|
'thirddir/with/sub/threeleaf')
|
||||||
_lengths = map(lambda n: n * 64, [16, 64, 80])
|
_lengths = [n * 64 for n in [16, 64, 80]]
|
||||||
lengths = 3
|
lengths = 3
|
||||||
writes = 5
|
writes = 5
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ def getid(descs):
|
|||||||
def getContent(length):
|
def getContent(length):
|
||||||
'Get pseudo random content of given length.'
|
'Get pseudo random content of given length.'
|
||||||
rv = [None] * length
|
rv = [None] * length
|
||||||
for i in xrange(length):
|
for i in range(length):
|
||||||
rv[i] = random.choice(letters)
|
rv[i] = random.choice(letters)
|
||||||
return ''.join(rv)
|
return ''.join(rv)
|
||||||
|
|
||||||
@@ -133,13 +134,13 @@ class TestExtensiveStored(unittest.TestCase):
|
|||||||
def _verifyZip(self):
|
def _verifyZip(self):
|
||||||
zf = zipfile.ZipFile(self.f)
|
zf = zipfile.ZipFile(self.f)
|
||||||
badEntry = zf.testzip()
|
badEntry = zf.testzip()
|
||||||
self.failIf(badEntry, badEntry)
|
self.assertFalse(badEntry, badEntry)
|
||||||
zlist = zf.namelist()
|
zlist = zf.namelist()
|
||||||
zlist.sort()
|
zlist.sort()
|
||||||
vlist = self.ref.keys()
|
vlist = list(self.ref.keys())
|
||||||
vlist.sort()
|
vlist.sort()
|
||||||
self.assertEqual(zlist, vlist)
|
self.assertEqual(zlist, vlist)
|
||||||
for leaf, content in self.ref.iteritems():
|
for leaf, content in self.ref.items():
|
||||||
zcontent = zf.read(leaf)
|
zcontent = zf.read(leaf)
|
||||||
self.assertEqual(content, zcontent)
|
self.assertEqual(content, zcontent)
|
||||||
|
|
||||||
@@ -158,16 +159,16 @@ class TestExtensiveStored(unittest.TestCase):
|
|||||||
open(self.leaf('stage', leaf), 'w').write(content)
|
open(self.leaf('stage', leaf), 'w').write(content)
|
||||||
|
|
||||||
# all leafs in all lengths
|
# all leafs in all lengths
|
||||||
atomics = list(prod(xrange(len(leafs)), xrange(lengths)))
|
atomics = list(prod(range(len(leafs)), range(lengths)))
|
||||||
|
|
||||||
# populate TestExtensiveStore with testcases
|
# populate TestExtensiveStore with testcases
|
||||||
for w in xrange(writes):
|
for w in range(writes):
|
||||||
# Don't iterate over all files for the the first n passes,
|
# Don't iterate over all files for the the first n passes,
|
||||||
# those are redundant as long as w < lengths.
|
# those are redundant as long as w < lengths.
|
||||||
# There are symmetries in the trailing end, too, but I don't know
|
# There are symmetries in the trailing end, too, but I don't know
|
||||||
# how to reduce those out right now.
|
# how to reduce those out right now.
|
||||||
nonatomics = [list(prod(range(min(i,len(leafs))), xrange(lengths)))
|
nonatomics = [list(prod(list(range(min(i,len(leafs)))), range(lengths)))
|
||||||
for i in xrange(1, w+1)] + [atomics]
|
for i in range(1, w+1)] + [atomics]
|
||||||
for descs in prod(*nonatomics):
|
for descs in prod(*nonatomics):
|
||||||
suffix = getid(descs)
|
suffix = getid(descs)
|
||||||
dicts = [dict(leaf=leaf, length=length) for leaf, length in descs]
|
dicts = [dict(leaf=leaf, length=length) for leaf, length in descs]
|
||||||
@@ -181,9 +182,9 @@ for w in xrange(writes):
|
|||||||
# and then write all atomics again.
|
# and then write all atomics again.
|
||||||
# This should catch more or less all artifacts generated
|
# This should catch more or less all artifacts generated
|
||||||
# by the final ordering step when closing the jar.
|
# by the final ordering step when closing the jar.
|
||||||
files = [list(prod([i], xrange(lengths))) for i in xrange(len(leafs))]
|
files = [list(prod([i], range(lengths))) for i in range(len(leafs))]
|
||||||
allfiles = reduce(lambda l,r:l+r,
|
allfiles = reduce(lambda l,r:l+r,
|
||||||
[list(prod(*files[:(i+1)])) for i in xrange(len(leafs))])
|
[list(prod(*files[:(i+1)])) for i in range(len(leafs))])
|
||||||
|
|
||||||
for first in allfiles:
|
for first in allfiles:
|
||||||
testbasename = 'test{0}_'.format(getid(first))
|
testbasename = 'test{0}_'.format(getid(first))
|
||||||
|
|||||||
+1
-1
@@ -22,4 +22,4 @@ SRCDIR=$(dirname $0)
|
|||||||
TOPSRCDIR="$SRCDIR"
|
TOPSRCDIR="$SRCDIR"
|
||||||
export OLD_CONFIGURE="$SRCDIR"/old-configure
|
export OLD_CONFIGURE="$SRCDIR"/old-configure
|
||||||
|
|
||||||
which python2.7 > /dev/null && exec python2.7 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
|
which python3 > /dev/null && exec python3 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
|
||||||
+17
-22
@@ -10,13 +10,11 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
|
|
||||||
base_dir = os.path.abspath(os.path.dirname(__file__))
|
base_dir = os.path.abspath(os.path.dirname(__file__))
|
||||||
sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
|
sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
|
||||||
from mozbuild.configure import ConfigureSandbox
|
from mozbuild.configure import ConfigureSandbox
|
||||||
from mozbuild.util import (
|
from mozbuild.util import (
|
||||||
indented_repr,
|
indented_repr,
|
||||||
encode,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -36,20 +34,24 @@ def config_status(config):
|
|||||||
# Ideally, all the backend and frontend code would handle the booleans, but
|
# Ideally, all the backend and frontend code would handle the booleans, but
|
||||||
# there are so many things involved, that it's easier to keep config.status
|
# there are so many things involved, that it's easier to keep config.status
|
||||||
# untouched for now.
|
# untouched for now.
|
||||||
def sanitized_bools(v):
|
def sanitized_values(v):
|
||||||
if v is True:
|
if v is True:
|
||||||
return '1'
|
return '1'
|
||||||
if v is False:
|
if v is False:
|
||||||
return ''
|
return ''
|
||||||
|
if isinstance(v, dict):
|
||||||
|
return {key: sanitized_values(value) for key, value in v.items()}
|
||||||
|
if isinstance(v, (list, tuple)):
|
||||||
|
return [sanitized_values(value) for value in v]
|
||||||
return v
|
return v
|
||||||
|
|
||||||
sanitized_config = {}
|
sanitized_config = {}
|
||||||
sanitized_config['substs'] = {
|
sanitized_config['substs'] = {
|
||||||
k: sanitized_bools(v) for k, v in config.iteritems()
|
key: sanitized_values(value) for key, value in config.items()
|
||||||
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
|
if key not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
|
||||||
}
|
}
|
||||||
sanitized_config['defines'] = {
|
sanitized_config['defines'] = {
|
||||||
k: sanitized_bools(v) for k, v in config['DEFINES'].iteritems()
|
key: sanitized_values(value) for key, value in config['DEFINES'].items()
|
||||||
}
|
}
|
||||||
sanitized_config['non_global_defines'] = config['non_global_defines']
|
sanitized_config['non_global_defines'] = config['non_global_defines']
|
||||||
sanitized_config['topsrcdir'] = config['TOPSRCDIR']
|
sanitized_config['topsrcdir'] = config['TOPSRCDIR']
|
||||||
@@ -60,19 +62,16 @@ def config_status(config):
|
|||||||
# here, when we're able to skip configure tests/use cached results/not rely
|
# here, when we're able to skip configure tests/use cached results/not rely
|
||||||
# on autoconf.
|
# on autoconf.
|
||||||
print("Creating config.status", file=sys.stderr)
|
print("Creating config.status", file=sys.stderr)
|
||||||
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
|
with codecs.open('config.status', 'w', encoding='utf-8', errors='replace') as fh:
|
||||||
with codecs.open('config.status', 'w', encoding) as fh:
|
|
||||||
fh.write(textwrap.dedent('''\
|
fh.write(textwrap.dedent('''\
|
||||||
#!%(python)s
|
#!%(python)s
|
||||||
# coding=%(encoding)s
|
# coding=%(encoding)s
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from mozbuild.util import encode
|
''') % {'python': config['PYTHON'], 'encoding': 'utf-8'})
|
||||||
encoding = '%(encoding)s'
|
|
||||||
''') % {'python': config['PYTHON'], 'encoding': encoding})
|
|
||||||
# A lot of the build backend code is currently expecting byte
|
# A lot of the build backend code is currently expecting byte
|
||||||
# strings and breaks in subtle ways with unicode strings. (bug 1296508)
|
# strings and breaks in subtle ways with unicode strings. (bug 1296508)
|
||||||
for k, v in sanitized_config.iteritems():
|
for k, v in sanitized_config.items():
|
||||||
fh.write('%s = encode(%s, encoding)\n' % (k, indented_repr(v)))
|
fh.write('%s = %s\n' % (k, indented_repr(v)))
|
||||||
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
|
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
|
||||||
"'non_global_defines', 'substs', 'mozconfig']")
|
"'non_global_defines', 'substs', 'mozconfig']")
|
||||||
|
|
||||||
@@ -88,18 +87,14 @@ def config_status(config):
|
|||||||
# executable permissions.
|
# executable permissions.
|
||||||
os.chmod('config.status', 0o755)
|
os.chmod('config.status', 0o755)
|
||||||
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
|
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
|
||||||
os.environ[b'WRITE_MOZINFO'] = b'1'
|
os.environ['WRITE_MOZINFO'] = '1'
|
||||||
from mozbuild.config_status import config_status
|
from mozbuild.config_status import config_status
|
||||||
|
|
||||||
# Some values in sanitized_config also have more complex types, such as
|
# Some values in sanitized_config also have more complex types, such as
|
||||||
# EnumString, which using when calling config_status would currently
|
# EnumString and tuples. Converting string subclasses to plain strings
|
||||||
# break the build, as well as making it inconsistent with re-running
|
# and tuples to lists keeps this code path consistent with the
|
||||||
# config.status. Fortunately, EnumString derives from unicode, so it's
|
# generated config.status file, which serializes iterables as lists.
|
||||||
# covered by converting unicode strings.
|
return config_status(args=[], **sanitized_config)
|
||||||
|
|
||||||
# A lot of the build backend code is currently expecting byte strings
|
|
||||||
# and breaks in subtle ways with unicode strings.
|
|
||||||
return config_status(args=[], **encode(sanitized_config, encoding))
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,8 @@ TooltipsOverlay.prototype = {
|
|||||||
// Font preview tooltip
|
// Font preview tooltip
|
||||||
if (type === VIEW_NODE_VALUE_TYPE && prop.property === "font-family") {
|
if (type === VIEW_NODE_VALUE_TYPE && prop.property === "font-family") {
|
||||||
let value = prop.value.toLowerCase();
|
let value = prop.value.toLowerCase();
|
||||||
if (value !== "inherit" && value !== "unset" && value !== "initial" && value !== "revert") {
|
if (value !== "inherit" && value !== "unset" && value !== "initial" &&
|
||||||
|
value !== "revert" && value !== "revert-layer") {
|
||||||
tooltipType = TOOLTIP_FONTFAMILY_TYPE;
|
tooltipType = TOOLTIP_FONTFAMILY_TYPE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,21 +204,22 @@ function initialHTML(doc) {
|
|||||||
os = "linux";
|
os = "linux";
|
||||||
}
|
}
|
||||||
|
|
||||||
let base = doc.createElement("base");
|
// The appRoot URI is prepended to all URIs instead of using a <base> element
|
||||||
base.href = "resource://devtools/client/jsonview/";
|
// because the latter can cause spurious network requests (UXP Issue #3122)
|
||||||
|
let appRoot = "resource://devtools/client/jsonview/";
|
||||||
|
|
||||||
let style = doc.createElement("link");
|
let style = doc.createElement("link");
|
||||||
style.rel = "stylesheet";
|
style.rel = "stylesheet";
|
||||||
style.type = "text/css";
|
style.type = "text/css";
|
||||||
style.href = "css/main.css";
|
style.href = appRoot +"css/main.css";
|
||||||
|
|
||||||
let script = doc.createElement("script");
|
let script = doc.createElement("script");
|
||||||
script.src = "lib/require.js";
|
script.src = appRoot + "lib/require.js";
|
||||||
script.dataset.main = "viewer-config";
|
script.dataset.main = appRoot + "viewer-config.js";
|
||||||
script.defer = true;
|
script.defer = true;
|
||||||
|
|
||||||
let head = doc.createElement("head");
|
let head = doc.createElement("head");
|
||||||
head.append(base, style, script);
|
head.append(style, script);
|
||||||
|
|
||||||
return "<!DOCTYPE html>\n" +
|
return "<!DOCTYPE html>\n" +
|
||||||
startTag("html", {
|
startTag("html", {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ subsuite = devtools
|
|||||||
support-files =
|
support-files =
|
||||||
array_json.json
|
array_json.json
|
||||||
array_json.json^headers^
|
array_json.json^headers^
|
||||||
|
csp_json.json
|
||||||
|
csp_json.json^headers^
|
||||||
doc_frame_script.js
|
doc_frame_script.js
|
||||||
head.js
|
head.js
|
||||||
invalid_json.json
|
invalid_json.json
|
||||||
@@ -22,6 +24,7 @@ subsuite = clipboard
|
|||||||
subsuite = clipboard
|
subsuite = clipboard
|
||||||
[browser_jsonview_copy_rawdata.js]
|
[browser_jsonview_copy_rawdata.js]
|
||||||
subsuite = clipboard
|
subsuite = clipboard
|
||||||
|
[browser_jsonview_csp_json.js]
|
||||||
[browser_jsonview_filter.js]
|
[browser_jsonview_filter.js]
|
||||||
[browser_jsonview_invalid_json.js]
|
[browser_jsonview_invalid_json.js]
|
||||||
[browser_jsonview_valid_json.js]
|
[browser_jsonview_valid_json.js]
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||||
|
/* vim: set ts=2 et sw=2 tw=80: */
|
||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_JSON_URL = URL_ROOT + "csp_json.json";
|
||||||
|
|
||||||
|
add_task(function* () {
|
||||||
|
info("Test CSP JSON started");
|
||||||
|
|
||||||
|
yield addJsonViewTab(TEST_JSON_URL);
|
||||||
|
|
||||||
|
let count = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
|
||||||
|
is(count, 1, "There must be one row");
|
||||||
|
});
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"csp": true}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Content-Type: application/json
|
||||||
|
Content-Security-Policy: default-src 'none'; base-uri 'none';
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
* of the code base, so it's consistent and modules can be easily reused.
|
* of the code base, so it's consistent and modules can be easily reused.
|
||||||
*/
|
*/
|
||||||
require.config({
|
require.config({
|
||||||
baseUrl: ".",
|
baseUrl: "resource://devtools/client/jsonview/",
|
||||||
paths: {
|
paths: {
|
||||||
"devtools/client/shared": "resource://devtools/client/shared",
|
"devtools/client/shared": "resource://devtools/client/shared",
|
||||||
"devtools/shared": "resource://devtools/shared",
|
"devtools/shared": "resource://devtools/shared",
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
JS_PREFERENCE_PP_FILES += [
|
JS_PREFERENCE_FILES += [
|
||||||
'devtools.js',
|
'devtools.js',
|
||||||
]
|
]
|
||||||
@@ -10,7 +10,8 @@ const SPECIALVALUES = new Set([
|
|||||||
"initial",
|
"initial",
|
||||||
"inherit",
|
"inherit",
|
||||||
"unset",
|
"unset",
|
||||||
"revert"
|
"revert",
|
||||||
|
"revert-layer"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const {getCSSLexer} = require("devtools/shared/css/lexer");
|
const {getCSSLexer} = require("devtools/shared/css/lexer");
|
||||||
|
|||||||
@@ -99,7 +99,14 @@ const filterList = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Valid values that shouldn't be parsed for filters.
|
// Valid values that shouldn't be parsed for filters.
|
||||||
const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit", "revert"]);
|
const SPECIAL_VALUES = new Set([
|
||||||
|
"none",
|
||||||
|
"unset",
|
||||||
|
"initial",
|
||||||
|
"inherit",
|
||||||
|
"revert",
|
||||||
|
"revert-layer"
|
||||||
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A CSS Filter editor widget used to add/remove/modify
|
* A CSS Filter editor widget used to add/remove/modify
|
||||||
|
|||||||
@@ -103,12 +103,6 @@ function StyleSheetEditor(styleSheet, win, file, isNew, walker, highlighter) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this._styleSheetFilePath = null;
|
|
||||||
if (styleSheet.href &&
|
|
||||||
Services.io.extractScheme(this.styleSheet.href) == "file") {
|
|
||||||
this._styleSheetFilePath = this.styleSheet.href;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._onPropertyChange = this._onPropertyChange.bind(this);
|
this._onPropertyChange = this._onPropertyChange.bind(this);
|
||||||
this._onError = this._onError.bind(this);
|
this._onError = this._onError.bind(this);
|
||||||
this._onMediaRuleMatchesChange = this._onMediaRuleMatchesChange.bind(this);
|
this._onMediaRuleMatchesChange = this._onMediaRuleMatchesChange.bind(this);
|
||||||
@@ -664,8 +658,7 @@ StyleSheetEditor.prototype = {
|
|||||||
if (this._friendlyName) {
|
if (this._friendlyName) {
|
||||||
defaultName = OS.Path.basename(this._friendlyName);
|
defaultName = OS.Path.basename(this._friendlyName);
|
||||||
}
|
}
|
||||||
showFilePicker(file || this._styleSheetFilePath, true, this._window,
|
showFilePicker(file, true, this._window, onFile, defaultName);
|
||||||
onFile, defaultName);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,98 +1,112 @@
|
|||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Test that 'Save' function works.
|
// Test that 'Save' function works.
|
||||||
|
|
||||||
const TESTCASE_URI_HTML = TEST_BASE_HTTP + "simple.html";
|
const TESTCASE_URI_HTML = TEST_BASE_HTTP + "simple.html";
|
||||||
const TESTCASE_URI_CSS = TEST_BASE_HTTP + "simple.css";
|
const TESTCASE_URI_CSS = TEST_BASE_HTTP + "simple.css";
|
||||||
|
|
||||||
var tempScope = {};
|
var tempScope = {};
|
||||||
Components.utils.import("resource://gre/modules/FileUtils.jsm", tempScope);
|
Components.utils.import("resource://gre/modules/FileUtils.jsm", tempScope);
|
||||||
Components.utils.import("resource://gre/modules/NetUtil.jsm", tempScope);
|
Components.utils.import("resource://gre/modules/NetUtil.jsm", tempScope);
|
||||||
var FileUtils = tempScope.FileUtils;
|
var FileUtils = tempScope.FileUtils;
|
||||||
var NetUtil = tempScope.NetUtil;
|
var NetUtil = tempScope.NetUtil;
|
||||||
|
|
||||||
add_task(function* () {
|
add_task(function* () {
|
||||||
let htmlFile = yield copy(TESTCASE_URI_HTML, "simple.html");
|
let htmlFile = yield copy(TESTCASE_URI_HTML, "simple.html");
|
||||||
yield copy(TESTCASE_URI_CSS, "simple.css");
|
const cssFile = await copy(TESTCASE_URI_CSS, "simple.css");
|
||||||
let uri = Services.io.newFileURI(htmlFile);
|
let uri = Services.io.newFileURI(htmlFile);
|
||||||
let filePath = uri.resolve("");
|
let filePath = uri.resolve("");
|
||||||
|
|
||||||
let { ui } = yield openStyleEditorForURL(filePath);
|
let { ui } = yield openStyleEditorForURL(filePath);
|
||||||
|
|
||||||
let editor = ui.editors[0];
|
let editor = ui.editors[0];
|
||||||
yield editor.getSourceEditor();
|
yield editor.getSourceEditor();
|
||||||
|
|
||||||
info("Editing the style sheet.");
|
is(
|
||||||
let dirty = editor.sourceEditor.once("dirty-change");
|
editor.savedFile,
|
||||||
let beginCursor = {line: 0, ch: 0};
|
null,
|
||||||
editor.sourceEditor.replaceText("DIRTY TEXT", beginCursor, beginCursor);
|
"savedFile should not be pre-populated from the source file"
|
||||||
|
);
|
||||||
yield dirty;
|
|
||||||
|
info("Editing the style sheet.");
|
||||||
is(editor.sourceEditor.isClean(), false, "Editor is dirty.");
|
let dirty = editor.sourceEditor.once("dirty-change");
|
||||||
ok(editor.summary.classList.contains("unsaved"),
|
let beginCursor = {line: 0, ch: 0};
|
||||||
"Star icon is present in the corresponding summary.");
|
editor.sourceEditor.replaceText("DIRTY TEXT", beginCursor, beginCursor);
|
||||||
|
|
||||||
info("Saving the changes.");
|
yield dirty;
|
||||||
dirty = editor.sourceEditor.once("dirty-change");
|
|
||||||
|
is(editor.sourceEditor.isClean(), false, "Editor is dirty.");
|
||||||
editor.saveToFile(null, function (file) {
|
ok(editor.summary.classList.contains("unsaved"),
|
||||||
ok(file, "file should get saved directly when using a file:// URI");
|
"Star icon is present in the corresponding summary.");
|
||||||
});
|
|
||||||
|
info(
|
||||||
yield dirty;
|
"Saving the changes with an explicit file (simulating a user-chosen save location)."
|
||||||
|
);
|
||||||
is(editor.sourceEditor.isClean(), true, "Editor is clean.");
|
dirty = editor.sourceEditor.once("dirty-change");
|
||||||
ok(!editor.summary.classList.contains("unsaved"),
|
|
||||||
"Star icon is not present in the corresponding summary.");
|
editor.saveToFile(cssFile, function (file) {
|
||||||
});
|
ok(file, "file should get saved when explicitly passing a file");
|
||||||
|
});
|
||||||
function copy(srcChromeURL, destFileName) {
|
|
||||||
let deferred = defer();
|
yield dirty;
|
||||||
let destFile = FileUtils.getFile("ProfD", [destFileName]);
|
|
||||||
write(read(srcChromeURL), destFile, deferred.resolve);
|
is(editor.sourceEditor.isClean(), true, "Editor is clean.");
|
||||||
|
ok(!editor.summary.classList.contains("unsaved"),
|
||||||
return deferred.promise;
|
"Star icon is not present in the corresponding summary.");
|
||||||
}
|
|
||||||
|
is(
|
||||||
function read(srcChromeURL) {
|
editor.savedFile?.path,
|
||||||
let scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
|
cssFile.path,
|
||||||
.getService(Ci.nsIScriptableInputStream);
|
"savedFile should now be set on the editor"
|
||||||
|
);
|
||||||
let channel = NetUtil.newChannel({
|
});
|
||||||
uri: srcChromeURL,
|
|
||||||
loadUsingSystemPrincipal: true
|
function copy(srcChromeURL, destFileName) {
|
||||||
});
|
let deferred = defer();
|
||||||
let input = channel.open2();
|
let destFile = FileUtils.getFile("ProfD", [destFileName]);
|
||||||
scriptableStream.init(input);
|
write(read(srcChromeURL), destFile, deferred.resolve);
|
||||||
|
|
||||||
let data = "";
|
return deferred.promise;
|
||||||
while (input.available()) {
|
}
|
||||||
data = data.concat(scriptableStream.read(input.available()));
|
|
||||||
}
|
function read(srcChromeURL) {
|
||||||
scriptableStream.close();
|
let scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
|
||||||
input.close();
|
.getService(Ci.nsIScriptableInputStream);
|
||||||
|
|
||||||
return data;
|
let channel = NetUtil.newChannel({
|
||||||
}
|
uri: srcChromeURL,
|
||||||
|
loadUsingSystemPrincipal: true
|
||||||
function write(data, file, callback) {
|
});
|
||||||
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
|
let input = channel.open2();
|
||||||
.createInstance(Ci.nsIScriptableUnicodeConverter);
|
scriptableStream.init(input);
|
||||||
|
|
||||||
converter.charset = "UTF-8";
|
let data = "";
|
||||||
|
while (input.available()) {
|
||||||
let istream = converter.convertToInputStream(data);
|
data = data.concat(scriptableStream.read(input.available()));
|
||||||
let ostream = FileUtils.openSafeFileOutputStream(file);
|
}
|
||||||
|
scriptableStream.close();
|
||||||
NetUtil.asyncCopy(istream, ostream, function (status) {
|
input.close();
|
||||||
if (!Components.isSuccessCode(status)) {
|
|
||||||
info("Couldn't write to " + file.path);
|
return data;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
function write(data, file, callback) {
|
||||||
callback(file);
|
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
|
||||||
});
|
.createInstance(Ci.nsIScriptableUnicodeConverter);
|
||||||
}
|
|
||||||
|
converter.charset = "UTF-8";
|
||||||
|
|
||||||
|
let istream = converter.convertToInputStream(data);
|
||||||
|
let ostream = FileUtils.openSafeFileOutputStream(file);
|
||||||
|
|
||||||
|
NetUtil.asyncCopy(istream, ostream, function (status) {
|
||||||
|
if (!Components.isSuccessCode(status)) {
|
||||||
|
info("Couldn't write to " + file.path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
callback(file);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -28,7 +28,10 @@ add_task(function* () {
|
|||||||
let HTMLFile = yield copy(TESTCASE_URI_HTML, ["sourcemaps.html"]);
|
let HTMLFile = yield copy(TESTCASE_URI_HTML, ["sourcemaps.html"]);
|
||||||
let CSSFile = yield copy(TESTCASE_URI_CSS,
|
let CSSFile = yield copy(TESTCASE_URI_CSS,
|
||||||
["sourcemap-css", "sourcemaps.css"]);
|
["sourcemap-css", "sourcemaps.css"]);
|
||||||
yield copy(TESTCASE_URI_SCSS, ["sourcemap-sass", "sourcemaps.scss"]);
|
const SCSSFile = await copy(TESTCASE_URI_SCSS, [
|
||||||
|
"sourcemap-sass",
|
||||||
|
"sourcemaps.scss",
|
||||||
|
]);
|
||||||
yield copy(TESTCASE_URI_MAP, ["sourcemap-css", "sourcemaps.css.map"]);
|
yield copy(TESTCASE_URI_MAP, ["sourcemap-css", "sourcemaps.css.map"]);
|
||||||
yield copy(TESTCASE_URI_REG_CSS, ["simple.css"]);
|
yield copy(TESTCASE_URI_REG_CSS, ["simple.css"]);
|
||||||
|
|
||||||
@@ -59,7 +62,7 @@ add_task(function* () {
|
|||||||
|
|
||||||
// Edit and save Sass in the editor. This will start off a file-watching
|
// Edit and save Sass in the editor. This will start off a file-watching
|
||||||
// process waiting for the CSS file to change.
|
// process waiting for the CSS file to change.
|
||||||
yield editSCSS(editor);
|
yield editSCSS(SCSSFile, editor);
|
||||||
|
|
||||||
// We can't run Sass or another compiler, so we fake it by just
|
// We can't run Sass or another compiler, so we fake it by just
|
||||||
// directly changing the CSS file.
|
// directly changing the CSS file.
|
||||||
@@ -73,12 +76,12 @@ add_task(function* () {
|
|||||||
is(color, "rgb(0, 0, 255)", "div is blue after saving file");
|
is(color, "rgb(0, 0, 255)", "div is blue after saving file");
|
||||||
});
|
});
|
||||||
|
|
||||||
function editSCSS(editor) {
|
function editSCSS(SCSSFile, editor) {
|
||||||
let deferred = defer();
|
let deferred = defer();
|
||||||
|
|
||||||
editor.sourceEditor.setText(CSS_TEXT);
|
editor.sourceEditor.setText(CSS_TEXT);
|
||||||
|
|
||||||
editor.saveToFile(null, function (file) {
|
editor.saveToFile(SCSSFile, function (file) {
|
||||||
ok(file, "Scss file should be saved");
|
ok(file, "Scss file should be saved");
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ const SPECIALVALUES = new Set([
|
|||||||
"inherit",
|
"inherit",
|
||||||
"transparent",
|
"transparent",
|
||||||
"unset",
|
"unset",
|
||||||
"revert"
|
"revert",
|
||||||
|
"revert-layer"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class MachCommands(MachCommandBase):
|
|||||||
if not os.path.exists(generated_dir):
|
if not os.path.exists(generated_dir):
|
||||||
generated_dir = mozpath.join(self.topsrcdir, 'platform',
|
generated_dir = mozpath.join(self.topsrcdir, 'platform',
|
||||||
'devtools/shared/css/generated')
|
'devtools/shared/css/generated')
|
||||||
else:
|
if not os.path.exists(generated_dir):
|
||||||
raise Exception('Directory expected at %s does not exist.' % generated_dir)
|
raise Exception('Directory expected at %s does not exist.' % generated_dir)
|
||||||
self.generated_dir = generated_dir
|
self.generated_dir = generated_dir
|
||||||
|
|
||||||
@@ -75,6 +75,9 @@ class MachCommands(MachCommandBase):
|
|||||||
contents = subprocess.check_output([xpcshell_path, '-g', gre_path,
|
contents = subprocess.check_output([xpcshell_path, '-g', gre_path,
|
||||||
'-a', browser_path, script_path],
|
'-a', browser_path, script_path],
|
||||||
env = sub_env)
|
env = sub_env)
|
||||||
|
if not isinstance(contents, str):
|
||||||
|
contents = contents.decode('utf-8')
|
||||||
|
|
||||||
# Extract just the output between the delimiters as the xpcshell output can
|
# Extract just the output between the delimiters as the xpcshell output can
|
||||||
# have extra output that we don't want.
|
# have extra output that we don't want.
|
||||||
contents = contents.split('DEVTOOLS_CSS_DB_DELIMITER')[1]
|
contents = contents.split('DEVTOOLS_CSS_DB_DELIMITER')[1]
|
||||||
@@ -88,13 +91,13 @@ class MachCommands(MachCommandBase):
|
|||||||
destination_path = mozpath.join(self.generated_dir,
|
destination_path = mozpath.join(self.generated_dir,
|
||||||
'properties-db.js')
|
'properties-db.js')
|
||||||
|
|
||||||
with open(js_template_path, 'rb') as handle:
|
with open(js_template_path, 'r') as handle:
|
||||||
js_template = handle.read()
|
js_template = handle.read()
|
||||||
|
|
||||||
preamble = '/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */\n\n'
|
preamble = '/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */\n\n'
|
||||||
contents = string.Template(js_template).substitute(substitutions)
|
contents = string.Template(js_template).substitute(substitutions)
|
||||||
|
|
||||||
with open(destination_path, 'wb') as destination:
|
with open(destination_path, 'w') as destination:
|
||||||
destination.write(preamble + contents)
|
destination.write(preamble + contents)
|
||||||
|
|
||||||
print('The database was successfully generated at ' + destination_path)
|
print(('The database was successfully generated at ' + destination_path))
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -152,12 +152,12 @@ receipt_with_wrong_typ = {
|
|||||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||||
}
|
}
|
||||||
|
|
||||||
print("let valid_receipt1 = \"" + jwt.encode(receipt1, "") + "\";\n")
|
print(("let valid_receipt1 = \"" + jwt.encode(receipt1, "") + "\";\n"))
|
||||||
print("let valid_receipt2 = \"" + jwt.encode(receipt2, "") + "\";\n")
|
print(("let valid_receipt2 = \"" + jwt.encode(receipt2, "") + "\";\n"))
|
||||||
print("let receipt_without_typ = \"" + jwt.encode(receipt_without_typ, "") + "\";\n")
|
print(("let receipt_without_typ = \"" + jwt.encode(receipt_without_typ, "") + "\";\n"))
|
||||||
print("let receipt_without_product = \"" + jwt.encode(receipt_without_product, "") + "\";\n")
|
print(("let receipt_without_product = \"" + jwt.encode(receipt_without_product, "") + "\";\n"))
|
||||||
print("let receipt_without_user = \"" + jwt.encode(receipt_without_user, "") + "\";\n")
|
print(("let receipt_without_user = \"" + jwt.encode(receipt_without_user, "") + "\";\n"))
|
||||||
print("let receipt_without_iss = \"" + jwt.encode(receipt_without_iss, "") + "\";\n")
|
print(("let receipt_without_iss = \"" + jwt.encode(receipt_without_iss, "") + "\";\n"))
|
||||||
print("let receipt_without_nbf = \"" + jwt.encode(receipt_without_nbf, "") + "\";\n")
|
print(("let receipt_without_nbf = \"" + jwt.encode(receipt_without_nbf, "") + "\";\n"))
|
||||||
print("let receipt_without_iat = \"" + jwt.encode(receipt_without_iat, "") + "\";\n")
|
print(("let receipt_without_iat = \"" + jwt.encode(receipt_without_iat, "") + "\";\n"))
|
||||||
print("let receipt_with_wrong_typ = \"" + jwt.encode(receipt_with_wrong_typ, "") + "\";\n")
|
print(("let receipt_with_wrong_typ = \"" + jwt.encode(receipt_with_wrong_typ, "") + "\";\n"))
|
||||||
+18
-13
@@ -304,12 +304,18 @@ Element::TabIndex()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Element::Focus(mozilla::ErrorResult& aError)
|
Element::Focus(const FocusOptions& aOptions, ErrorResult& aError)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(this);
|
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(this);
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
|
// Also other browsers seem to have the hack to not re-focus (and flush) when
|
||||||
|
// the element is already focused.
|
||||||
|
// Until https://github.com/whatwg/html/issues/4512 is clarified, we'll
|
||||||
|
// maintain interoperatibility by not re-focusing, independent of aOptions.
|
||||||
|
// I.e., `focus({ preventScroll: true})` followed by `focus( { preventScroll:
|
||||||
|
// false })` won't re-focus.
|
||||||
if (fm && domElement) {
|
if (fm && domElement) {
|
||||||
aError = fm->SetFocus(domElement, 0);
|
aError = fm->SetFocus(domElement, nsFocusManager::FocusOptionsToFocusManagerFlags(aOptions));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2326,6 +2332,7 @@ Element::MaybeCheckSameAttrVal(int32_t aNamespaceID,
|
|||||||
bool* aOldValueSet)
|
bool* aOldValueSet)
|
||||||
{
|
{
|
||||||
bool modification = false;
|
bool modification = false;
|
||||||
|
CustomElementData* customElementData = GetCustomElementData();
|
||||||
*aHasListeners = aNotify &&
|
*aHasListeners = aNotify &&
|
||||||
nsContentUtils::HasMutationListeners(this,
|
nsContentUtils::HasMutationListeners(this,
|
||||||
NS_EVENT_BITS_MUTATION_ATTRMODIFIED,
|
NS_EVENT_BITS_MUTATION_ATTRMODIFIED,
|
||||||
@@ -2341,13 +2348,14 @@ Element::MaybeCheckSameAttrVal(int32_t aNamespaceID,
|
|||||||
if (*aHasListeners || aNotify) {
|
if (*aHasListeners || aNotify) {
|
||||||
BorrowedAttrInfo info(GetAttrInfo(aNamespaceID, aName));
|
BorrowedAttrInfo info(GetAttrInfo(aNamespaceID, aName));
|
||||||
if (info.mValue) {
|
if (info.mValue) {
|
||||||
// Check whether the old value is the same as the new one. Note that we
|
bool valueMatches = aValue.EqualsAsStrings(*info.mValue);
|
||||||
// only need to actually _get_ the old value if we have listeners or
|
if (valueMatches && aPrefix == info.mName->GetPrefix()) {
|
||||||
// if the element is a custom element (because it may have an
|
return true;
|
||||||
// attribute changed callback).
|
}
|
||||||
if (*aHasListeners || GetCustomElementData()) {
|
|
||||||
// Need to store the old value.
|
// Need to store the old value if listeners are present or this is a
|
||||||
//
|
// custom element that may run an attribute-changed callback.
|
||||||
|
if (*aHasListeners || customElementData) {
|
||||||
// If the current attribute value contains a pointer to some other data
|
// If the current attribute value contains a pointer to some other data
|
||||||
// structure that gets updated in the process of setting the attribute
|
// structure that gets updated in the process of setting the attribute
|
||||||
// we'll no longer have the old value of the attribute. Therefore, we
|
// we'll no longer have the old value of the attribute. Therefore, we
|
||||||
@@ -2358,10 +2366,7 @@ Element::MaybeCheckSameAttrVal(int32_t aNamespaceID,
|
|||||||
aOldValue.SetToSerialized(*info.mValue);
|
aOldValue.SetToSerialized(*info.mValue);
|
||||||
*aOldValueSet = true;
|
*aOldValueSet = true;
|
||||||
}
|
}
|
||||||
bool valueMatches = aValue.EqualsAsStrings(*info.mValue);
|
|
||||||
if (valueMatches && aPrefix == info.mName->GetPrefix()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
modification = true;
|
modification = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -216,7 +216,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Make focus on this element.
|
* Make focus on this element.
|
||||||
*/
|
*/
|
||||||
virtual void Focus(mozilla::ErrorResult& aError);
|
virtual void Focus(const FocusOptions& aOptions, ErrorResult& aError);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show blur and clear focus.
|
* Show blur and clear focus.
|
||||||
|
|||||||
@@ -395,8 +395,14 @@ FileReader::ReadFileContent(Blob& aBlob,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckedInt<size_t> size(mTotal);
|
||||||
|
if (!size.isValid()) {
|
||||||
|
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (mDataFormat == FILE_AS_ARRAYBUFFER) {
|
if (mDataFormat == FILE_AS_ARRAYBUFFER) {
|
||||||
mFileData = js_pod_malloc<char>(mTotal);
|
mFileData = js_pod_malloc<char>(size.value());
|
||||||
if (!mFileData) {
|
if (!mFileData) {
|
||||||
NS_WARNING("Preallocation failed for ReadFileData");
|
NS_WARNING("Preallocation failed for ReadFileData");
|
||||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|||||||
@@ -400,6 +400,7 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
|
|||||||
layers::PlanarYCbCrImage* ycbcrImage = static_cast<layers::PlanarYCbCrImage*> (aImage);
|
layers::PlanarYCbCrImage* ycbcrImage = static_cast<layers::PlanarYCbCrImage*> (aImage);
|
||||||
gfxImageFormat format = SurfaceFormat::A8R8G8B8_UINT32;
|
gfxImageFormat format = SurfaceFormat::A8R8G8B8_UINT32;
|
||||||
uint32_t stride = GetAlignedStride<16>(aSize.width, 4);
|
uint32_t stride = GetAlignedStride<16>(aSize.width, 4);
|
||||||
|
auto size = stride * aSize.height;
|
||||||
size_t length = BufferSizeFromStrideAndHeight(stride, aSize.height);
|
size_t length = BufferSizeFromStrideAndHeight(stride, aSize.height);
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
return NS_ERROR_INVALID_ARG;
|
return NS_ERROR_INVALID_ARG;
|
||||||
@@ -413,10 +414,10 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
|
|||||||
stride);
|
stride);
|
||||||
|
|
||||||
rv = aEncoder->InitFromData(data.Elements(),
|
rv = aEncoder->InitFromData(data.Elements(),
|
||||||
aSize.width * aSize.height * 4,
|
size,
|
||||||
aSize.width,
|
aSize.width,
|
||||||
aSize.height,
|
aSize.height,
|
||||||
aSize.width * 4,
|
stride,
|
||||||
imgIEncoder::INPUT_FORMAT_HOSTARGB,
|
imgIEncoder::INPUT_FORMAT_HOSTARGB,
|
||||||
aOptions);
|
aOptions);
|
||||||
} else {
|
} else {
|
||||||
@@ -433,10 +434,10 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
|
|||||||
return NS_ERROR_INVALID_ARG;
|
return NS_ERROR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
rv = aEncoder->InitFromData(map.mData,
|
rv = aEncoder->InitFromData(map.mData,
|
||||||
aSize.width * aSize.height * 4,
|
map.mStride * aSize.height,
|
||||||
aSize.width,
|
aSize.width,
|
||||||
aSize.height,
|
aSize.height,
|
||||||
aSize.width * 4,
|
map.mStride,
|
||||||
imgIEncoder::INPUT_FORMAT_HOSTARGB,
|
imgIEncoder::INPUT_FORMAT_HOSTARGB,
|
||||||
aOptions);
|
aOptions);
|
||||||
dataSurface->Unmap();
|
dataSurface->Unmap();
|
||||||
@@ -467,10 +468,10 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
|
|||||||
return NS_ERROR_INVALID_ARG;
|
return NS_ERROR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
rv = aEncoder->InitFromData(map.mData,
|
rv = aEncoder->InitFromData(map.mData,
|
||||||
aSize.width * aSize.height * 4,
|
map.mStride * aSize.height,
|
||||||
aSize.width,
|
aSize.width,
|
||||||
aSize.height,
|
aSize.height,
|
||||||
aSize.width * 4,
|
map.mStride,
|
||||||
imgIEncoder::INPUT_FORMAT_HOSTARGB,
|
imgIEncoder::INPUT_FORMAT_HOSTARGB,
|
||||||
aOptions);
|
aOptions);
|
||||||
emptyCanvas->Unmap();
|
emptyCanvas->Unmap();
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ public:
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(!NS_IsMainThread());
|
MOZ_ASSERT(!NS_IsMainThread());
|
||||||
|
|
||||||
int32_t written = PR_Write(mFD, mData, mLength);
|
int32_t written = mLength < INT32_MAX ? PR_Write(mFD, mData, mLength) : -1;
|
||||||
if (NS_WARN_IF(written < 0 || uint32_t(written) != mLength)) {
|
if (NS_WARN_IF(written < 0 || uint32_t(written) != mLength)) {
|
||||||
return NS_DispatchToMainThread(
|
return NS_DispatchToMainThread(
|
||||||
new ErrorPropagationRunnable(mBlobStorage, NS_ERROR_FAILURE));
|
new ErrorPropagationRunnable(mBlobStorage, NS_ERROR_FAILURE));
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T,
|
template<typename T,
|
||||||
typename = typename std::enable_if<std::is_enum<T>::value>::type>
|
typename = typename std::enable_if_t<std::is_enum_v<T>>>
|
||||||
EnumTable(const char* aTag, T aValue)
|
EnumTable(const char* aTag, T aValue)
|
||||||
: tag(aTag)
|
: tag(aTag)
|
||||||
, value(static_cast<int16_t>(aValue))
|
, value(static_cast<int16_t>(aValue))
|
||||||
|
|||||||
Loaded 100 of 3158 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user