-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
apache-pulsar 2.8.0 (new formula) #83238
Closed
Closed
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
e1e6129
New Formula: Apache Pulsar
zbentley cc5e606
Address linter errors
zbentley 3e22f9e
Address reviewer comments
zbentley a57ec65
Attempt to resolve CI failures: make /etc path
zbentley 832b3dd
try moving directory creation to before tar command
zbentley d744550
Remove asterisk for config symlink
zbentley 59a250e
Remove non-optional cross compiled PPC file
zbentley f949f6b
Add protobuf as build dependency
zbentley 6d74191
Attempt to force x86_64 architecture to get m1 build working
zbentley a764ca7
Fix linter issues
zbentley 918a4ce
Try overriding protoc command
zbentley b976db0
Fix trailing new line
zbentley e7fbbf0
Try a newer version of protoc
zbentley 517a8d1
Try overriding grpc version as well
zbentley 83ea2af
Give up on versioning grpc and proto forward
zbentley 0e6e813
Constrain arch
zbentley ebda469
Constrain arch
zbentley 79956f2
Support building from HEAD properly
zbentley 774e4f8
Address reviewer comments
zbentley 1e325fb
Link to upstream packaging issue and force JVM version
zbentley 0d2389d
Restore JVM version pin for build
zbentley e5133c4
Reviewer suggestion: use utility fucntion for java home
zbentley ade8e84
Fix mistaken non-string use of java_home_env
zbentley 33679a0
Address reviewer comments
zbentley 0dfe3db
Apply suggestions from code review
zbentley e1a7780
Move log creation to postinstall
zbentley b8f8360
Update Formula/apache-pulsar.rb
zbentley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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,74 @@ | ||
class ApachePulsar < Formula | ||
desc "Cloud-native distributed messaging and streaming platform" | ||
homepage "https://pulsar.apache.org/" | ||
url "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=pulsar/pulsar-2.8.0/apache-pulsar-2.8.0-src.tar.gz" | ||
mirror "https://archive.apache.org/dist/pulsar/pulsar-2.8.0/apache-pulsar-2.8.0-src.tar.gz" | ||
sha256 "0e161a81c62c7234c1e0c243bb6fe30046ec1cd01472618573ecdc2a73b1163b" | ||
license "Apache-2.0" | ||
head "https://github.com/apache/pulsar.git", branch: "master" | ||
|
||
depends_on "autoconf" => :build | ||
depends_on "automake" => :build | ||
depends_on "cppunit" => :build | ||
depends_on "libtool" => :build | ||
depends_on "maven" => :build | ||
depends_on "pkg-config" => :build | ||
depends_on "protobuf" => :build | ||
depends_on arch: :x86_64 | ||
depends_on "openjdk@11" | ||
|
||
def install | ||
# Missing executable permission reported upstream: https://github.com/apache/pulsar/issues/11833 | ||
chmod "+x", "src/rename-netty-native-libs.sh" | ||
|
||
with_env("TMPDIR" => buildpath, **Language::Java.java_home_env("11")) do | ||
system "mvn", "-X", "clean", "package", "-DskipTests", "-Pcore-modules" | ||
end | ||
|
||
built_version = if build.head? | ||
# This script does not need any particular version of py3 nor any libs, so both | ||
# brew-installed python and system python will work. | ||
Utils.safe_popen_read("python3", "src/get-project-version.py").strip | ||
else | ||
version | ||
end | ||
zbentley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
binpfx = "apache-pulsar-#{built_version}" | ||
system "tar", "-xf", "distribution/server/target/#{binpfx}-bin.tar.gz" | ||
libexec.install "#{binpfx}/bin", "#{binpfx}/lib", "#{binpfx}/instances", "#{binpfx}/conf" | ||
(libexec/"lib/presto/bin/procname/Linux-ppc64le").rmtree | ||
pkgshare.install "#{binpfx}/examples", "#{binpfx}/licenses" | ||
(etc/"pulsar").install_symlink libexec/"conf" | ||
|
||
libexec.glob("bin/*") do |path| | ||
if !path.fnmatch?("*common.sh") && !path.directory? | ||
bin_name = path.basename | ||
(bin/bin_name).write_env_script libexec/"bin"/bin_name, Language::Java.java_home_env("11") | ||
end | ||
end | ||
end | ||
|
||
def post_install | ||
(var/"log/pulsar").mkpath | ||
end | ||
|
||
service do | ||
run [bin/"pulsar", "standalone"] | ||
log_path var/"log/pulsar/output.log" | ||
error_log_path var/"log/pulsar/error.log" | ||
end | ||
|
||
test do | ||
fork do | ||
exec bin/"pulsar", "standalone", "--zookeeper-dir", "#{testpath}/zk", " --bookkeeper-dir", "#{testpath}/bk" | ||
end | ||
# The daemon takes some time to start; pulsar-client will retry until it gets a connection, but emit confusing | ||
# errors until that happens, so sleep to reduce log spam. | ||
sleep 15 | ||
|
||
output = shell_output("#{bin}/pulsar-client produce my-topic --messages 'hello-pulsar'") | ||
assert_match "1 messages successfully produced", output | ||
output = shell_output("#{bin}/pulsar initialize-cluster-metadata -c a -cs localhost -uw localhost -zk localhost") | ||
assert_match "Cluster metadata for 'a' setup correctly", output | ||
end | ||
end |
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.
This should be fixed upstream.
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.
It is executable in master: https://github.com/apache/pulsar/blob/master/src/rename-netty-native-libs.sh
The only place it seems to be not executable is in the tarballs on the apache mirrors.
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.
Then upstream needs to check why.
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.
I filed an issue upstream and linked to it in the formula.