<div dir="ltr"><div>Re: git worktree: That's the workflow I'm currently using. It has its problems with submodules, see <a href="https://stackoverflow.com/questions/31871888/what-goes-wrong-when-using-git-worktree-with-git-submodules">https://stackoverflow.com/questions/31871888/what-goes-wrong-when-using-git-worktree-with-git-submodules</a>. But you can make it work with this git alias from the first answer: <a href="https://gitlab.com/clacke/gists/blob/0c4a0b6e10f7fbf15127339750a6ff490d9aa3c8/.config/git/config#L12">https://gitlab.com/clacke/gists/blob/0c4a0b6e10f7fbf15127339750a6ff490d9aa3c8/.config/git/config#L12</a>. Just go into your main checkout and do `git wtas ../T9876`. AFAIR it interacts weirdly with MinGW's git or git for Windows, but nothing you can't work around.</div><div><br></div><div>Anyway, I was hoping that one day hadrian will be smart enough to have a build directory for each branch or something, so that I would only need one checkout where I can switch between branches as needed. In the meantime, `git wtas` does what I want.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Sa., 29. Juni 2019 um 21:53 Uhr schrieb Richard Eisenberg <<a href="mailto:rae@richarde.dev">rae@richarde.dev</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Just to pass on something that looks cool (I haven't tried it myself yet): git worktree. It seems git can hang several different checkouts of a repo in different directories. This seems far superior to my current habit of having many clones of ghc, sometimes going through machinations to get commits from one place to another. The documentation for git worktree seems quite approachable, so you might find it useful. I plan on using it in the future.<br>
<br>
Richard<br>
<br>
> On Jun 29, 2019, at 8:24 AM, Ben Gamari <<a href="mailto:ben@smart-cactus.org" target="_blank">ben@smart-cactus.org</a>> wrote:<br>
> <br>
> On June 28, 2019 5:09:45 AM EDT, "Ömer Sinan Ağacan" <<a href="mailto:omeragacan@gmail.com" target="_blank">omeragacan@gmail.com</a>> wrote:<br>
>> Hi all,<br>
>> <br>
>> I'm currently going through this torturous process and I'm hoping that<br>
>> someone<br>
>> here will be able to help.<br>
>> <br>
>> I'm making changes in the codegen. My changes are currently buggy, and<br>
>> I need a<br>
>> working stage 1 compiler to be able to debug. Basically I need to build<br>
>> libraries using the branch my changes are based on, then build stage 1<br>
>> with my<br>
>> branch, so that I'll be able to build and run programs using stage 1<br>
>> that uses<br>
>> my codegen changes. The changes are compatible with the old codegen<br>
>> (i.e. no<br>
>> changes in calling conventions or anything like that) so this should<br>
>> work.<br>
>> <br>
>> Normally I do this<br>
>> <br>
>>   $ git checkout master<br>
>>   $ git distclean && ./boot && ./configure && make<br>
>>   $ git checkout my_branch<br>
>>   $ cd compiler; make 1<br>
>> <br>
>> This gives me stage 1 compiler that uses my buggy codegen changes, plus<br>
>> libraries built with the old and correct codegen.<br>
>> <br>
>> However the problem is I'm also adding a new file in my_branch, and the<br>
>> build<br>
>> system just doesn't register that fact, even after adding the line I<br>
>> added to<br>
>> compiler/<a href="http://ghc.cabal.in" rel="noreferrer" target="_blank">ghc.cabal.in</a> to compiler/ghc.cabal. So far the only way to fix<br>
>> this<br>
>> that I could find was to run ./configure again, then run make for a few<br>
>> seconds<br>
>> at the top level, then do `make 1` in compiler/. Unfortunately even<br>
>> that doesn't<br>
>> work when the master branch and my_branch have different dates, because<br>
>> `make`<br>
>> in master branch produces a different version than the `make` in<br>
>> my_branch, so<br>
>> the interface files become incompatible.<br>
>> <br>
>> Anyone have any ideas on how to proceed here?<br>
>> <br>
>> Thanks,<br>
>> <br>
>> Ömer<br>
>> _______________________________________________<br>
>> ghc-devs mailing list<br>
>> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
> <br>
> In general I think it is wise to avoid switching branches in a tree you are actively developing in. The cost of switching both in the compilation time that it implies and the uncertain state that it leaves the tree in is in my opinion too high. It you want to compare your change against master I would recommend using two working directories. <br>
> <br>
> <br>
> Cheers, <br>
> <br>
> - Ben <br>
> <br>
> _______________________________________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>