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

ffi build error #1046

Closed
fabolous005 opened this issue Mar 13, 2024 · 2 comments
Closed

ffi build error #1046

fabolous005 opened this issue Mar 13, 2024 · 2 comments
Labels
dev Development / Build issues

Comments

@fabolous005
Copy link

When compiling with following meson config and every other i tried:
i tried varying the C/C++ compiler and rust compiler version.

The Meson build system
Version: 1.3.2
Source dir: /home/user/git/rnote
Build dir: /home/user/git/rnote/_mesonbuild
Build type: native build
Project name: rnote
Project version: 0.10.1
C++ compiler for the host machine: ccache c++ (gcc 13.2.1 "c++ (Gentoo 13.2.1_p20240210 p14) 13.2.1 20240210")
C++ linker for the host machine: c++ ld.bfd 2.42
Rust compiler for the host machine: rustc -C linker=cc (rustc 1.76.0)
Rust linker for the host machine: rustc -C linker=cc ld.bfd 2.42
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/usr/bin/pkg-config) 2.1.1
Run-time dependency glib-2.0 found: YES 2.78.4
Run-time dependency gio-2.0 found: YES 2.78.4
Run-time dependency cairo found: YES 1.18.0
Program cargo found: YES (/usr/bin/cargo)
Program cmake found: YES (/usr/bin/cmake)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program desktop-file-validate found: YES (/usr/bin/desktop-file-validate)
Program appstream-util found: YES (/usr/bin/appstream-util)
Program fc-cache found: YES (/usr/bin/fc-cache)
Program update-mime-database found: YES (/usr/bin/update-mime-database)
Program build-aux/cargo_build.py found: YES (/usr/bin/python3.11 /home/user/git/rnote/build-aux/cargo_build.py)
Program build-aux/inno_build.py found: YES (/usr/bin/python3.11 /home/user/git/rnote/build-aux/inno_build.py)
Run-time dependency appstream found: YES 0.16.4
Run-time dependency poppler-glib found: YES 24.03.0
Run-time dependency gtk4 found: YES 4.12.5
Run-time dependency libadwaita-1 found: YES 1.4.4
Message: Configuring config.rs file
Configuring config.rs using configuration
Message: Configuring desktop file
Configuring app.desktop.in using configuration
Program msgfmt found: YES (/usr/bin/msgfmt)
Message: Configuring settings GSchema file
Configuring com.github.flxzt.rnote.gschema.xml using configuration
Message: Configuring appdata file
Configuring app.metainfo.xml.in using configuration
Message: Configuring MIME-type file
Configuring com.github.flxzt.rnote.xml using configuration
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Dependency gio-2.0 found: YES 2.78.4 (cached)
Program /usr/bin/glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program gtk4-update-icon-cache found: NO
Program gtk-update-icon-cache found: YES (/usr/bin/gtk-update-icon-cache)
Program update-desktop-database found: YES (/usr/bin/update-desktop-database)
Program update-mime-database found: YES (/usr/bin/update-mime-database)
Message: Configuring Inno-Setup installer script file
Configuring rnote_inno.iss using configuration
Build targets in project: 52

rnote 0.10.1

  User defined options
    prefix: /usr
    cli   : true

Found ninja-1.11.1 at /usr/bin/ninja

it fails with the following error message:

error[E0618]: expected function, found struct `crate::ffi::results_new`
   --> /home/user/git/rnote/_mesonbuild/cargo-home/git/checkouts/ink-stroke-modeler-rs-626b3ce1f4959ff6/b67f11b/src/lib.rs:425:27
    |
425 |         let mut results = crate::ffi::results_new();
    |                           ^^^^^^^^^^^^^^^^^^^^^^^--
    |                           |
    |                           call expression requires function
    |
   ::: /home/user/git/rnote/_mesonbuild/target/release/build/ink-stroke-modeler-rs-290c45f3e85b3aa7/out/autocxx-build-dir/rs/autocxx-ffi-default-gen.rs:1:9722
    |
