{"thread":{"id":"58970","subject":"https://github.com/rust-lang/rust is not bisectable","startedAt":"2022-12-17T16:04:31Z","lastAt":"2022-12-18T14:11:01Z","messageCount":9,"participants":["Askar Safin","Andreas Schwab","SZEDER Gábor","rsbecker@nexbridge.com"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"469229","messageId":"CAPnZJGABhczzs-6Pri2SAOkujJXT1+JDH9FiwdDns6=miZmvFQ@mail.gmail.com","threadId":"58970","inReplyTo":null,"subject":"https://github.com/rust-lang/rust is not bisectable","fromName":"Askar Safin","fromEmail":"safinaskar@gmail.com","sentAt":"2022-12-17T16:00:49Z","receivedAt":"2022-12-17T16:04:31Z","isPatch":false,"sender":{"key":"safinaskar@gmail.com","avatar":null},"body":"Hi. It seems that either \"git bisect\" has a bug, either repo at\nhttps://github.com/rust-lang/rust is broken.\n\n(Keep in mind that Rust project has somehow custom git setup:\nhttps://doc.rust-lang.org/nightly/clippy/development/infrastructure/sync.html#patching-git-subtree-to-work-with-big-repos\n)\n\nSo, here are steps to reproduce. I use fresh debian sid with git 2.39.0.\n\nroot@f6ca188fd101:/# git clone https://github.com/rust-lang/rust\nCloning into 'rust'...\nremote: Enumerating objects: 2107155, done.\nremote: Counting objects: 100% (145/145), done.\nremote: Compressing objects: 100% (79/79), done.\nremote: Total 2107155 (delta 73), reused 102 (delta 64), pack-reused 2107010\nReceiving objects: 100% (2107155/2107155), 1009.95 MiB | 2.74 MiB/s, done.\nResolving deltas: 100% (1647434/1647434), done.\nUpdating files: 100% (38754/38754), done.\nroot@f6ca188fd101:/# cd rust\n\nNow let's notice that commit 7175c499ecc32cb3ff713be0bbac9fd12990a34e\nhas word \"bootstrap\" in file \"compiler/rustc_target/src/abi/mod.rs\",\nbut commit 49c2279ef658d8732597c4da93897d84838f3df5 (master as of\n2022-12-17) - does not.\n\nAlso, let's notice that 7175c499ecc32cb3ff713be0bbac9fd12990a34e is an\nancestor of 49c2279ef658d8732597c4da93897d84838f3df5. (Everywhere I\nsay that X is an ancestor of Y, I mean that X can be found in \"git log\nY\", in other words \"git log Y | grep -q '^commit X' \" returns true.)\n\nNow let's find the first commit, which doesn't contain \"bootstrap\" in\nthat file in this interval. Let's do it using \"git bisect\".\n\nroot@f6ca188fd101:/rust# git bisect start\nstatus: waiting for both good and bad commits\nroot@f6ca188fd101:/rust# git bisect good\n7175c499ecc32cb3ff713be0bbac9fd12990a34e\nstatus: waiting for bad commit, 1 good commit known\nroot@f6ca188fd101:/rust# git bisect bad 49c2279ef658d8732597c4da93897d84838f3df5\nBisecting: 23901 revisions left to test after this (roughly 15 steps)\n[26562973b3482a635416b2b663a13016d4d90e20] Auto merge of #13653 -\nVannTen:fix/doc-typo-vim-lsp, r=Veykril\n\nOkay, so \"git bisect\" gave us commit\n26562973b3482a635416b2b663a13016d4d90e20. And here I see a bug:\n7175c499ecc32cb3ff713be0bbac9fd12990a34e is NOT ancestor of\n26562973b3482a635416b2b663a13016d4d90e20! But I think \"git bisect\"\nshould give us some commit between \"good\" and \"bad\", so presumably\n\"good\" should be an ancestor of the commit returned by \"git bisect\".\n\n-- \nAskar Safin\n"},{"id":"469231","messageId":"878rj6rnuo.fsf@igel.home","threadId":"58970","inReplyTo":"CAPnZJGABhczzs-6Pri2SAOkujJXT1+JDH9FiwdDns6=miZmvFQ@mail.gmail.com","subject":"Re: https://github.com/rust-lang/rust is not bisectable","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2022-12-17T16:34:07Z","receivedAt":"2022-12-17T16:39:00Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Dez 17 2022, Askar Safin wrote:\n\n> Okay, so \"git bisect\" gave us commit\n> 26562973b3482a635416b2b663a13016d4d90e20. And here I see a bug:\n> 7175c499ecc32cb3ff713be0bbac9fd12990a34e is NOT ancestor of\n> 26562973b3482a635416b2b663a13016d4d90e20!\n\n26562973b3482a635416b2b663a13016d4d90e20 is an ancestor of the bad\ncommit, and not an ancestor of the good commit, thus it is a candidate\nfor introducing the bad condition.  In a non-linear history, there can\nbe multiple good commits that are not directly related, each one cutting\nout branches from the history.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"469243","messageId":"CAPnZJGAMRY02s6UvMg7B6f=NSAgK0PJQAoftwnhXk-ufD2YknQ@mail.gmail.com","threadId":"58970","inReplyTo":"878rj6rnuo.fsf@igel.home","subject":"Re: https://github.com/rust-lang/rust is not bisectable","fromName":"Askar Safin","fromEmail":"safinaskar@gmail.com","sentAt":"2022-12-18T03:15:44Z","receivedAt":"2022-12-18T03:18:14Z","isPatch":false,"sender":{"key":"safinaskar@gmail.com","avatar":null},"body":"At some point that \"bootstrap\" word appeared, then at some point it\ndisappeared again. I'm trying to find a point where it has\ndisappeared. Consider this script:\n\n==begin\n#!/bin/bash\n\nset -e\nset -x\n\ngit bisect reset\ngit bisect start\ngit bisect good 7175c499ecc32cb3ff713be0bbac9fd12990a34e\ngit bisect bad 49c2279ef658d8732597c4da93897d84838f3df5\n\nwhile :; do\n  if grep -q bootstrap compiler/rustc_target/src/abi/mod.rs; then\n    git bisect good\n  else\n    git bisect bad\n  fi\n  sleep 1\ndone\n==end\n\nHere is the output: https://paste.debian.net/1264444/ . As you can\nsee, we always choose \"else git bisect bad\". And we reach... initial\ncommit!\n\nWell, technically speaking, this is correct: initial commit is\nactually the first commit, where word \"bootstrap\" is not present in\ncompiler/rustc_target/src/abi/mod.rs . But this is not what I want! I\nwant to find commit, which is the first one, which doesn't have\n\"bootstrap\" in compiler/rustc_target/src/abi/mod.rs, AND which is\ndescendant of good commit ( 7175c499ecc32cb3ff713be0bbac9fd12990a34e\n).\n\nAlso, after failing with \"git bisect\", I did MANUAL BISECT!!!!!! I did\nthis: I run command \"gitk --ancestry-path $GOOD..$BAD\". Then I clicked\nto some commit located nearly in the middle of history, then I copied\nits ID. Then I switched to this commit and checked whether it is good.\nThen I again run command \"gitk --ancestry-path $GOOD..$BAD\", this time\nwith a smaller interval. I did this several times and eventually I was\nable to find the faulty commit! (Well, the result was not good enough:\nthis manual bisecting gave me some merge commit, so I still don't see\nthe actual commit. But it is still better than \"git bisect\": \"git\nbisect\" simply gave me the initial commit.)\n\nSo, as you can see, manual bisecting (somewhat) works and \"git bisect\"\ndoesn't. This means that something is wrong with \"git bisect\". (Maybe\nthere is a way to make \"git bisect\" behave similar to that \"gitk\"\nexperiment above?)\n\nLet me say this in other words: I want git-bisect to mark all commits,\nwhich are not descendants of good, as good. (Here I assume bad is\ndescendant of good.)\n\n-- \nAskar Safin\n"},{"id":"469247","messageId":"875ye9vzph.fsf@linux-m68k.org","threadId":"58970","inReplyTo":"CAPnZJGAMRY02s6UvMg7B6f=NSAgK0PJQAoftwnhXk-ufD2YknQ@mail.gmail.com","subject":"Re: https://github.com/rust-lang/rust is not bisectable","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2022-12-18T09:16:42Z","receivedAt":"2022-12-18T09:16:55Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Dez 18 2022, Askar Safin wrote:\n\n> At some point that \"bootstrap\" word appeared, then at some point it\n> disappeared again.\n\nIf you have more that one distinct range where the bad condition exists\nthen bisection will not work correctly.  Bisection assumes that there is\nonly one commit in the search space that introduces the bad condition.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"469248","messageId":"20221218093734.GC3411@szeder.dev","threadId":"58970","inReplyTo":"CAPnZJGAMRY02s6UvMg7B6f=NSAgK0PJQAoftwnhXk-ufD2YknQ@mail.gmail.com","subject":"Re: https://github.com/rust-lang/rust is not bisectable","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2022-12-18T09:37:34Z","receivedAt":"2022-12-18T09:37:42Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Dec 18, 2022 at 06:15:44AM +0300, Askar Safin wrote:\n> At some point that \"bootstrap\" word appeared, then at some point it\n> disappeared again. I'm trying to find a point where it has\n> disappeared. Consider this script:\n> \n> ==begin\n> #!/bin/bash\n> \n> set -e\n> set -x\n> \n> git bisect reset\n> git bisect start\n> git bisect good 7175c499ecc32cb3ff713be0bbac9fd12990a34e\n> git bisect bad 49c2279ef658d8732597c4da93897d84838f3df5\n> \n> while :; do\n>   if grep -q bootstrap compiler/rustc_target/src/abi/mod.rs; then\n>     git bisect good\n>   else\n>     git bisect bad\n>   fi\n>   sleep 1\n> done\n> ==end\n> \n> Here is the output: https://paste.debian.net/1264444/ . As you can\n> see, we always choose \"else git bisect bad\". And we reach... initial\n> commit!\n\nYeah, but as you can see from all those\n\n  grep: compiler/rustc_target/src/abi/mod.rs: No such file or directory\n\nerror messages, it didn't choose bad because \"bootstrap\" was not\npresent in the file in question, but because the file in question was\nnot present in the examined revision in the first place!  You must\ntake this into consideration when deciding whether a revision is good\nor bad.\n\n> Well, technically speaking, this is correct: initial commit is\n> actually the first commit, where word \"bootstrap\" is not present in\n> compiler/rustc_target/src/abi/mod.rs . But this is not what I want! I\n> want to find commit, which is the first one, which doesn't have\n> \"bootstrap\" in compiler/rustc_target/src/abi/mod.rs, AND which is\n> descendant of good commit ( 7175c499ecc32cb3ff713be0bbac9fd12990a34e\n> ).\n\nNo, you want to find the first commit which does contain a file \ncompiler/rustc_target/src/abi/mod.rs, and where that file doesn't\ncontain \"bootstrap\".\n\n  $ git bisect start 49c2279ef658d8732597c4da93897d84838f3df5 7175c499ecc32cb3ff713be0bbac9fd12990a34e\n  Bisecting: 23901 revisions left to test after this (roughly 15 steps)\n  [26562973b3482a635416b2b663a13016d4d90e20] Auto merge of #13653 - VannTen:fix/doc-typo-vim-lsp, r=Veykril\n  $ cat run.sh\n  #!/bin/sh\n  \n  file=\"compiler/rustc_target/src/abi/mod.rs\"\n  if test ! -f \"$file\"\n  then\n  \techo \"  !!!  missing $file\"\n  elif grep -q bootstrap \"$file\"\n  then\n  \techo \"  +++  found bootstrap in $file\"\n  else\n  \techo \"  ---  no bootstrap in $file\"\n  \tfalse\n  fi\n  $ git bisect run ./run.sh\n  running './run.sh'\n    !!!  missing compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 11961 revisions left to test after this (roughly 14 steps)\n  [7a8636c843bd24038fe1d1f69b4a8e4b0ea55d4e] Auto merge of #100982 - fee1-dead-contrib:const-impl-requires-const-trait, r=oli-obk\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 5974 revisions left to test after this (roughly 13 steps)\n  [335e7d3e33300942ce99e7010a31ad4c1086a36a] Rollup merge of #98745 - thomcc:build-dir-arg, r=jyn514\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 2980 revisions left to test after this (roughly 12 steps)\n  [512a328e2fb32bddd206461770a2c058368519cc] Auto merge of #95309 - lcnr:dropck-cleanup, r=nikomatsakis\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 1485 revisions left to test after this (roughly 11 steps)\n  [143eaa8d441641251ab41ed73deaba0d8d0cf4a5] Auto merge of #93970 - cjgillot:novis, r=petrochenkov\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 748 revisions left to test after this (roughly 10 steps)\n  [198a1548ea4c25e3756d70bb2cafed6bb1860d6a] Rollup merge of #95369 - jyn514:test-rustdoc, r=Mark-Simulacrum\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 374 revisions left to test after this (roughly 9 steps)\n  [3c2f864ffbf0e3d01f3f684acbd0ee602619bf19] session: opt for enabling directionality markers\n  running './run.sh'\n    +++  found bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 186 revisions left to test after this (roughly 8 steps)\n  [7b285d09e9e4ccf8273cc03dba28e8a428e6084e] Rollup merge of #95791 - oconnor663:doc_comment, r=thomcc\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 93 revisions left to test after this (roughly 7 steps)\n  [201cf3dba302cec9b62e9b988858dcad47a88a4f] Auto merge of #95723 - SparrowLii:const_goto, r=fee1-dead\n  running './run.sh'\n    +++  found bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 47 revisions left to test after this (roughly 6 steps)\n  [2e4964ed3d6a4de97b863777f97c7790808afce3] Rollup merge of #95714 - KSBilodeau:master, r=Dylan-DPC\n  running './run.sh'\n    +++  found bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 23 revisions left to test after this (roughly 5 steps)\n  [ed6c958ee4bf081deec951996ace9c508360c1d9] Auto merge of #95760 - Dylan-DPC:rollup-uskzggh, r=Dylan-DPC\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 12 revisions left to test after this (roughly 4 steps)\n  [870ab12ea7976ad3c56eac6f0559b122e0f055c5] Rollup merge of #95752 - compiler-errors:issue-82866, r=Dylan-DPC\n  running './run.sh'\n    +++  found bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 6 revisions left to test after this (roughly 3 steps)\n  [73dc13058d37ebcfcdde46e7f63c4c69bd26685d] remove ~const Drop from rustdoc test\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 2 revisions left to test after this (roughly 2 steps)\n  [b744bb67fdfd3e34404cc9df1d87acdfdb4a0cb4] rustc_trait_selection changes\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 0 revisions left to test after this (roughly 1 step)\n  [181d28bb6110dc974879db20d433f21aa142db3a] trivial cfg(bootstrap) changes\n  running './run.sh'\n    ---  no bootstrap in compiler/rustc_target/src/abi/mod.rs\n  Bisecting: 0 revisions left to test after this (roughly 0 steps)\n  [e96538aeeb2a71e672e1d1a40dcaf0ad34a826b5] bump stage0 to the latest beta\n  running './run.sh'\n    +++  found bootstrap in compiler/rustc_target/src/abi/mod.rs\n  181d28bb6110dc974879db20d433f21aa142db3a is the first bad commit\n  commit 181d28bb6110dc974879db20d433f21aa142db3a\n  Author: Pietro Albini <pietro@pietroalbini.org>\n  Date:   Tue Apr 5 22:42:23 2022 +0200\n  \n      trivial cfg(bootstrap) changes\n  \n  [ ... diffstat ... ]\n  bisect found first bad commit\n\n"},{"id":"469249","messageId":"CAPnZJGBwFMPAJKj9Qa_Vv9yJWrGaNXqaNaPUSrYcjZ8J+OfLrg@mail.gmail.com","threadId":"58970","inReplyTo":"20221218093734.GC3411@szeder.dev","subject":"Re: https://github.com/rust-lang/rust is not bisectable","fromName":"Askar Safin","fromEmail":"safinaskar@gmail.com","sentAt":"2022-12-18T10:03:54Z","receivedAt":"2022-12-18T10:04:37Z","isPatch":false,"sender":{"key":"safinaskar@gmail.com","avatar":null},"body":"SZEDER Gábor, yes, in this particular case this helps. Thank you! (But\nI still wonder how to tell git-bisect to ignore commits, which are not\ndescendants of good commit.)\n\n-- \nAskar Safin\n"},{"id":"469250","messageId":"87tu1tuhxy.fsf@linux-m68k.org","threadId":"58970","inReplyTo":"CAPnZJGBwFMPAJKj9Qa_Vv9yJWrGaNXqaNaPUSrYcjZ8J+OfLrg@mail.gmail.com","subject":"Re: https://github.com/rust-lang/rust is not bisectable","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2022-12-18T10:25:45Z","receivedAt":"2022-12-18T10:26:00Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"If you are only interested in the linear part of the history you can use\n--first-parent.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"469251","messageId":"20221218105239.GD3411@szeder.dev","threadId":"58970","inReplyTo":"CAPnZJGBwFMPAJKj9Qa_Vv9yJWrGaNXqaNaPUSrYcjZ8J+OfLrg@mail.gmail.com","subject":"Re: https://github.com/rust-lang/rust is not bisectable","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2022-12-18T10:52:39Z","receivedAt":"2022-12-18T10:52:48Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Dec 18, 2022 at 01:03:54PM +0300, Askar Safin wrote:\n> SZEDER Gábor, yes, in this particular case this helps.\n\nNot just in this particular case, but this solves a general issue of\nbisecting non-linear histories that is the file/testcase/whatever of\ninterest is not present in all candidate revisions in the range '^good\nbad'.\n\n> (But\n> I still wonder how to tell git-bisect to ignore commits, which are not\n> descendants of good commit.)\n\nIn general you do not want to tell that to bisect, because any one of\nthem could have introduced the change you are looking for.  Consider\nthe following piece of history, where commits 'm<N>' are on the master\nbranch, 'b<N>' are on a different branch, and the commit marked with C\nmade a buggy change, and commits marked with G and B are the ones you\nmarked as good and bad you started the bisection.\n\n            (G)            (M)  (B)\n  m1---m2---m3---m4---m5---m6---m7\n        \\                 /\n         b1---b2---b3---b4\n                   (C)\n\nIf bisect were to ignore commits \"which are not descendants of good\ncommit\", then it wouldn't look at any of the 'b<N>' commits made on\nthe side branch.  It would only look at commits m{3,4,5,6,7}, and thus\nreport m6 as the first bad commit, which is clearly not the case.\n\n\n"},{"id":"469252","messageId":"00c701d912ea$85527080$8ff75180$@nexbridge.com","threadId":"58970","inReplyTo":"20221218105239.GD3411@szeder.dev","subject":"RE: https://github.com/rust-lang/rust is not bisectable","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2022-12-18T14:10:39Z","receivedAt":"2022-12-18T14:11:01Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On December 18, 2022 5:53 AM, SZEDER Gábor wrote:\n>On Sun, Dec 18, 2022 at 01:03:54PM +0300, Askar Safin wrote:\n>> SZEDER Gábor, yes, in this particular case this helps.\n>\n>Not just in this particular case, but this solves a general issue of bisecting non-\n>linear histories that is the file/testcase/whatever of interest is not present in all\n>candidate revisions in the range '^good bad'.\n>\n>> (But\n>> I still wonder how to tell git-bisect to ignore commits, which are not\n>> descendants of good commit.)\n>\n>In general you do not want to tell that to bisect, because any one of them could\n>have introduced the change you are looking for.  Consider the following piece of\n>history, where commits 'm<N>' are on the master branch, 'b<N>' are on a\n>different branch, and the commit marked with C made a buggy change, and\n>commits marked with G and B are the ones you marked as good and bad you\n>started the bisection.\n>\n>            (G)            (M)  (B)\n>  m1---m2---m3---m4---m5---m6---m7\n>        \\                 /\n>         b1---b2---b3---b4\n>                   (C)\n>\n>If bisect were to ignore commits \"which are not descendants of good commit\",\n>then it wouldn't look at any of the 'b<N>' commits made on the side branch.  It\n>would only look at commits m{3,4,5,6,7}, and thus report m6 as the first bad\n>commit, which is clearly not the case.\n\nCould you not use bisect skip to ignore the commits that cannot be tested? \n\n"}]}