[GHC] #15538: GHC boot script can't handle Git origin not named origin

#15538: GHC boot script can't handle Git origin not named origin -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Building GHC Unknown/Multiple | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- == Problem I ran the following to get the sources for GHC to build them: {{{ git clone -o ghc --recursive http://git.haskell.org/ghc.git }}} Note especially the `-o ghc` part, which uses the Git origin name `ghc` instead of the default `origin`. When a custom origin name is used, `./boot` fails: {{{ $ ./boot Traceback (most recent call last): File "./boot", line 193, in <module> check_for_url_rewrites() File "./boot", line 29, in check_for_url_rewrites subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \ File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['git', 'config', 'remote.origin.url']' returned non-zero exit status 1 $ git config remote.origin.url $ echo $? 1 }}} == Solution To get the URL of the proper origin name, `git config branch.master.remote` can be used to get the origin name to use to get the URL: {{{ $ git config "remote.$( git config branch.master.remote ).url" http://git.haskell.org/ghc.git }}} == Workaround Rename the origin to `origin`: {{{ $ git remote rename "$( git config branch.master.remote )" origin $ ./boot Creating libraries/mtl/ghc.mk Creating libraries/unix/ghc.mk Creating libraries/text/ghc.mk ⋮ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15538 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15538: GHC boot script can't handle Git origin not named origin -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by ChaiTRex: Old description:
== Problem
I ran the following to get the sources for GHC to build them:
{{{ git clone -o ghc --recursive http://git.haskell.org/ghc.git }}}
Note especially the `-o ghc` part, which uses the Git origin name `ghc` instead of the default `origin`. When a custom origin name is used, `./boot` fails:
{{{ $ ./boot Traceback (most recent call last): File "./boot", line 193, in <module> check_for_url_rewrites() File "./boot", line 29, in check_for_url_rewrites subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \ File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['git', 'config', 'remote.origin.url']' returned non-zero exit status 1
$ git config remote.origin.url
$ echo $? 1 }}}
== Solution
To get the URL of the proper origin name, `git config branch.master.remote` can be used to get the origin name to use to get the URL:
{{{ $ git config "remote.$( git config branch.master.remote ).url" http://git.haskell.org/ghc.git }}}
== Workaround
Rename the origin to `origin`:
{{{ $ git remote rename "$( git config branch.master.remote )" origin $ ./boot Creating libraries/mtl/ghc.mk Creating libraries/unix/ghc.mk Creating libraries/text/ghc.mk ⋮ }}}
New description: == Problem I ran the following to get the sources for GHC to build them: {{{ git clone -o ghc --recursive http://git.haskell.org/ghc.git }}} Note especially the `-o ghc` part, which uses the Git origin name `ghc` instead of the default `origin`. When a custom origin name is used, `./boot` fails: {{{ $ ./boot Traceback (most recent call last): File "./boot", line 193, in <module> check_for_url_rewrites() File "./boot", line 29, in check_for_url_rewrites subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \ File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['git', 'config', 'remote.origin.url']' returned non-zero exit status 1 $ git config remote.origin.url $ echo $? 1 }}} == Solution `git config branch.master.remote` can be used to get the origin name to use to get the desired URL: {{{ $ git config "remote.$( git config branch.master.remote ).url" http://git.haskell.org/ghc.git }}} == Workaround Rename the origin to `origin`: {{{ $ git remote rename "$( git config branch.master.remote )" origin $ ./boot Creating libraries/mtl/ghc.mk Creating libraries/unix/ghc.mk Creating libraries/text/ghc.mk ⋮ }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15538#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15538: GHC boot script can't handle Git remote not named origin -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Old description:
== Problem
I ran the following to get the sources for GHC to build them:
{{{ git clone -o ghc --recursive http://git.haskell.org/ghc.git }}}
Note especially the `-o ghc` part, which uses the Git origin name `ghc` instead of the default `origin`. When a custom origin name is used, `./boot` fails:
{{{ $ ./boot Traceback (most recent call last): File "./boot", line 193, in <module> check_for_url_rewrites() File "./boot", line 29, in check_for_url_rewrites subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \ File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['git', 'config', 'remote.origin.url']' returned non-zero exit status 1
$ git config remote.origin.url
$ echo $? 1 }}}
== Solution
`git config branch.master.remote` can be used to get the origin name to use to get the desired URL:
{{{ $ git config "remote.$( git config branch.master.remote ).url" http://git.haskell.org/ghc.git }}}
== Workaround
Rename the origin to `origin`:
{{{ $ git remote rename "$( git config branch.master.remote )" origin $ ./boot Creating libraries/mtl/ghc.mk Creating libraries/unix/ghc.mk Creating libraries/text/ghc.mk ⋮ }}}
New description: == Problemorf I ran the following to get the sources for GHC to build them: {{{ git clone -o ghc --recursive http://git.haskell.org/ghc.git }}} Note especially the `-o ghc` part, which uses the Git remote name `ghc` instead of the default `origin`. When a custom remote name is used, `./boot` fails: {{{ $ ./boot Traceback (most recent call last): File "./boot", line 193, in <module> check_for_url_rewrites() File "./boot", line 29, in check_for_url_rewrites subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \ File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['git', 'config', 'remote.origin.url']' returned non-zero exit status 1 $ git config remote.origin.url $ echo $? 1 }}} == Solution `git config remote.origin.url` can be used first. Whenever `git config remote.origin.url` fails, a `git rev-parse` command (thanks to freenode/#git/_ikke_ for it) can be used to get the remote name and branch that would be pushed to: {{{ $ git rev-parse --symbolic-full-name --abbrev-ref @{upstream} ghc/coercible $ git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's/\/.*$//' ghc $ git config "remote.$( git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's/\/.*$//' ).url" http://git.haskell.org/ghc.git }}} == Workaround Rename the remote to `origin`: {{{ $ git remote rename "$( git config branch.master.remote )" origin $ ./boot Creating libraries/mtl/ghc.mk Creating libraries/unix/ghc.mk Creating libraries/text/ghc.mk ⋮ }}} -- Comment (by ChaiTRex): [Solution in report above fixed for custom branch selection] -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15538#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15538: GHC boot script can't handle Git remote not named origin -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by ChaiTRex: Old description:
== Problemorf
I ran the following to get the sources for GHC to build them:
{{{ git clone -o ghc --recursive http://git.haskell.org/ghc.git }}}
Note especially the `-o ghc` part, which uses the Git remote name `ghc` instead of the default `origin`. When a custom remote name is used, `./boot` fails:
{{{ $ ./boot Traceback (most recent call last): File "./boot", line 193, in <module> check_for_url_rewrites() File "./boot", line 29, in check_for_url_rewrites subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \ File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['git', 'config', 'remote.origin.url']' returned non-zero exit status 1
$ git config remote.origin.url
$ echo $? 1 }}}
== Solution
`git config remote.origin.url` can be used first. Whenever `git config remote.origin.url` fails, a `git rev-parse` command (thanks to freenode/#git/_ikke_ for it) can be used to get the remote name and branch that would be pushed to:
{{{ $ git rev-parse --symbolic-full-name --abbrev-ref @{upstream} ghc/coercible
$ git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's/\/.*$//' ghc
$ git config "remote.$( git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's/\/.*$//' ).url" http://git.haskell.org/ghc.git }}}
== Workaround
Rename the remote to `origin`:
{{{ $ git remote rename "$( git config branch.master.remote )" origin $ ./boot Creating libraries/mtl/ghc.mk Creating libraries/unix/ghc.mk Creating libraries/text/ghc.mk ⋮ }}}
New description: == Problem I ran the following to get the sources for GHC to build them: {{{ git clone -o ghc --recursive http://git.haskell.org/ghc.git }}} Note especially the `-o ghc` part, which uses the Git remote name `ghc` instead of the default `origin`. When a custom remote name is used, `./boot` fails: {{{ $ ./boot Traceback (most recent call last): File "./boot", line 193, in <module> check_for_url_rewrites() File "./boot", line 29, in check_for_url_rewrites subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \ File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['git', 'config', 'remote.origin.url']' returned non-zero exit status 1 $ git config remote.origin.url $ echo $? 1 }}} == Solution `git config remote.origin.url` can be used first. Whenever `git config remote.origin.url` fails, a `git rev-parse` command (thanks to freenode/#git/_ikke_ for it) can be used to get the remote name and branch that would be pushed to: {{{ $ git rev-parse --symbolic-full-name --abbrev-ref @{upstream} ghc/coercible $ git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's/\/.*$//' ghc $ git config "remote.$( git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's/\/.*$//' ).url" http://git.haskell.org/ghc.git }}} == Workaround Rename the remote to `origin`: {{{ $ git remote rename "$( git config branch.master.remote )" origin $ ./boot Creating libraries/mtl/ghc.mk Creating libraries/unix/ghc.mk Creating libraries/text/ghc.mk ⋮ }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15538#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15538: GHC boot script can't handle Git remote not named origin -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: ChaiTRex Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ChaiTRex): * owner: (none) => ChaiTRex -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15538#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15538: GHC boot script can't handle Git remote not named origin -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: ChaiTRex Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Build System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5077 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ChaiTRex): * differential: => Phab:D5077 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15538#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15538: GHC boot script can't handle Git remote not named origin -------------------------------------+------------------------------------- Reporter: ChaiTRex | Owner: ChaiTRex Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Build System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5077 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ChaiTRex): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15538#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC