-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
backtrace_crashpad v0.1.0 (new formula) #152908
backtrace_crashpad v0.1.0 (new formula) #152908
Conversation
Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request. |
A fork of Crashpad with file attachment support and other improvements
8a9dbca
to
db44519
Compare
# TODO: Add minidump_stackwalk once Backtrace supports it | ||
def install | ||
system "cmake", "-S", ".", "-B", "out", *std_cmake_args | ||
system "cmake", "--build", "out" |
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 there no CMake install?
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.
|
||
depends_on "cmake" => :build | ||
|
||
# TODO: Creating iOS variants for the client at some point |
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.
That's not a supported platform for Homebrew though
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.
Not even for cross-compilation purposes? i.e. we keep the iOS static library variant if somebody wants to build an iOS app for it?
In any case @shraddhaarora we can probably delete all these TODOs already and just keep internal notes
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.
No, and static libraries are generally discouraged in Homebrew since they make no use of security updates by the package manager
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.
Makes sense!
cmake_config = <<-EOF | ||
add_library(backtrace::crashpad STATIC IMPORTED) | ||
set_target_properties(backtrace::crashpad PROPERTIES | ||
IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/../../libbacktrace_crashpad_client.a") | ||
target_include_directories(backtrace::crashpad | ||
INTERFACE "${CMAKE_CURRENT_LIST_DIR}/../../../include/backtrace") | ||
set(BacktraceCrashpad_FOUND TRUE) | ||
EOF | ||
cmake_version_config = <<-EOF | ||
set(PACKAGE_VERSION "#{version}") | ||
if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
endif() | ||
if(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
else(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) | ||
set(PACKAGE_VERSION_UNSUITABLE TRUE) | ||
endif() | ||
EOF |
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.
Homebrew formulae should not ship their own configuration. This should either come from upstream or not at all
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.
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.
Hi @jviotti - yes, we would welcome that.
end | ||
|
||
test do | ||
system "#{bin}/backtrace_crashpad_handler", "--help" |
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.
We need a test that exercises the some of the functionality of the app. Version checks or usage checks (foo --version or foo --help) are not sufficient, as explained in the formula cookbook.
In most cases, a good test would involve running a simple test case: run #{bin}/foo input.txt.
- Then you can check that the output is as expected (with assert_equal or assert_match on the output of shell_output)
- You can also check that an output file was created, if that is expected: assert_predicate testpath/"output.txt", :exist?
Some advice for specific cases:
- If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples.
- If the formula is for a GUI program, try to find some function that runs as command-line only, like a format conversion, reading or displaying a config file, etc.
- If the software cannot function without credentials, a test could be to try to connect with invalid credentials (or without credentials) and confirm that it fails as expected.
- Same if the software requires a virtual machine, docker instance, etc. to be running.
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.
@shraddhaarora Let's do the first option:
If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples.
Please do not add merge commits to your branch |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Backtrace Crashpad is a fork of Crashpad with file attachment support and other improvements.
This is a fork of the Crashpad project with changes provided by Backtrace I/O, a Sauce Labs Company.
The major differences:
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?