Skip to content
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

Fix Using unsupported buffer type: 253 (parameter: 1) when trying to use the CLI #3981

Closed
wants to merge 9 commits into from

Conversation

xiangzhai
Copy link
Contributor

@xiangzhai xiangzhai commented Apr 7, 2024

Hi @weiznich

brew install mysql-client for macOS will install mysql-client 8.3, but diesel CLI thrown such error to Apple fans: #3929

Using unsupported buffer type: 253 (parameter: 1)

I autogen mysqlclient-sys by rust-bindgen to support new and old versions about MySQL. And adjusted diesel to meet the diff.

Could you review the patch please?

Thanks,
Leslie Zhai

@@ -154,6 +154,11 @@ impl From<u32> for Flags {
}
}

#[cfg(target_os = "linux")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to fix the ugly FALSE?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use ffi::my_bool::default()?

@@ -154,6 +154,11 @@ impl From<u32> for Flags {
}
}

#[cfg(target_os = "linux")]
static FALSE: ffi::my_bool = 0;
#[cfg(any(target_os = "macos", target_os = "windows"))]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Conditional compilation supported mysql_client_version is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiangzhai xiangzhai changed the title [macOS] Fix Using unsupported buffer type: 253 (parameter: 1) when trying to use the CLI Fix Using unsupported buffer type: 253 (parameter: 1) when trying to use the CLI Apr 7, 2024
Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this PR. This is a good starting point for seeing what might need to change here.

That written: I need to raise a few constrains for a potential fix here:

  • We do not want to break compatibility with older mysqlclient versions. That means it should be possible to use mysqlclient 8.1 or older on macos.
  • We do not want to depend on bindgen by default as that pulls in a rather heavy (and problematic) dependency on libclang.

@@ -17,7 +17,7 @@ byteorder = { version = "1.0", optional = true }
chrono = { version = "0.4.20", optional = true, default-features = false, features = ["clock", "std"] }
libc = { version = "0.2.0", optional = true }
libsqlite3-sys = { version = ">=0.17.2, <0.29.0", optional = true, features = ["bundled_bindings"] }
mysqlclient-sys = { version = "0.2.5", optional = true }
mysqlclient-sys = { git = "https://github.com/xiangzhai/mysqlclient-sys.git", branch = "rust-bindgen", optional = true }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible to depend on a forked git version here. These patches need to be included into the mysqlclient-sys repo.

(Open a PR there and we can discuss the changes there)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WumaCoder
Copy link

Is there any other solution?

@weiznich
Copy link
Member

weiznich commented May 5, 2024

@WumaCoder Such questions are highly discouraged at WIP PR's. If you want to contribute a fix feel free to open a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants