@@ -103,16 +103,13 @@ def install
103
103
-DOPENSSL_ROOT_DIR=#{ Formula [ "openssl@3" ] . opt_prefix }
104
104
-DWITH_ICU=#{ icu4c . opt_prefix }
105
105
-DWITH_SYSTEM_LIBS=ON
106
- -DWITH_BOOST=boost
107
106
-DWITH_EDITLINE=system
108
- -DWITH_LIBEVENT=system
109
107
-DWITH_LZ4=system
110
108
-DWITH_PROTOBUF=system
111
109
-DWITH_SSL=system
112
110
-DWITH_ZLIB=system
113
111
-DWITH_ZSTD=system
114
112
-DWITH_UNIT_TESTS=OFF
115
- -DWITH_INNODB_MEMCACHED=ON
116
113
]
117
114
118
115
system "cmake" , "-S" , "." , "-B" , "build" , *args , *std_cmake_args
@@ -133,13 +130,13 @@ def install
133
130
bin . install_symlink prefix /"support-files/mysql.server"
134
131
135
132
# Install my.cnf that binds to 127.0.0.1 by default
136
- ( buildpath /"my.cnf" ) . write <<~EOS
133
+ ( buildpath /"my.cnf" ) . write <<~INI
137
134
# Default Homebrew MySQL server config
138
135
[mysqld]
139
136
# Only allow connections from localhost
140
137
bind-address = 127.0.0.1
141
138
mysqlx-bind-address = 127.0.0.1
142
- EOS
139
+ INI
143
140
etc . install "my.cnf"
144
141
end
145
142
@@ -187,17 +184,33 @@ def caveats
187
184
( testpath /"mysql" ) . mkpath
188
185
( testpath /"tmp" ) . mkpath
189
186
190
- args = %W[ --no-defaults --user=#{ ENV [ "USER" ] } --datadir=#{ testpath } /mysql --tmpdir=#{ testpath } /tmp ]
191
- system bin /"mysqld" , *args , "--initialize-insecure" , "--basedir=#{ prefix } "
192
187
port = free_port
193
- pid = spawn ( bin /"mysqld" , *args , "--port=#{ port } " )
188
+ socket = testpath /"mysql.sock"
189
+ mysqld_args = %W[
190
+ --no-defaults
191
+ --mysqlx=OFF
192
+ --user=#{ ENV [ "USER" ] }
193
+ --port=#{ port }
194
+ --socket=#{ socket }
195
+ --basedir=#{ prefix }
196
+ --datadir=#{ testpath } /mysql
197
+ --tmpdir=#{ testpath } /tmp
198
+ ]
199
+ client_args = %W[
200
+ --port=#{ port }
201
+ --socket=#{ socket }
202
+ --user=root
203
+ --password=
204
+ ]
205
+
206
+ system bin /"mysqld" , *mysqld_args , "--initialize-insecure"
207
+ pid = spawn ( bin /"mysqld" , *mysqld_args )
194
208
begin
195
209
sleep 5
196
-
197
- output = shell_output ( "#{ bin } /mysql --port=#{ port } --user=root --password= --execute='show databases;'" )
210
+ output = shell_output ( "#{ bin } /mysql #{ client_args . join ( " " ) } --execute='show databases;'" )
198
211
assert_match "information_schema" , output
199
- system bin /"mysqladmin" , "--port=#{ port } " , "--user=root" , "--password=" , "shutdown"
200
212
ensure
213
+ system bin /"mysqladmin" , *client_args , "shutdown"
201
214
Process . kill "TERM" , pid
202
215
end
203
216
end
0 commit comments