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

[feature] supply static crt MT binary build for windows. #616

Open
lencil opened this issue Feb 21, 2022 · 6 comments · May be fixed by #621
Open

[feature] supply static crt MT binary build for windows. #616

lencil opened this issue Feb 21, 2022 · 6 comments · May be fixed by #621

Comments

@lencil
Copy link

lencil commented Feb 21, 2022

when I use rust-skia and rusty_v8 together, the rust-skia binary release is MD, while rusty_v8 binary is MT,link will failed. so I think It's more convenient to supply a MT build binary.

@pragmatrix
Copy link
Member

I am considering this, but would like to restrict the feature combinations for the static crt binaries. Currently we build 9 different combinations for Windows. What features do you need to build skia-safe / skia-bindings with?

@lencil
Copy link
Author

lencil commented Mar 16, 2022

I think this static crt is what I needed.

@lencil lencil closed this as completed Mar 16, 2022
@pragmatrix
Copy link
Member

With feature combination I am relating to the cargo features of skia-safe and skia-binaries. We support features for rendering with OpenGL, for example gl, or with Vulkan (vulkan), and also textlayout for additional support in terms rendering and layouting text (SkParagraph specifically), do you need any of these? I am asking, because we have to build each of them for every binary release (including combinations) and I try to to avoid building binaries that are not used. A more detailed list of available features is here: https://github.com/rust-skia/rust-skia/tree/master/skia-safe#features

@pragmatrix pragmatrix reopened this Mar 16, 2022
@thedracle
Copy link

thedracle commented May 16, 2023

Hi, we are trying to set crt-static for a project which ends up producing a MT linked NodeJS module.

If we enable crt-static, rust-skia looks for a -static prebuilt artifact, and fails when it cannot find one.

 ../../../../../../../../../../.cargo/registry/src/github.com-1ecc6299db9ec823/skia-bindings-0.55.0/skia/bin/gn.exe --root=../../../../../../../../../../.cargo/registry/src/github.com-1ecc6299db9ec823/skia-bindings-0.55.0/skia -q --script-executable=python --regeneration gen .
  CreateProcess failed: The system cannot find the file specified.

It looks like it's maybe something to do with the environment/deps.

It would be helpful when/if this merges, and some static variants are available.

@tronical
Copy link
Contributor

I think you can set FORCE_SKIA_BUILD=1

@thedracle
Copy link

thedracle commented May 16, 2023

Thanks @tronical.

I think it actually is attempting to build after failing to pull the static artifact, but failing with the "The system cannot find the file specified," and the error about not being able to find the '-static' prebuilt is just a red herring.

I checked and gn.exe exists:

~/.cargo/registry/src/github.com-1ecc6299db9ec823/skia-bindings-0.55.0/skia/bin/gn.exe

As well as clang-cl C:\Program Files\LLVM\bin\clang-cl.exe

I can build with the same environment, with crt-static enabled and a fresh checkout of rust-skia @ 0.55.

image

The full output is:

error: failed to run custom build command for `skia-bindings v0.55.0`

