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
Add environment info to make troubleshoot
.
#171
Open
kirb
wants to merge
3
commits into
master
Choose a base branch
from
kirb/unfinished/better-troubleshoot
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# Create Markdown output for sharing as troubleshooting info. | ||
|
||
# Convenience functions | ||
heading() { printf "\n# %s\n" "$1"; } | ||
subheading() { printf "\n## %s\n" "$1"; } | ||
item() { printf "* **%s:** %s\n" "$1" "$2"; } | ||
code() { printf "\`\`\`%s\n%s\n\`\`\`\n" "$1" "$2"; } | ||
|
||
# Gather some preliminary info for the script. | ||
has_xcode="$([[ -x /usr/bin/xcrun ]] && echo 1)" | ||
|
||
# Print OS, tool, etc versions. | ||
heading "Environment" | ||
subheading "Hardware" | ||
item 'Operating System' "$(uname -sm) $([[ -x /usr/bin/sw_vers ]] && sw_vers -productVersion)" | ||
item 'Device' "$(uname -i)" | ||
|
||
subheading "Toolchain" | ||
item 'Theos' "$(cd "$THEOS"; git rev-parse master)" | ||
item 'Make' "$("$MAKE" --version | head -1)" | ||
item 'Perl' "$(perl -e 'print $^V')" | ||
item 'Git' "$(git --version)" | ||
item 'Dpkg' "$(dpkg-deb --version | head -1)" | ||
[[ $has_xcode == 1 ]] && item 'Xcode' "$(xcrun xcodebuild -version)" | ||
item 'Clang' "$(clang --version 2>&1)" | ||
item 'Swift' "$(swift --version 2>&1)" | ||
|
||
subheading "Directories" | ||
item 'Location' "$THEOS" | ||
item 'Toolchains' "$THEOS/toolchains/*" 2>/dev/null | ||
item 'SDKs' "$THEOS/sdks/*" 2>/dev/null | ||
[[ $has_xcode == 1 ]] && item 'Developer Path' "$(xcode-select -print-path)" | ||
|
||
subheading "Current Instance" | ||
item 'Target' "$([[ -z "$TARGET" ]] && echo "$TARGET" || echo Not set)" | ||
item 'System Root' "$([[ -z "$SYSROOT" ]] && echo "$SYSROOT" || echo Not set)" | ||
|
||
# Makefile | ||
heading "Makefile" | ||
code make "$(cat "$MAKEFILE_NAME")" | ||
|
||
# Perform a build. | ||
heading "Build Output" | ||
code ansi "$("$MAKE" -f "$MAKEFILE_NAME" --no-keep-going clean all messages=yes FORCE_COLOR=yes 2>&1)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ all:: | |
endif | ||
|
||
.PHONY: all before-all internal-all after-all \ | ||
clean before-clean internal-clean after-clean update-theos | ||
clean before-clean internal-clean after-clean \ | ||
troubleshoot update-theos | ||
ifeq ($(THEOS_BUILD_DIR),.) | ||
all:: $(_THEOS_BUILD_SESSION_FILE) before-all internal-all after-all | ||
else | ||
|
@@ -160,12 +161,13 @@ update-theos:: | |
|
||
troubleshoot:: | ||
@$(PRINT_FORMAT) "Be sure to check the troubleshooting page at https://github.com/theos/theos/wiki/Troubleshooting first." | ||
@$(PRINT_FORMAT) "For support with build errors, ask on IRC: http://iphonedevwiki.net/index.php/IRC. If you think you've found a bug in Theos, check the issue tracker at https://github.com/theos/theos/issues." | ||
@$(PRINT_FORMAT) "For support with build errors, ask on IRC: http://iphonedevwiki.net/index.php/IRC. If you think you’ve found a bug in Theos, check the issue tracker at https://github.com/theos/theos/issues." | ||
@echo | ||
|
||
ifeq ($(call __executable,ghost),$(_THEOS_TRUE)) | ||
@$(PRINT_FORMAT) "Creating a Ghostbin containing the output of \`make clean all messages=yes\`…" | ||
$(MAKE) -f $(_THEOS_PROJECT_MAKEFILE_NAME) --no-print-directory --no-keep-going clean all messages=yes FORCE_COLOR=yes 2>&1 | ghost -x 2w - ansi | ||
@$(PRINT_FORMAT_STAGE) 6 "Gathering troubleshooting information and uploading to Ghostbin" | ||
$(ECHO_NOTHING)MAKE="$(MAKE)" MAKEFILE_NAME="$(_THEOS_PROJECT_MAKEFILE_NAME)" TARGET="$(TARGET)" SYSROOT="$(SYSROOT)" \ | ||
$(THEOS_BIN_PATH)/get-troubleshoot-info | ghost -x 2w - markdown$(ECHO_END) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add |
||
else | ||
@$(PRINT_FORMAT_ERROR) "You don't have ghost installed. For more information, refer to https://github.com/theos/theos/wiki/Installation#prerequisites." >&2; exit 1 | ||
endif | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change needed?