1   | ...ecialization."] pub struct results_new ; # [doc = "autocxx bindings couldn't be generated: This func...
    |                    ---------------------- struct `crate::ffi::results_new` defined here
    |
help: `crate::ffi::results_new` is a unit struct, and does not take parentheses to be constructed
    |
425 -         let mut results = crate::ffi::results_new();
425 +         let mut results = crate::ffi::results_new;
    |

error[E0618]: expected function, found `stroke_modeler_update`
   --> /home/user/git/rnote/_mesonbuild/cargo-home/git/checkouts/ink-stroke-modeler-rs-626b3ce1f4959ff6/b67f11b/src/lib.rs:426:33
    |
426 |           let c: autocxx::c_int = crate::ffi::stroke_modeler_update(
    |                                   -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here to finish the statement: `;`
    |  _________________________________|
    | |
427 | |             self.0.pin_mut(),
428 | |             input.into_ffi(),
429 | |             results.pin_mut(),
430 | |         );
    | |_________- call expression requires function
    |
   ::: /home/user/git/rnote/_mesonbuild/target/release/build/ink-stroke-modeler-rs-290c45f3e85b3aa7/out/autocxx-build-dir/rs/autocxx-ffi-default-gen.rs:1:8623
    |
1   |   ...ialization."] pub struct stroke_modeler_update ; # [doc = "autocxx bindings couldn't be generated:...
    |                    -------------------------------- `stroke_modeler_update` defined here

error[E0618]: expected function, found `result_make_unique`
   --> /home/user/git/rnote/_mesonbuild/cargo-home/git/checkouts/ink-stroke-modeler-rs-626b3ce1f4959ff6/b67f11b/src/lib.rs:434:46
    |
434 |                 .map(|r| ModelerResult::from(crate::ffi::result_make_unique(r)))
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
    |                                              |
    |                                              call expression requires function
    |
   ::: /home/user/git/rnote/_mesonbuild/target/release/build/ink-stroke-modeler-rs-290c45f3e85b3aa7/out/autocxx-build-dir/rs/autocxx-ffi-default-gen.rs:1:9964
    |
1   | ...specialization."] pub struct result_make_unique ; impl BdWobbleSmootherParams { # [doc = "Synthesize...
    |                      ----------------------------- `result_make_unique` defined here

error[E0618]: expected function, found struct `crate::ffi::results_new`
   --> /home/user/git/rnote/_mesonbuild/cargo-home/git/checkouts/ink-stroke-modeler-rs-626b3ce1f4959ff6/b67f11b/src/lib.rs:442:27
    |
442 |         let mut results = crate::ffi::results_new();
    |                           ^^^^^^^^^^^^^^^^^^^^^^^--
    |                           |
    |                           call expression requires function
    |
   ::: /home/user/git/rnote/_mesonbuild/target/release/build/ink-stroke-modeler-rs-290c45f3e85b3aa7/out/autocxx-build-dir/rs/autocxx-ffi-default-gen.rs:1:9722
    |
1   | ...ecialization."] pub struct results_new ; # [doc = "autocxx bindings couldn't be generated: This func...
    |                    ---------------------- struct `crate::ffi::results_new` defined here
    |
help: `crate::ffi::results_new` is a unit struct, and does not take parentheses to be constructed
    |
442 -         let mut results = crate::ffi::results_new();
442 +         let mut results = crate::ffi::results_new;
    |

error[E0618]: expected function, found `stroke_modeler_predict`
   --> /home/user/git/rnote/_mesonbuild/cargo-home/git/checkouts/ink-stroke-modeler-rs-626b3ce1f4959ff6/b67f11b/src/lib.rs:444:13
    |