Caused by:
  process didn't exit successfully: `C:\Users\jason.thomas\git-projects\node-webrtc-coscreen\rust\coscreen-screen-capturer-rs\target\debug\build\skia-bindings-58bb91e008a8e350\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=SKIA_DEBUG
  HOST: x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=SKIA_SOURCE_DIR
  cargo:rerun-if-env-changed=FORCE_SKIA_BUILD
  STARTING A FULL BUILD
  cargo:rerun-if-env-changed=CLANGCC
  cargo:rerun-if-env-changed=CC
  cargo:rerun-if-env-changed=CLANGCXX
  cargo:rerun-if-env-changed=CXX
  HOST: x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=SKIA_USE_SYSTEM_LIBRARIES
  cargo:rerun-if-env-changed=SDKTARGETSYSROOT
  HOST: x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=VCINSTALLDIR
  cargo:rerun-if-env-changed=LLVM_HOME
  cargo:rerun-if-env-changed=SKIA_NINJA_COMMAND
  cargo:rerun-if-env-changed=SKIA_GN_COMMAND
  Probing 'python'
  Python 3 found: "python"
  Synchronizing Skia dependencies
  Skipping "bin".
  skia\third_party/externals/brotli    @ e61745a6b7add50d380cfd7d3883dd6c62fc2c71
  ...ird_party/externals/libjpeg-turbo @ 22f1a22c99e9dde8cd3c72ead333f425c5a7aa77
  ...rd_party/externals/d3d12allocator @ 169895d529dfce00390a20e69c2f516066fe7a3b
  skia\third_party/externals/expat     @ a28238bdeebc087071777001245df1876a11f5ee
  skia\third_party/externals/piex      @ bb217acdca1cc0c16b704669dd6f91a1b509c406
  ...third_party/externals/libgifcodec @ fd59fa92a0c86788dcdd84d091e1ce81eda06a77
  skia\third_party/externals/libwebp   @ a8e366166ab57bb1b4aaf6739fc775515bc71b51
  skia\third_party/externals/freetype  @ 7cd3f19f21cc9d600e3b765ef2058474d20233e2
  skia\third_party/externals/wuffs     @ 600cd96cf47788ee3a74b40a6028b035c9fd6a61
  ...y/externals/vulkanmemoryallocator @ 7de5cc00de50e71a3aab22dea52fbb7ff4efceb6
  skia\third_party/externals/zlib      @ c876c8f87101c5a75f6014b0f832499afeb65b73
  skia\third_party/externals/libpng    @ 386707c6d19b974ca2e3db7f5c61873813c6fe44
  skia\third_party/externals/icu       @ a0718d4f121727e30b8d52c7a189ebf5ab52421f
  skia\third_party/externals/harfbuzz  @ f1f2be776bcd994fa9262622e1a7098a066e5cf7
  ...third_party/externals/spirv-cross @ 61c603f3baa5270e04bcfb6acf83c654e3c57679
  Skia args: is_official_build=true is_debug=false skia_enable_svg=false skia_enable_gpu=false skia_enable_skottie=false skia_enable_pdf=true skia_use_gl=false skia_use_egl=false skia_use_x11=false skia_use_system_libpng=false skia_use_libwebp_encode=false skia_use_libwebp_decode=false skia_use_system_zlib=false skia_use_xps=false skia_use_dng_sdk=false cc="clang" cxx="clang++" skia_use_icu=false skia_use_system_libjpeg_turbo=false skia_use_expat=true skia_use_system_expat=false win_vc="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC" clang_win="C:\Program Files\LLVM" target_cpu="x86_64" extra_cflags=["/MT","--target=x86_64-pc-windows-msvc"] extra_asmflags=["--target=x86_64-pc-windows-msvc"]
  Done. Made 86 targets from 33 files in 470ms
  ninja: Entering directory `C:\Users\jason.thomas\git-projects\node-webrtc-coscreen\rust\coscreen-screen-capturer-rs\target\debug\build\skia-bindings-364e388bd7ccfb6f\out\skia'
  [0/1] Regenerating ninja files
  FAILED: build.ninja
  ../../../../../../../../../../.cargo/registry/src/github.com-1ecc6299db9ec823/skia-bindings-0.55.0/skia/bin/gn.exe --root=../../../../../../../../../../.cargo/registry/src/github.com-1ecc6299db9ec823/skia-bindings-0.55.0/skia -q --script-executable=python --regeneration gen .
  CreateProcess failed: The system cannot find the file specified.

  --- stderr
  Checking for "C:\\Program Files\\LLVM\\bin\\clang-cl.exe"
  ninja: error: rebuilding 'build.ninja': subcommand failed
  thread 'main' panicked at '`ninja` returned an error, please check the output for details.', C:\Users\jason.thomas\.cargo\registry\src\github.com-1ecc6299db9ec823\skia-bindings-0.55.0\build_support\skia\config.rs:336:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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