Now that the first set of patches has been pushed, we need to update GCC's master branch with the current state of the compiler.
I want this issue to serve as an infodump and overall discussion on how to achieve this:
The cutoff for what was pushed to GCC's master seems to have happened around #1497, commit 36a9255, on the 23rd of August 2022.
At present (2022-12-15), there are more than 5000 commits between #1497 and master. This is due to the multiple merges from GCC upstream that we've done in the last few months. I approximate the amount of commits we need to take care of (commits to gccrs specificially) to ~300. I got the list of commits thanks to these commands:
[email protected] ~/G/r/gccrs (master)> git log 36a9255..HEAD --format=%H -- gcc/rust/ > all_commits.old
[email protected] ~/G/r/gccrs (master)> git log 36a9255..HEAD --format=%H -- gcc/testsuite/rust >> all_commits.old
[email protected] ~/G/r/gccrs (master)> cat all_commits.old | uniq > all_commits
better way (thanks @tschwinge)
Just use
git log 36a9255..HEAD --format=%H -- gcc/rust/ gcc/testsuite/rust/ > all_commits
. And, given git remote upstream git+ssh://gcc.gnu.org/git/gcc.git, further restrict to36a9255..HEAD ^upstream/master
to filter out all GCC upstream master branch commits that we're not interested in tracking here.
551a77c413862a98606638eeb551bc1b6a440aca
404cdd1eeb6f473ef690ad780798800948f946ee
fe648fb91c51cb477cf0380105c0bb85796be2df
0d0de2c6c5861701a78d52e63feaeb7a5b79b5a3
caca467268ad8c6a3c2177b9d3ac50d5299263b2
74e16385964d6c03d99916654389edf39e768147
24ff0b3e0c41e3997fb4c11736b8a412afbaadf3
62d1620c91053438399064fa4eddb15d09cbabf4
88e509b1b1423867b138617c87a3e709c1db95eb
d77d5be0695a247928998f8d2511e4e06e67c4fe
d0cb3248ce6afcff7f2daff3a761cc4286e6b7a2
db4970e9db6c8425cf118f695492d55bed85e95a
b36e8cac9faaa245baa3c0579a6584d375f24e2c
ca0a935cdc375f4747ac67b7dc978be06041dab2
d9d9ca0b9e50b669d5445e028739bcdd0aa024bd
a2ae23a9f2703519ab0e0709ca9785005c1ed872
a6285cf21959e806066edd8984caddc23fea2fce
50cd4d91e339233caf756f2366555ea8a01b5787
277497f77cdbd85e4aad4a52bce3ea442a44cdc0
b2d445c2bbb15e6a1f1d0e5ac693fd671ecaa473
3df7703a627ed3a070c91cf2e3b92ec993684531
9b6cd2601d69bade02b150d24567596dc3e2d2c7
ef9788471008be413a9c545a9500f6287af32ad1
be9740eaa6479d5e819637b071fc72c1edc200d5
ddd1b481a0b655716b06962053712fad7f8efa7b
f3cb834600e7465ac8f5167c45376a534579e2d3
a3a755838fd661fcfaf34b794cfd1ac9822126a1
48b11d3bb83e27795a419e473e4822329216806a
3053ec366093560a6269aaace61ce77fb8710b01
3573ec082f12440a42fa1bf6fdafc578d280870c
b5c354de73ddccb7738778c1e013d42b96aeb048
6c5dc8aa1a99bc3a0220aeabecd84ffa6f233433
d07cae9e4b4402a19c5a1371c09d899002362d5d
071e8b001c7834c38dc4db697dd10d26eba67149
9da783d1b71bb5e8add0cf74527786d0e4255803
4c66e0f3c105b2ae929d224acadb70b3b95b5333
fc59d137491ce393797dfec1d8cd5251a41b5f67
71b8beb150d96548a2ebfb8ef964d14225e300f0
b43c5d4fd82c220419f9234588fed8131d416fff
9ef8144e3994dea423011c0c248a0ea71c73cf25
bea720bef773efce55391ef005b7be990b9bfc50
9527e9985890e30c7687c9482b669e3f5338f9fe
b0ec92f7d4b577ff483e3d8992d4ea43f59dbfeb
fc944a02419c633a04390d1c8df0684587f87fb7
78df522226ecc92f167f6d177c098847c1267c10
a3dfe962eb96380d0382dfb5fa243e36591ff6fc
5c943bf43888f9dd1a5934f678de8b8435f1199a
4c69451b3d46db438a5c2cc436f7b02dbf4bbab2
0e026b6c33d20a7d1b8714df73e9157ede98af70
9147e08003b935e312437ec61e83120c8eceb74b
6c432d6ca2f767f5afe3006e6aa8d5123e4f4636
0ebbd2a451145cedeaec99e8a31372befecf85f6
8c239b1428ee4a36530ecbbd5bf36eb9333e9697
9b6d82061208796389e064cbe6707a3787a264fe
496ed46e0ab377d89c39ff85c104fd26f8e987bb
20bf6802ba7b964ec1e570dd4fec971fa3d678f6
0eaaeb4b3592075fe30d3a8aa57941dd40c6f256
f4d78133368ff453eaf60413c697cf848ad1e17e
27136db8fd7b428870f6c85ae4b328f54c8de4bb
9657c328d0cdda49b7985c3ee727781a387e128b
22977337faf0c1a80af36b00249aed30fa586f2d
7264aac826e5bec3861331af736cadeef123b277
28ae1589e13a5917db55eff8de7355a6f54641f8
ec62fce8e89a67b2f67d8c42a34e8b12f4765c08
1531256aa661c8007c9bc6a496f5224bed55fe3a
f726b12ca106307d739f1bb483a532a911985441
d8d81d818ded0c450fdbd6c70456ed67fe469c16
b6ce6882fb601f0b782fa1e8d9e43da8582413ea
4a514b7a925653e03c7d7c31635bc7b89310d63a
dd6296cffed6943de1cde7baead9177404323c4d
7486d6cda4205fd6df47caf5e9a9451f7d9f7705
77cba0083a86c63f619b41eaf2acec61ea04d6c8
56a227a63b3843fd5eadc093079b833fe1f93ef9
b0bde7e2b5bafb111552e634b520cd908a767554
0e08acbf2c5747089eb278f8b2addf161077322e
2d1c287af3a074d40e84234be9feca904af627d5
353ed6ce8add32b84f0fdfbcbc020d8f7154530d
2357b5d5138a926d7b3f054aa66549482bec9be6
259c384a97f7735da899b54c686585a60c41bed1
e9e3ca5ca6a84704f0350a226a257b56f983451a
5206aede5326ebd327d7f32c46faacbc6d07942e
c5454530ec4fe8b3c5f2f08191aece5544dec2d2
0b7cd54d63c2f8728711f5cb27f6ee66f4862eca
639341e5b746e7ac56dc3b11f757d65f708c3b8c
c1ff8a96f6c11052e54919f786eb7cd4b3788f4c
8d3ed915652fb170a12c24dfb283b804611adc8e
3f3b4a45eb90b5afdfd9d067fd9ea7969b5a69d6
d8a8061f2e884aa2aa31d746c4cc104083bbbbb6
19461b9e9ca434d69ca2fa00fd3383174841e210
fc2aa3cd381613a69129cd183a352f3e3c23643b
db4b399c25fd3c37e52c6b8dbdf6bc9c0f1deb6c
dcb38a3e45ddc62dd1d0649471b3267c5108967f
1e11f00ca1d04548704fe899ba36e1fd91802752
2bc1c5309206169776bdcab862aa2b3da7fc8c95
14c942c3eb060e063fd8142d390c6d09951bf544
4d42744aa5d5778975d46ac9f5c945f9c7ec2ffa
0cf743d57fc67d88ecba654be8574ea9a5be40d2
b664c8bfd0917ed34ed9d3f15f3f1823200e3e4f
83e5265d6af48e1572cbe019b4b7f7a5603086a9
6304177c2b53420d365d210a6635a17ab9d91549
da13bf4bbc46b399419c3e7f2c358a0efe3bdfdd
490aa25d5564313c1957bf28533fe902a0aaa1f2
60b21d2f58f46c93fc33f6192682abfed62d8dd9
05bd0555fa398c171acc22b6cfa1d5974202a5c7
f6f87dead4bf2da20bc3a22dc6ca7a373c9ed05c
d396692534019f1e80b821c9e483164f302679bf
8e09dfb538db9af6eb312ecd0a5a4e5931db201e
678bf852435aca6de25704ca417fab257fe03da9
feaa40602b7ecad36de8dcb6c387e686d04ce207
e637c0445bc4633a1a6ab1d5c32e3ee82cf03152
662a7a90305f3c5df24765ec6de6c4e56187ae1a
dfb5921b76589c09e7794f5f8010427b93616e9d
8c4cf085d9afeada0e6c79c29904ee597c51bd25
8e2d13922fb4af8d00bdabd7af964e4f11b84259
5f25f457eca1e04e577aae8e60fe640bb32d36fc
851b9e14585160f70eb17a9b312c14e3a0d4c3ed
a28e7dcb463c16db545566218cff3c164c410959
89490980726d298311107a452bdebeb43a2ff7e6
540d896c3fa745efdc96ad34e7e5c585f9b7b93f
4f2c1499feafb46bf88824c4019ef15d2a68d3e8
0a52177612f6e855732c6ded77a04ba40dfb0d19
381e061438836b7ca360c7741e9a13ec6d643b1d
15229ea41faccfd2cbe4309b2afe333b56b090b1
a14da50ebe674b8444c578454cd7914327f90755
b2add3214565a70403402e80e11352f8a1e3681a
3922772f5f2e5ab245342defca6b53e1563de881
25d243dd18afe734626e2eac482409aaefb6d24d
cba464b9e08c306d4c54609bf5b15eb5e0b23324
b6d4c62a84553f79fef12a9a5a9a305a560259dc
85651630ad66b1e561453cdb28603eead88dd2ad
68af6007a9f44496eab9364141741b09ef75d5b0
95be10245b0fc13f846a09c5037ed273ee3588d9
fa0bd801922d095893c9318ad1d0c78141c05796
e8c82076bc6aff3d8df4da228dfdb617ae7372e2
c85492954ded963d937de1fa8731be0718d117eb
84ca2f9123a7d5206d70d5b3bdc18d98c0cee2e0
d27cb6e12827b9a0d7ac024f15e3aa04650083c9
53e2df36a23e6f1ec820c5ef51bb07842c2ba0b7
6927e3ee00d22bca1ef2d3e5e58a0705a7578067
191907df1fd4d09567cc1e05835564df727cfb13
45326391da3e6800fa0a9e1f89420ac3a5ae340b
a5a86282306eea70b7c89bd221b8e8f1afa77a2e
8cbcff46d34c998239dfa1792fe7459699658c62
9bac2dbfe999b0dffea65b9a1b6ed0a257edf3c8
1a871569f66cdf1a0aabb3a50d5877a8b1c9db85
0a9a3e826faa319a5c0e6d4ca273db2b735a6beb
63d901e48f0429d9d203ab56ed0038e6ebfc0b03
32e45c4076c6eed1a632498844c4f1189b4576d1
6dca194d4b556dfe27cb7865142ad595f3a96c95
113f73f368277deeea546f6133f7c85bcccb30f7
3dc104bc8aaf3edf7aa59b11efacdd9349054df7
5346330e869e7230164b14e04e18b0d74e80901a
d4c07a9b47c7063a4e79b6b45edccd0e79249605
06fe912b70bc21dd11e7279e29200431a5b50aa2
bef31ea273689021f0fc8168f417edf386060512
71397abfbe573beee3415e7031bcea84d80cdd6e
93937bd6582f3de40a7aefb0c639461a907b3fe1
1f9d7ec437307c02427e2977806be656a28c360a
b64b889e15ee6119605f4d52b2b3703083b835cc
4134055f1855ea5293fa598fc3503e07a11d1d9d
a7d2643d9b09af9f5c5c670626becaa0c0fc1481
e033f1705dde104c44d69cec87cb728dba596c6f
fc746fd620118f91bb8bfc139c7be3fb2356e820
adaf4561d63f08714f8c289bef0f4c5649fb6829
6e0ba5f8a58fc4fc70818162ca560c4b94df3688
a8b1f98f832d45bed4d2bc932297ff5acc39b3c9
e9e5288a303df10829d1f34e3d2ebff793a74ea0
d55f22d046f5b54ec6d77af040aa1805e12ea9d1
b220923f96344397c584245c09234a700b0ca243
f97e0ca6e4e5efb33a47f8a1f0a49375fd1197f9
066b6b8df960796362dbdcff62851ebea201b8e9
d1069815fa6238712f51a23dfd43d2ae6cd7c5e8
040c5f8933f58bcac170e0eb42f2c2279cab832b
960d9d289e47ecad67a32f6cf5ace0c11ab84191
b71e3dc02a8fd3141080419b7fb1a24d2c4133d0
b17e69852ea999547305b19e9c8da385f6c31e1e
96c8baa8a7a8aa796450585c1ba2c1fe2428b6f4
770a2449e8e3b7c9c8a9627ce5d57c3bcd99177c
3a24dde2e7adec97243b95c79ea7877698f17c19
af3b5be6c99f359691b15001ed04d0d457841ba8
a16c35340c833ed25035c664ee33551d17309601
6d98713a7b9cc58573be3e209a27a6c4ce682166
138a6260124740208b8f3aff2e38617f43b05fe8
cfd2938f069598e9be25484f16ac045606c69e72
a6bb21fca5b9ad5cadcaa6a3dba481972ce0ed7e
6b6a1c70f47237a5c2db76db62d7f8956244dee6
53f4a8601c1db2068390dce7012c16b383864740
d4da06f721577d3eaf2e21d6c6735d32a69d6ac7
c71b174a29cbd85a4961686eacd02d1fe2a36ea3
7ebe6693360dceb044fb4eaf6ae83fbb35eef451
bed01725c1c6a7a463a9b42082ef91a5406588ec
a4f07c8391287c4cc95900f86e16b0f667396f36
63403f0af7203f3b3c4bc2fef52fee884bb728b8
126c7c9d7a2f9023115d6c692dbcf9e981ba2b4a
721c7a472c4cf5dc74337c997ff627187b577d60
ceb43210f8a6dfec98f634c326964328d1247f57
5acb1375c9c57b4cc0af13f4ccea0d609942bc0a
b1cf3a384d41fa34c1eb819696e66fa65625d8db
5a0c27cb799ec7fa864dbdc64905f6d80a15e9b5
119b4c098256a470cf4ab39580159179c48e0cb2
5175404928bc5081506d0eb4cab193e8689f879b
ebb127f2aed32f21a37b31e8a5330defc6bfe5e7
fcf6fea382f65930cd4f32f7661bc5d64d1559b4
842829a591c39c24332c3605606f5d89ff89f7d6
2bf4f17d1ff0dbfd5c21776f45094d518f01cd49
017be6aeb8f3803a26cf11ef633ce24fca7749b8
8dfa9676db0f8660c6c745adb59ef6323dca2341
32be5443e30189c9236c62a864e6549804860977
b376c0cb37c9f712d60d8aad9aab37237adf3563
a8403dd7fad9acc0dbe02418f7d77273b735c24f
bc2fe97fad18ba518279b7058512606bc99cc2ca
64c7a90934f03630356c76d7aa9ba6978ee4e9e6
702bb4bb01b93bb7c0f070883baf547ffdbebd17
c6a7ab78ff760bb240dca95ca034cd79f5ba6464
bcab5d906c580a17a44a5beffefaa806f4e75518
fc82b68cc1ee2778f2bfc53c5de47e5b36ac8b7c
595cbafdf342369ceaffd8fb4d909a9c31bef207
ff7d6bfed2e7bc08fba1cc456daf464e6176dd46
3e79563a65e78ddb6b2ef10df7e1d4e3441aaff2
1416b85322cd9cd74c7a79e3270bb334ceb3a44c
727afe64d6c6ccc6c360da0707de4b2bd74a96d9
43b7dd91fb0df9cdb7708581089bd3cd36f14a43
49cddf6e588f443262958a60e0444abc4945834d
a3e1361d1ac1ae892d25737e0ee21e71db423a07
5a8f2fd653afe2e60672678d9cbfe0fa8a5e4124
f83e254c29dc3690603e06a98d94b3d39eb853d7
2f7fbbaad1365c786f0f7eaa0687e8ba9e0876f7
0f8e2c1e2f5f0ed55d807703e45f598d9f00aca1
4ca228d2f32e5eb6e9516f487be85383225d5a00
debe4aedc76a1f52c3072254b6be4da4f4c4696c
533effe0f3f49c144df3e1a918f422d2982d21bf
8c2da345e08b313dfd0548064cdb3813a7c86d5a
9350b3733aef7c93ccd3b50d610e2831016db02b
1c53bc4fc8f687bc44f26b1dfd51a6e4745ef09c
e1170b0abe208b212eb395dc1d79fcfb7515e754
bd31c63fe15c4e39d3036ff7adcd22eadd6b53ea
a38ad0b614ff5d601e5425824ad760235710eee5
d780f02a54ff9cb0b5fd181eb21ae9afe2fd7d1c
6b440d46f16e3f93dd979852a1aab55f88add75f
3e6dfca3166f8137deff833bcea7827e38b28fb4
bbc514d024a232dacfe218706dd07dcf01a51314
c628a66a92f72add62608c2c24cf0ec4c5ae45af
e8e58d54db23acc03bba3bd9a89cfe35cf3c2ba3
30b2f58b544acfa8a90cc4f0cf5d6ae7e0956f37
266891d17c751d104d8c75e0258cf1b462756ad9
fdbe92d898f11a4d395b5ee9a547707675edf442
23bde7d7c663302c803f0a7e4324630eae825008
e991065fdbee901d4bfe3af89e0d497e74dcc7d3
f21f475feca30d0c9fb74dfe3bb65a6d88d5311c
a360c28cb6c2536a4ab3dfdaebb63ae05354a054
17663caca44a5be8fd9d9de7eab3190c40bc594a
d4e80fd645a9b4cac48957283e820f23d6e18aab
4fe7b96c2726322191c0eadd2c1c712afb3d0299
8a9b94d8c3ac6c691fa49585756c0df234602d8b
44b80bf0240aefb56d9abcce59c15a24a22048f4
bb4dd8fbc857a78bb4bfb69f1bdfdcbd9b1b6cdb
121c8dd00de81ec9c11d494d402e4761dbe4fe4d
a00b61e6bfc4a79af55236db0e602e09cd8fda72
7c13a2e5873f5919c00b5f37b6db52af8d0f7300
a5b583d021a4cbbfafecc28445709afe32cdd1c8
3343535fdb7fc36e68949a8642d7e67668b67f6c
b394fe4571f6c6207c1135da1297bf44f750bbf4
b9c08d705e6174bbbd0670b196d24e00b6f84d33
f6f1984c3e483e7c00ef8822d310d98ea752d92a
4bae115bfd2c10fc975547b0d4ef9e9a98d51fa4
a9055d8294f28ae84023cc93ae8d8b14747a2d0c
b1ddbf1851aab77fd945046c73359b58e9c8383b
825a44b40ce6cfa76470e53d0746b1e64b99ee5b
56f503b88a240f1d77c8d6564656bc22269b4842
6dea70e1dafa603b2327bfb936d26fac95f46069
31dd14e197c00891751994839b16a5a193a71820
3053ec366093560a6269aaace61ce77fb8710b01
071e8b001c7834c38dc4db697dd10d26eba67149
fc59d137491ce393797dfec1d8cd5251a41b5f67
27136db8fd7b428870f6c85ae4b328f54c8de4bb
716ae8d024dcddd5000f65fa5c7c0dbd9f03c869
d8d81d818ded0c450fdbd6c70456ed67fe469c16
cdcfe27cfba23402f91200c64c1ef8e0bf3528a0
b0bde7e2b5bafb111552e634b520cd908a767554
0e08acbf2c5747089eb278f8b2addf161077322e
fc2aa3cd381613a69129cd183a352f3e3c23643b
4d42744aa5d5778975d46ac9f5c945f9c7ec2ffa
83e5265d6af48e1572cbe019b4b7f7a5603086a9
05bd0555fa398c171acc22b6cfa1d5974202a5c7
678bf852435aca6de25704ca417fab257fe03da9
0a52177612f6e855732c6ded77a04ba40dfb0d19
9bac2dbfe999b0dffea65b9a1b6ed0a257edf3c8
d4c07a9b47c7063a4e79b6b45edccd0e79249605
71397abfbe573beee3415e7031bcea84d80cdd6e
a7d2643d9b09af9f5c5c670626becaa0c0fc1481
5a87f5f469bb214da2ace06c5a24775044c608fc
b71e3dc02a8fd3141080419b7fb1a24d2c4133d0
b17e69852ea999547305b19e9c8da385f6c31e1e
b37c71dd77db88e769b1119646cd25e99065c0da
6cae31a09ec64f4536d70f6d630e50f0543da363
96c8baa8a7a8aa796450585c1ba2c1fe2428b6f4
1c19256b70634ab62eeddefed58556bfc4912a90
ca3a03dd74c0f0300597bca257f7e0f6250fc57b
a16c35340c833ed25035c664ee33551d17309601
6d98713a7b9cc58573be3e209a27a6c4ce682166
138a6260124740208b8f3aff2e38617f43b05fe8
cfd2938f069598e9be25484f16ac045606c69e72
5f01d6c53734802955568771e75df68ffc2fd0d8
d4da06f721577d3eaf2e21d6c6735d32a69d6ac7
c71b174a29cbd85a4961686eacd02d1fe2a36ea3
7ebe6693360dceb044fb4eaf6ae83fbb35eef451
5a019b1e71affaf474e2878e51fcc5c7d1068d5b
f252b4093666cf1e3d948b22f00fc12bf283a83f
6839ad40eebf982f149452cc294ab387350abcef
908f1e2022cd1b957a33187d921455ff86749065
a876e9e8f0c48b476116b0f5808ab32dfb520f56
a4f07c8391287c4cc95900f86e16b0f667396f36
5a0c27cb799ec7fa864dbdc64905f6d80a15e9b5
ebb127f2aed32f21a37b31e8a5330defc6bfe5e7
017be6aeb8f3803a26cf11ef633ce24fca7749b8
32be5443e30189c9236c62a864e6549804860977
b376c0cb37c9f712d60d8aad9aab37237adf3563
bc2fe97fad18ba518279b7058512606bc99cc2ca
702bb4bb01b93bb7c0f070883baf547ffdbebd17
c6a7ab78ff760bb240dca95ca034cd79f5ba6464
fc82b68cc1ee2778f2bfc53c5de47e5b36ac8b7c
595cbafdf342369ceaffd8fb4d909a9c31bef207
727afe64d6c6ccc6c360da0707de4b2bd74a96d9
c52268c6d22bcecef596dffd3c31b78d225f59b6
49cddf6e588f443262958a60e0444abc4945834d
825a44b40ce6cfa76470e53d0746b1e64b99ee5b
56f503b88a240f1d77c8d6564656bc22269b4842
I'm sure there are better ways to go about this, but it's fine for now :)
The main issues for updating are the following:
Before the final cutoff (April 30), we will need to do the following:
I think there are multiple ways to go about this, which will also shape how we go about updating GCC's master with our frontend later down the line.
I don't mind doing this, but it's a herculean task. I'm hoping that ./contrib/mklog.py
will help with that, and that I can reuse some of the commits messages/PR descriptions
A bors merge will contain one or more PRs, and can be used as a single point of reference in the frontend. We also haven't been the best at making sure each commit builds and passes the test (I know I'm at fault for this), but we do make sure that each bors merge passes our CI.
For this, we'd need to squash multiple commits together into a multitude of "batch commits" which will each contain one long Changelog entry, so one Changelog message per set of PRs merged together via bors.
Going forward, I also think this might be the best way to generate changelogs without hindering contributors or newcomers with Changelogs.
git log 36a9255..HEAD --author bors --oneline
shows only 90 lines, which seems really low, but maybe?
I think there are two parts to this issue:
I think there are a few options like you have pointed out here:
I think if we work on scripting this will be useful regardless but we end up with git sha's that don't match in both tree's so it makes me think that option 2 might just be the simpliest.
I don't think so this seems really tedious to me and not helpful since git already provides this info
If we squash the commits and generate the changelog this is not good for multi commit PR's
If we script it so we upstream each patch with a changelog that's done with a script we end up with git sha's that no longer match in each tree.
I think on going we need some mechanism to auto-generate changelogs for people, this will be possible with a git pre-commit hook to check clang-format and generate a changelog for us when we are making commit's from now on.
We can also turn on the magic that GCC uses to stop commits which don't have a changelog so that we don't miss this on merging as it should fail. Though this might make bors a bit of a pain because it always wants to do merge commits. Maybe bors is just not going to work long term.
I think if we work on scripting this will be useful regardless but we end up with git sha's that don't match in both tree's so it makes me think that option 2 might just be the simpliest.
Agreed, but also if we go through the trouble of updating those 310 commits it might be worth considering rewriting our history with these commits + Changelog
I think @dkm mentioned before an alternative to bors with a github pipeline thing that allowed to rebase changes etc maybe we should look at that moving forward.
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue maybe this is it seems pretty much a bor's setup is possible with just github magic
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue
Looks very similar to bors. It also groups pending changes together.
The way to use ./contrib/mklog.py
is to first generate a patch for a commit, and then run the script on it.
For 56f503b88a240f1d77c8d6564656bc22269b4842, this produces the following log:
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path):
* resolve/rust-ast-resolve-type.cc (ResolveTypeToCanonicalPath::visit):
* resolve/rust-ast-resolve-type.h:
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit):
gcc/testsuite/ChangeLog:
* rust/execute/torture/issue-1249.rs: New test.
No surprise to anyone here, I do have opinions on this topic. ;-) (..., but not time right now to discuss in detail.)
[email protected] ~/G/r/gccrs (master)> git log 36a9255..HEAD --format=%H -- gcc/rust/ > all_commits.old [email protected] ~/G/r/gccrs (master)> git log 36a9255..HEAD --format=%H -- gcc/testsuite/rust >> all_commits.old [email protected] ~/G/r/gccrs (master)> cat all_commits.old | uniq > all_commits
Just use git log 36a9255..HEAD --format=%H -- gcc/rust/ gcc/testsuite/rust/ > all_commits
.
And, given git remote upstream git+ssh://gcc.gnu.org/git/gcc.git
, further restrict to 36a9255..HEAD ^upstream/master
to filter out all GCC upstream master branch commits that we're not interested in tracking here.
I agree that we should separate the two items: (1) getting the backlog upstream, and (2) how to deal with new work/commits.
For (1) I think we need some proper spreadsheet (or whatever; editable by all interested parties), so that we can cross out, for example, patch plus later reversion, and that we can mark up individual commits that belong together. (These will often correspond to one GitHub Pull Request, but may also span over several.) The bors merges sometimes combine several unrelated changes, so I'd prefer to not work based on these.
It's a bit more effort, but I suggest to not do bulk merges/mega commits, because that loses author information as well as comprehensibility of a changeset. Generally it's better to handle conceptually different items individually. (..., but, of course, merge in any partial reversions, fix-up commits, etc.)
For (1) I think we need some proper spreadsheet (or whatever; editable by all interested parties), so that we can cross out, for example, patch plus later reversion
Good idea, even if I'm not a fan of a spreadsheet :D
, and that we can mark up individual commits that belong together. (These will often correspond to one GitHub Pull Request, but may also span over several.)
Do you mean that these should be squashed together in one "upstream commit"?
The bors merges sometimes combine several unrelated changes, so I'd prefer to not work based on these.
:+1:
It's a bit more effort, but I suggest to not do bulk merges/mega commits, because that loses author information as well as comprehensibility of a changeset. Generally it's better to handle conceptually different items individually. (..., but, of course, merge in any partial reversions, fix-up commits, etc.)
Yeah, I'd rather do Changelog entries for all 300 commits than lose author information. I think this needs to be a focal point of this whole thing
For (1) I think we need some proper spreadsheet (or whatever; editable by all interested parties), so that we can cross out, for example, patch plus later reversion
Good idea, even if I'm not a fan of a spreadsheet :D
I do sympathize! ;-)
But it works for that case. ;-) (Doing the same at work, too, to get changes from our development branches into GCC upstream.) Could also use Git notes, or a lot of other things, but in that case, a simple spreadsheet does get the job done.
If you'd like, I can set this up, so that you can see what I mean.
, and that we can mark up individual commits that belong together. (These will often correspond to one GitHub Pull Request, but may also span over several.)
Do you mean that these should be squashed together in one "upstream commit"?
Yes. For example, things where we currently have individual pull requests with commits like:
PR1:
PR2:
... that should become one "upstream commit".
I think most of our PRs are done in ways where each commit makes sense as a standalone. I know that apart from a few straggler PRs I've taken the time to squash commits like the ones you mention, so for your examples:
PR1:
gets rebased before merging and becomes
but yes, that leaves joining PR1 and PR2. Which seem like a lot of work for some things...
FYI, I've been playing a bit with this and first tried to apply all missing commits onto current gcc master. The command used to get the commit list
git rev-list --reverse --no-merges '^upstream-gcc/master' '^36a9255' upstream-gccrs/master -- gcc/rust/ gcc/testsuite/rust/
I had to skip several commits already applied, and in the end, the result is mostly in good shape... But I'm wondering if the cutoff date is the correct one, because the "mostly" above hints that something is not quite right.
For example, 36a9255 (last change from gccrs from github to have been part of the merge in GCC) is a parent of f5f32fb4a36c742f0b6b5cac994550b3003c9f3a (the inline visitor)... but the corresponding files are nowhere to be found in what has been merged in GCC.
Files gccrs-master/gcc/rust/ChangeLog and gcc-master/gcc/rust/ChangeLog differ
Only in gcc-master/gcc/rust: CONTRIBUTING.md
Only in gccrs-master/gcc/rust: gource-gccrs.sh
Files gccrs-master/gcc/rust/lang.opt and gcc-master/gcc/rust/lang.opt differ ## empty line diff
Files gccrs-master/gcc/rust/lex/rust-token.h and gcc-master/gcc/rust/lex/rust-token.h differ ## empty line diff
Only in gcc-master/gcc/rust: logo.png
Only in gccrs-master/gcc/rust: monthly-diff.py
Files gccrs-master/gcc/rust/parse/rust-parse-impl.h and gcc-master/gcc/rust/parse/rust-parse-impl.h differ ## Real diff, also hints something is not correct
Only in gcc-master/gcc/rust: README.md
Files gccrs-master/gcc/rust/rust-lang.cc and gcc-master/gcc/rust/rust-lang.cc differ ## some include changes
Only in gccrs-master/gcc/rust/util: rust-inline-visitor.h ## the inline visitor missing
Files gccrs-master/gcc/rust/util/rust-make-unique.h and gcc-master/gcc/rust/util/rust-make-unique.h differ ## indent change
I may have more time this weekend to have a look, maybe this is all wrong... The wip branch https://github.com/Rust-GCC/gccrs/tree/dkm/gcc-master-updated-to-0152926ab36
I've messed up a bit some commits around bootstrap flags, so some commits should have been skipped but instead caused conflict and still appear in the branch. I've listed all commits that caused conflict or have been skipped.
FYI, some commits are only in gccrs, but applied to generic code. For example: 05f1f87274a4ed13c0ab84de77d4253776b46637:
commit 05f1f87274a4ed13c0ab84de77d4253776b46637
Author: David Malcolm <[email protected]>
Date: Thu Jul 21 18:35:01 2022 -0400
diagnostics: add error_meta
gcc/diagnostic-core.h | 3 +++
gcc/diagnostic.cc | 15 +++++++++++++++
So filtering rust/
and testsuite/rust
may miss some commits.
FWIW, I've pushed https://github.com/Rust-GCC/gccrs/tree/dkm/gcc-master-rebase-on-pr that adds few missing commits. There are some minor diff I'm trying to track down, but bootstrap and test are looking good so far.
FYI, some commits are only in gccrs, but applied to generic code. For example: 05f1f87:
commit 05f1f87274a4ed13c0ab84de77d4253776b46637 Author: David Malcolm <[email protected]> Date: Thu Jul 21 18:35:01 2022 -0400 diagnostics: add error_meta gcc/diagnostic-core.h | 3 +++ gcc/diagnostic.cc | 15 +++++++++++++++
So filtering
rust/
andtestsuite/rust
may miss some commits.
Ah, I think we should ask @davidmalcolm about that one. @dkm do you know if there is a patch associated with them yet?
AFAIK, there's no existing patch pending for review for @davidmalcolm 's patch (same as for @ibuclaw target related patches).
You can see the current diff between the branch merging GCC's master in gccrs's master and the sequence of gccrs's commits being rebased onto the same GCC's master : https://github.com/Rust-GCC/gccrs/compare/dkm/merge-master..dkm/gcc-master-rebase-on-pr
gcc/rust
(all the CONTRIBUTING.md, logo, etc).github
stuff.gitignore
gcc/configure
: minor diff, caused by 066b6b8df960796362dbdcff62851ebea201b8e9gcc/rust/lang.opt
: blank spacegcc/rust/lex/rust-token.h
: blank spacegcc/rust/parse/rust-parse-impl.h
: Jan's patch a bit different than Arthur's patch for the same issue.gcc/rust/rust-lang.cc
: include diffgcc/rust/util/rust-make-unique.h
: blank spacegcc/testsuite/rust/execute/torture/macro-issue1426.rs
file moved and changed (not sure which one is to be used).Commits since 2022-08-23 need Changelog entries
All my changes should have had a changelog in the commit message, unless something happened during the merge process.
Yes, they have! Do you want your commits to be sent along with the other ones for review, or do you want to handle them yourself @ibuclaw ?
I believe we've now reached a point where the only work remaining is to do the actual work :) @dkm put together a list of the commits we need to check before integrating them into GCC's upstream. Since we want to preserve authorship, this concerns 224 commits. Again, thanks to Marc we have a nice script to perform all of the checks :)
In order to keep the GCC history nice, clean and bisectable, we need to make sure that each of these commits is in a proper state. To be in a proper state, a commit should be able to bootstrap and then pass the testsuite.
We are thus running bootstrap builds for each of those 224 commits and logging whether or not each of these builds. If a commit builds, then we'll write a Changelog for it and open a PR to gcc-patch-dev. Then, I'll submit it to the mailing list for review (if needed) or just as [committed]
for those commits that only affect gcc/rust/
files.
If a commit does not build, we'll integrate it to a valid commit and squash them together. Since all of our pull-requests end up valid, I'm hoping that at maximum we'll only have to squash together a couple of commits and that it should be easy.
@dkm and I have started that painful process and you should see PRs popping up :)
I think we should soon open up a new "discussion" issue to discuss how to move forward with contributors and Changelogs :) As @philberty pointed out in Zulip, we have git gcc-commit-mklog
and the associated ./contrib/mklog.py
script to generate Changelog skeletons for us. I'm thinking that it would be good to integrate this with a Github bot, whose job would be to check that each commit in a PR contains a valid Changelog. For new contributors, I think it would also be useful if that bot was able to generate that Changelog skeleton (so simply calling ./contrib/mklog.py
on each commit) and post it on Github. This will help new users figure out the format and not have to deal with too much of the annoyances.
The most important thing will be to figure out a name for the bot, obviously :D
I think we should keep this issue open for a bit longer, as I'm sure more issues will prop up and this will be a good place to discuss them.
Thanks everyone for your help!!!
I've opened a PR https://github.com/Rust-GCC/gccrs/pull/1738 to enforce gnu changelog on our PR's this is just for discussion I wont merge this and force it though but since finding the tools in contrib I think it makes sense.
I've pushed a branch (first-half-update
, name is garbage but I don't expect it to live for very long) containing the first half of the ~224 commits we need to push to GCC's master to update the frontend. All of these commits pass a bootstrap build and tests on my machine. If you fetch this remote, you'll have access to the all of these commits, for which we need to write Changelog entries. I've added the list to the original message of this issue.
I'm not sure on how to go about splitting them between us in order to write the CLs. I know @dkm wanted to contribute to some of those, but we do need to apply them in order to gcc-patch-dev
, so I don't really know how to go about that. I also don't mind doing most of those as it's a long and boring task :)
I've opened a PR #1738 to enforce gnu changelog on our PR's this is just for discussion I wont merge this and force it though but since finding the tools in contrib I think it makes sense.
@philberty I think this is also going to come in very handy for this process. The PR is good imo and I want it merged.
for this specific workflow, there are a few things I think we should add to that script:
gccrs:
I'm not sure about number 2, but I think it's a "requirement" as all commits in GCC have Changelogs finishing with periods. This was also one of the review comments we got one the mailing list.
❯❯❯ git log --oneline --grep 'Merge pull ' $(git merge-base upstream-gcc/master HEAD)..upstream-gccrs/gcc-patch-dev
d9f4a1849a3 (upstream-gccrs/gcc-patch-dev, upstream-gccrs-rw/gcc-patch-dev) Merge pull request #1748 from CohenArthur/cl-cleanup-macro-expansion-and-parsing
8e8bf50c1be Merge pull request #1749 from CohenArthur/cl-do-not-lint-public-items
3af69068516 Merge pull request #1743 from Rust-GCC/cls-double-borrows-builtin-overflow-refactor
42d081e810a Merge pull request #1745 from Rust-GCC/dkm/gcc-patch-dev-constexpr
300fd6d7dce Merge pull request #1721 from CohenArthur/first-update-changelog-tryout
92a9a32895e Merge pull request #1746 from CohenArthur/cl-automation
See the cleaned branch: https://github.com/Rust-GCC/gccrs/pull/new/dkm/gcc-patch-dev/remove_merge
Discovered that git rebase automatically removes empty merge:
git rebase -i $(git merge-base upstream-gcc/master HEAD)
the todo only contains real commits without the empty merges.
I've since force-pushed @dkm's branch on gcc-patch-dev
so that the Merge commits are no longer present :) going forward I'll make sure to hit the rebase and merge
button instead haha