Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-3275] Lack of command 'git' causes swift-build crash. #5165

swift-ci opened this issue Nov 26, 2016 · 4 comments

[SR-3275] Lack of command 'git' causes swift-build crash. #5165

swift-ci opened this issue Nov 26, 2016 · 4 comments


Copy link

swift-ci commented Nov 26, 2016

Previous ID SR-3275
Radar None
Original Reporter scoot (JIRA User)
Type Bug
Status Resolved
Resolution Done

Swift version 3.0 (swift-3.0-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 695fa998c110daea59a7f5c65a9ca3e6

is duplicated by:

  • SR-3302 Crash when git not installed

Issue Description:

I noticed following crash when there is no 'git' command in the system.

$ swift build
git clone --recursive --depth 10 

fatal error: unexpectedly found nil while unwrapping an Optional value
Current stack trace:
0                    0x00007fa1d0787690 swift_reportError + 117
1                    0x00007fa1d0798b00 _swift_stdlib_reportFatalError + 61
2                    0x00007fa1d05aa063 <unavailable> + 0
3                    0x00007fa1d070512d <unavailable> + 0
4                    0x00007fa1d05aa063 <unavailable> + 0
5                    0x00007fa1d06c9130 specialized _fatalErrorMessage(StaticString, StaticString, StaticString, UInt, flags : UInt32) -> Never + 96
6    swift-build                        0x00000000005b3575 <unavailable> + 0
7    swift-build                        0x00000000005ff4b7 <unavailable> + 0
8    swift-build                        0x000000000060ab22 <unavailable> + 0
9    swift-build                        0x000000000060c822 <unavailable> + 0
10   swift-build                        0x0000000000601cf1 <unavailable> + 0
11   swift-build                        0x0000000000603c6e <unavailable> + 0
12   swift-build                        0x000000000060338d <unavailable> + 0
13   swift-build                        0x0000000000603d3c <unavailable> + 0
14                    0x00007fa1d064c360 Sequence.flatMap<A where ...> ((A.Iterator.Element) throws -> A1) throws -> [A1.Iterator.Element] + 576
15   swift-build                        0x00000000005fff8c <unavailable> + 0
16   swift-build                        0x00000000005ff964 <unavailable> + 0
17   swift-build                        0x00000000006080b2 <unavailable> + 0
18   swift-build                        0x000000000062f400 <unavailable> + 0
19   swift-build                        0x000000000069befa <unavailable> + 0
20   swift-build                        0x0000000000692327 <unavailable> + 0
21   swift-build                        0x0000000000414748 <unavailable> + 0
22                          0x00007fa1ce812a50 __libc_start_main + 245
23   swift-build                        0x0000000000414619 <unavailable> + 0
Illegal instruction

$ git
-bash: git: command not found
Copy link

Bouke commented Dec 27, 2016

Using the development snapshot of 15 december on Ubuntu 16.04;

bouke@ubuntu-imac:~/Developer/HAP$ which git
bouke@ubuntu-imac:~/Developer/HAP$ git
The program 'git' is currently not installed. You can install it by typing:
sudo apt install git
bouke@ubuntu-imac:~/Developer/HAP$ swift build
git clone --bare /media/sf_Developer/HAP/.build/repositories/CLibSodium.git--9212624310367625262

error: Failed to clone to <AbsolutePath:"/media/sf_Developer/HAP/.build/repositories/CLibSodium.git--9212624310367625262">

So, no longer a crash, but improved diagnostics would be welcome.

Copy link

heckj commented Jan 26, 2017

Hey scoot (JIRA User), I was looking for some relatively self-contained bugs to get into the swiftpm code base. Saw that it no longer crashed and verified with the 3.1 and master branch what it was doing - but wasn't sure what "improved diagnostics" you were thinking about.

I thought "If git doesn't exist on the local system, fail out early and report that..." as a first order cut of something useful, but did you have something else in mind?

Copy link

aciidb0mb3r commented Jan 26, 2017

Right now we don't report what error actually occurred when we fail to clone, I think fixing that problem will fix this issue.

Copy link

aciidb0mb3r commented Jan 27, 2017


@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

4 participants