444 |             crate::ffi::stroke_modeler_predict(self.0.pin_mut(), results.pin_mut());
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------------------------------
    |             |
    |             call expression requires function
    |
   ::: /home/user/git/rnote/_mesonbuild/target/release/build/ink-stroke-modeler-rs-290c45f3e85b3aa7/out/autocxx-build-dir/rs/autocxx-ffi-default-gen.rs:1:8875
    |
1   | ...ialization."] pub struct stroke_modeler_predict ; pub fn input_new (event_type : root :: ink :: stro...
    |                  --------------------------------- `stroke_modeler_predict` defined here

error[E0618]: expected function, found `result_make_unique`
   --> /home/user/git/rnote/_mesonbuild/cargo-home/git/checkouts/ink-stroke-modeler-rs-626b3ce1f4959ff6/b67f11b/src/lib.rs:448:46
    |
448 |                 .map(|r| ModelerResult::from(crate::ffi::result_make_unique(r)))
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
    |                                              |
    |                                              call expression requires function
    |
   ::: /home/user/git/rnote/_mesonbuild/target/release/build/ink-stroke-modeler-rs-290c45f3e85b3aa7/out/autocxx-build-dir/rs/autocxx-ffi-default-gen.rs:1:9964
    |
1   | ...specialization."] pub struct result_make_unique ; impl BdWobbleSmootherParams { # [doc = "Synthesize...
    |                      ----------------------------- `result_make_unique` defined here

For more information about this error, try `rustc --explain E0618`.
The following warnings were emitted during compilation:

warning: ink-stroke-modeler-rs@0.1.0: Compiler version doesn't include clang or GCC: "cc" "--version"
warning: ink-stroke-modeler-rs@0.1.0: Compiler version doesn't include clang or GCC: "c++" "--version"
warning: ink-stroke-modeler-rs@0.1.0: Compiler version doesn't include clang or GCC: "cc" "--version"
warning: ink-stroke-modeler-rs@0.1.0: Compiler version doesn't include clang or GCC: "c++" "--version"
warning: ink-stroke-modeler-rs@0.1.0: Compiler version doesn't include clang or GCC: "c++" "--version"
warning: ink-stroke-modeler-rs@0.1.0: Compiler version doesn't include clang or GCC: "c++" "--version"

error: could not compile `ink-stroke-modeler-rs` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
cargo call failed, code 25856
[38/40] Merging translations for crates/rnote-ui/data/com.github.flxzt.rnote.metainfo.xml
FAILED: rnote 
/usr/bin/python3.11 /home/user/git/rnote/build-aux/cargo_build.py /home/user/git/rnote/_mesonbuild /home/user/git/rnote CARGO_HOME=/home/user/git/rnote/_mesonbuild/cargo-home /usr/bin/cargo '--manifest-path /home/user/git/rnote/Cargo.toml --target-dir /home/user/git/rnote/_mesonbuild/target -p rnote --release' /home/user/git/rnote/_mesonbuild/target/release/rnote /home/user/git/rnote/_mesonbuild/rnote
ninja: build stopped: subcommand failed.

Steps to reproduce:
clone the repo
follow BUILDING.md

  • OS: Gentoo Linux
  • App Version: tried tags: (10, 10.1, master)
  • Installation Source: manual build with meson
@flxzt flxzt added the dev Development / Build issues label Mar 14, 2024
@Doublonmousse
Copy link
Contributor

This is the ink-stroke-modeler-rs failing to build.
We've had a fair share of compile issue with this over time on different platforms depending on the gcc variants and versions.

The ink-stroke-modeler-rs crate was a rust wrapper of a C++ library but has been rewritten to rust. Hence the compile issue should not be there anymore (that was one major reason the rewrite took place).

If you build from source post #1102, these compile errors shouldn't be there anymore

@flxzt
Copy link
Owner

flxzt commented Jun 9, 2024

Yep, this should be fixed by #1102 !

@flxzt flxzt closed this as completed Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Development / Build issues
Projects
None yet
Development

No branches or pull requests

3 participants