greatest-ape / OctaSine

Frequency modulation synthesizer plugin (VST2, CLAP). Runs on macOS, Windows and Linux.
https://www.octasine.com/
GNU Affero General Public License v3.0
654 stars 18 forks source link

Build fails: use of undeclared crate or module `platform` [FreeBSD support] #117

Open yurivict opened 2 years ago

yurivict commented 2 years ago
error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/baseview-b3712638bacb3fdf2883cb5aa3f6caed0e91ac8c/src/window.rs:16:20
   |
16 |     window_handle: platform::WindowHandle,
   |                    ^^^^^^^^ use of undeclared crate or module `platform`

error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/baseview-b3712638bacb3fdf2883cb5aa3f6caed0e91ac8c/src/window.rs:28:27
   |
28 |     fn new(window_handle: platform::WindowHandle) -> Self {
   |                           ^^^^^^^^ use of undeclared crate or module `platform`

error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/baseview-b3712638bacb3fdf2883cb5aa3f6caed0e91ac8c/src/window.rs:56:21
   |
56 |     window: &'a mut platform::Window,
   |                     ^^^^^^^^ use of undeclared crate or module `platform`

error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/baseview-b3712638bacb3fdf2883cb5aa3f6caed0e91ac8c/src/window.rs:62:36
   |
62 |     pub(crate) fn new(window: &mut platform::Window) -> Window {
   |                                    ^^^^^^^^ use of undeclared crate or module `platform`

error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/baseview-b3712638bacb3fdf2883cb5aa3f6caed0e91ac8c/src/gl/mod.rs:69:20
   |
69 |     CreationFailed(platform::CreationFailedError),
   |                    ^^^^^^^^ use of undeclared crate or module `platform`

error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/baseview-b3712638bacb3fdf2883cb5aa3f6caed0e91ac8c/src/gl/mod.rs:73:14
   |
73 |     context: platform::GlContext,
   |              ^^^^^^^^ use of undeclared crate or module `platform`

error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/baseview-b3712638bacb3fdf2883cb5aa3f6caed0e91ac8c/src/gl/mod.rs:82:9
   |
82 |         platform::GlContext::create(parent, config)
   |         ^^^^^^^^ use of undeclared crate or module `platform`

error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/baseview-b3712638bacb3fdf2883cb5aa3f6caed0e91ac8c/src/window.rs:73:39
   |
73 |         let window_handle = platform::Window::open_parented::<P, H, B>(parent, options, build);
   |                                       ^^^^^^ not found in `platform`
   |

The platrorm crate used in the code isn't listed in Cargo.lock

Version: 0.8.1 rust-1.63.0 FreeBSD 13.1 STABLE

greatest-ape commented 2 years ago

Hi,

This is because of the lack of FreeBSD support in baseview that you pointed out here: https://github.com/RustAudio/baseview/issues/91

I don’t know if there are other blockers for BSD support.

yurivict commented 2 years ago

I added the pull request for that issue in baseline.

But now the build fails like this:

  --> /disk-samsung/freebsd-ports/audio/octasine/work/iced_baseview-b78fa8057d1b7ba0adf0351a59173ec4e8ec9ee4/src/conversion.rs:28:13
   |
28 |             baseview::MouseEvent::ButtonPressed(button) => {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /disk-samsung/freebsd-ports/audio/octasine/work/baseview-c0c01e77c3c8ae36bede98374893f46ab8595007/src/event.rs:46:5
   |
46 |     ButtonPressed {
   |     ------------- `baseview::MouseEvent::ButtonPressed` defined here
   |
help: use struct pattern syntax instead
   |
28 |             baseview::MouseEvent::ButtonPressed { /* fields */ } => {
   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider importing one of these items instead
   |
1  | use crate::conversion::IcedMouseEvent::ButtonPressed;
   |
1  | use iced_core::mouse::Event::ButtonPressed;
   |
1  | use iced_native::mouse::Event::ButtonPressed;
   |
help: if you import `ButtonPressed`, refer to it directly
   |
28 -             baseview::MouseEvent::ButtonPressed(button) => {
28 +             ButtonPressed(button) => {
   |

error[E0532]: expected tuple struct or tuple variant, found struct variant `baseview::MouseEvent::ButtonReleased`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/iced_baseview-b78fa8057d1b7ba0adf0351a59173ec4e8ec9ee4/src/conversion.rs:35:13
   |
35 |             baseview::MouseEvent::ButtonReleased(button) => {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /disk-samsung/freebsd-ports/audio/octasine/work/baseview-c0c01e77c3c8ae36bede98374893f46ab8595007/src/event.rs:54:5
   |
54 |     ButtonReleased {
   |     -------------- `baseview::MouseEvent::ButtonReleased` defined here
   |
help: use struct pattern syntax instead
   |
35 |             baseview::MouseEvent::ButtonReleased { /* fields */ } => {
   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider importing one of these items instead
   |
1  | use crate::conversion::IcedMouseEvent::ButtonReleased;
   |
1  | use iced_core::mouse::Event::ButtonReleased;
   |
1  | use iced_native::mouse::Event::ButtonReleased;
   |
help: if you import `ButtonReleased`, refer to it directly
   |
35 -             baseview::MouseEvent::ButtonReleased(button) => {
35 +             ButtonReleased(button) => {
   |

error[E0532]: expected tuple struct or tuple variant, found struct variant `baseview::MouseEvent::WheelScrolled`
  --> /disk-samsung/freebsd-ports/audio/octasine/work/iced_baseview-b78fa8057d1b7ba0adf0351a59173ec4e8ec9ee4/src/conversion.rs:42:13
   |
42 |             baseview::MouseEvent::WheelScrolled(delta) => match delta {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct pattern syntax instead: `baseview::MouseEvent::WheelScrolled { /* fields */ }`
   |
  ::: /disk-samsung/freebsd-ports/audio/octasine/work/baseview-c0c01e77c3c8ae36bede98374893f46ab8595007/src/event.rs:62:5
   |
62 |     WheelScrolled {
   |     ------------- `baseview::MouseEvent::WheelScrolled` defined here

error[E0027]: pattern does not mention field `modifiers`
   --> /disk-samsung/freebsd-ports/audio/octasine/work/iced_baseview-b78fa8057d1b7ba0adf0351a59173ec4e8ec9ee4/src/application/state.rs:121:36
    |
121 |               baseview::Event::Mouse(baseview::MouseEvent::CursorMoved {
    |  ____________________________________^
122 | |                 position,
123 | |             }) => {
    | |_____________^ missing field `modifiers`
    |
help: include the missing field in the pattern
    |
122 |                 position, modifiers }) => {
    |                         ~~~~~~~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
    |
122 |                 position, .. }) => {
    |                         ~~~~~~
greatest-ape commented 2 years ago

Hmm, yeah, that’s probably because iced_baseview hasn’t been updated to use the very latest baseview yet.

Could you please check if https://github.com/iced-rs/iced even runs on BSD? The repo says it supports “Windows, macOS, Linux, and the Web”.

yurivict commented 2 years ago

Iced example is built fine. It crashes during runtime: https://github.com/iced-rs/iced/issues/1499