v icon indicating copy to clipboard operation
v copied to clipboard

examples/database/mysql.v fails on MacOS

Open AllanCochrane opened this issue 1 year ago • 2 comments

V doctor:

V full version: V 0.4.4 89f06d3.4640627
OS: macos, macOS, 14.1, 23B74
Processor: 16 cpus, 64bit, little endian, Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz

getwd: /Users/allancochrane/Vlang/v/examples/database
vexe: /Users/allancochrane/Vlang/v/v
vexe mtime: 2024-01-10 19:07:13

vroot: OK, value: /Users/allancochrane/Vlang/v
VMODULES: OK, value: /Users/allancochrane/.vmodules
VTMP: OK, value: /tmp/v_501

Git version: git version 2.42.0
Git vroot status: 0.4.4-11-g46406277-dirty
.git/config present: true

CC version: Apple clang version 15.0.0 (clang-1500.1.0.2.5)
thirdparty/tcc status: thirdparty-macos-amd64 46662e20

What did you do? v -g -o vdbg cmd/v && vdbg mysql.v

import db.mysql

#flag macos -I/opt/brew/opt/mysql/include/mysql -Wl,-rpath /opt/brew/opt/mysql/lib -Wl,-rpath /opt/brew/Cellar/mysql-client/8.1.0/lib

fn main() {
	mut conn := mysql.connect(
		host: 'localhost'
		port: 3306
		username: 'root'
		password: 'xxxxxx'
		dbname: 'development'
	)!
	res := conn.query('show tables')!
	for row in res.rows() {
		println(row.vals.join(', '))
	}
	conn.close()
}

What did you expect to see?

A running program

What did you see instead?

==================
      _db__mysql__DB_use_result in mysql-11ecbf.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
...
==================
(Use `v -cg` to print the entire error message)

builder error: 
==================
C error. This should never happen.

This is a compiler bug, please report it using `v bug file.v`.

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang

[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.

AllanCochrane avatar Jan 10 '24 19:01 AllanCochrane

https://github.com/vlang/v/issues/21555

Avey777 avatar May 23 '24 13:05 Avey777

On macos, using db.mysql has never been successful

Avey777 avatar May 24 '24 23:05 Avey777