Patch amqp dep for elixir 1.15

This commit is contained in:
Rin Kuryloski 2023-07-03 18:04:34 +02:00
parent 89a3ffcff2
commit 9c66e73266
2 changed files with 17 additions and 0 deletions

View File

@ -389,6 +389,8 @@ erlang_dev_package.hex_package(
build_file = "@rabbitmq-server//bazel:BUILD.amqp",
sha256 = "b6d926770e4508e30e3e9e476c57b6c8aeda44f7715663bdc38935620ce5be6f",
version = "2.1.1",
patch_args = ["-p1"],
patches = ["@rabbitmq-server//bazel:amqp.patch"],
)
erlang_dev_package.git_package(

15
bazel/amqp.patch Normal file
View File

@ -0,0 +1,15 @@
diff --git a/lib/amqp/core.ex b/lib/amqp/core.ex
index a7302aa..abf2be6 100644
--- a/lib/amqp/core.ex
+++ b/lib/amqp/core.ex
@@ -3,6 +3,10 @@ defmodule AMQP.Core do
require Record
+ # Elixir 1.15 compiler optimizations require that we explicitly
+ # add the rabbit_common code path
+ true = :code.add_path(:filename.join(:os.getenv(~c"DEPS_DIR"), ~c"rabbit_common/ebin"))
+
Record.defrecord(
:p_basic,
:P_basic,