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

Can not build with clang18 #962

Open
Schievel1 opened this issue Apr 3, 2024 · 5 comments
Open

Can not build with clang18 #962

Schievel1 opened this issue Apr 3, 2024 · 5 comments

Comments

@Schievel1
Copy link

Hi,

I have some trouble building this on one system, the weird thing is it works fine on another system.
I can't figure out why that happens, it can not find the bindings below.

     Running `rustc --crate-name skia_bindings --edition=2021 /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto --cfg 'feature="binary-cache"' --cfg 'feature="embed-icudtl"' --cfg 'feature="flate2"' --cfg 'feature="gl"' --cfg 'feature="lazy_static"' --cfg 'feature="tar"' --cfg 'feature="textlayout"' --cfg 'feature="ureq"' -C metadata=490906c54de2ec60 -C extra-filename=-490906c54de2ec60 --out-dir /var/tmp/portage/app-editors/neovide-0.12.2/work/neovide-0.12.2/target/release/deps -L dependency=/var/tmp/portage/app-editors/neovide-0.12.2/work/neovide-0.12.2/target/release/deps --extern lazy_static=/var/tmp/portage/app-editors/neovide-0.12.2/work/neovide-0.12.2/target/release/deps/liblazy_static-b190eea2c81aa18e.rmeta --cap-lints allow -L /var/tmp/portage/app-editors/neovide-0.12.2/work/neovide-0.12.2/target/release/build/skia-bindings-e1350025a1d273d6/out/skia -l static=skparagraph -l static=skshaper -l static=skunicode -l static=skia -l static=skia-bindings -l stdc++ -l fontconfig -l freetype -l png16 -l z -l icudata -l icui18n -l icuio -l icutest -l icutu -l icuuc -l harfbuzz -l expat -l jpeg`
error[E0432]: unresolved imports `crate::SkPDF_Metadata_CompressionLevel`, `crate::SkParsePath_PathEncoding`
 --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/defaults.rs:5:68
  |
5 |     SkBlendMode, SkBlurStyle, SkCanvas_Lattice_RectType, SkClipOp, SkPDF_Metadata_CompressionLevel,
  |                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `SkPDF_Metadata_CompressionLevel` in the root
6 |     SkPaint_Cap, SkPaint_Join, SkParsePath_PathEncoding, SkPathDirection, SkTileMode,
  |                                ^^^^^^^^^^^^^^^^^^^^^^^^ no `SkParsePath_PathEncoding` in the root

error[E0432]: unresolved import `crate::SkPathVerb`
 --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:9:73
  |
9 | use crate::{SkAlphaType, SkBlendMode, SkBlendModeCoeff, SkPathFillType, SkPathVerb, SkPath_Verb};
  |                                                                         ^^^^^^^^^^
  |                                                                         |
  |                                                                         no `SkPathVerb` in the root
  |                                                                         help: a similar name exists in the module: `SkPath_Verb`

error[E0412]: cannot find type `skia_textlayout_Affinity` in the crate root
  --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/defaults.rs:79:29
   |
79 |     impl Default for crate::skia_textlayout_Affinity {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `skia_textlayout_TextAlign` in the crate root
  --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/defaults.rs:85:29
   |
85 |     impl Default for crate::skia_textlayout_TextAlign {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `skia_textlayout_PositionWithAffinity` in the crate root
  --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/defaults.rs:94:29
   |
94 |     impl Default for crate::skia_textlayout_PositionWithAffinity {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `skia_textlayout_TextBaseline` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/defaults.rs:103:29
    |
103 |     impl Default for crate::skia_textlayout_TextBaseline {
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `skia_textlayout_TextDecorationStyle` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/defaults.rs:109:29
    |
109 |     impl Default for crate::skia_textlayout_TextDecorationStyle {
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `skia_textlayout_TextDecorationMode` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/defaults.rs:115:29
    |
115 |     impl Default for crate::skia_textlayout_TextDecorationMode {
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `skia_textlayout_StyleType` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/defaults.rs:121:29
    |
121 |     impl Default for crate::skia_textlayout_StyleType {
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `GrGLenum` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:103:18
    |
103 | impl From<crate::GrGLenum> for crate::GrGLFormat {
    |                  ^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `GrGLFormat` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:103:39
    |
103 | impl From<crate::GrGLenum> for crate::GrGLFormat {
    |                                       ^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `GrGLenum` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:104:23
    |
104 |     fn from(e: crate::GrGLenum) -> Self {
    |                       ^^^^^^^^ not found in the crate root

error[E0425]: cannot find function, tuple struct or tuple variant `C_GrGLFormatFromGLEnum` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:105:25
    |
105 |         unsafe { crate::C_GrGLFormatFromGLEnum(e) }
    |                         ^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `GrGLFormat` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:110:18
    |
110 | impl From<crate::GrGLFormat> for crate::GrGLenum {
    |                  ^^^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `GrGLenum` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:110:41
    |
110 | impl From<crate::GrGLFormat> for crate::GrGLenum {
    |                                         ^^^^^^^^ not found in the crate root

error[E0412]: cannot find type `GrGLFormat` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:111:28
    |
111 |     fn from(format: crate::GrGLFormat) -> Self {
    |                            ^^^^^^^^^^ not found in the crate root

error[E0425]: cannot find function, tuple struct or tuple variant `C_GrGLFormatToEnum` in the crate root
   --> /var/tmp/portage/app-editors/neovide-0.12.2/work/cargo_home/gentoo/skia-bindings-0.68.0/src/impls.rs:112:25
    |
112 |         unsafe { crate::C_GrGLFormatToEnum(format) }
    |                         ^^^^^^^^^^^^^^^^^^ not found in the crate root

Some errors have detailed explanations: E0412, E0425, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `skia-bindings` (lib) due to 17 previous errors

@pragmatrix
Copy link
Member

From a first glance, the feature set does not match the bindings. Is this a full build or are binaries downloaded? And did you try to delete the target/ directory before a rebuild?

@Schievel1
Copy link
Author

Schievel1 commented Apr 4, 2024

I checked the gn_args across both machines and they are the same. So I assume it's not creating the bindings according to the features on one machine.

Build is full, I let the package manager download the source from your repo beforehand because of sandboxing during build and then set SKIA_SOURCE_DIR accordingly.

Not only target but the whole source directory of skia and skia_rust is deleted between builds.

With package manager I don't mean cargo but a distro's package manager. Emerge in fact. I put the build script here

https://gist.github.com/Schievel1/0d1b027ec775bfe61bfbd97e37a6733c

@Schievel1
Copy link
Author

here is the bug with the full build log https://bugs.gentoo.org/928647

@dbger
Copy link

dbger commented Apr 15, 2024

I have same trouble, failed to build it with the lastest clang(18.1.3), but the clang(17.0.6) is okey.

@Schievel1
Copy link
Author

I have same trouble, failed to build it with the lastest clang(18.1.3), but the clang(17.0.6) is okey.

Yes, thats the reason! Thanks for clearing that up, I wasn't sure what the difference between those two machines is where one works and one does not.
The one that works has clang17, the one where it does not has clang18.

@Schievel1 Schievel1 changed the title Can not build in package manager environment Can not build with clang18 Apr 15, 2024
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

No branches or pull requests

3 participants