Dart VM initialization failed: Snapshot not compatible - dart

I just run dart2aot main.dart main.aot to compile my dart file to binary and it runs fine on windows, but when I try to dartaotruntime main.aot on another machine, with Linux OS (Ubuntu) it doesn't work, giving me that error:
VM initialization failed: Snapshot not compatible with the current VM configuration: the snapshot requires 'product use_bare_instructions no-"asserts" no-causal_async_stacks no-bytecode x64-win' but the VM has 'product use_bare_instructions no-"asserts" no-causal_async_stacks no-bytecode x64-sysv
How can I solve that? There is a way for me on a windows machine generate the aot for linux?

Answer from Vyacheslav Egorov on the Dart SDK team:
We currently don't support cross compilation of AOT snapshots using Dart SDK. To generate a snapshot for Linux you would need to run Linux version of the Dart SDK. (e.g. you could try using https://learn.microsoft.com/en-us/windows/wsl/install-win10 for that)

Related

Electron - build an installer for Windows x64 on Mac

I am new to electron and trying to build a windows installer for the electron app using my mac. I am using electron-packager to package the app and then electron-wix-msi to build the installer. When the build installer steps are executed, the error Unable to read file info from exe. Falling back to packaging description. Error: spawn Unknown system error -86 is thrown. please see the full error message in the attached screenshot.
I would like to highlight that when I build an installer for macOS, it works. Should I understand that I can not build a windows installer using mac?
build_installer64.ts file:
You can't do that, you have to do this on the Windows platform.
I use GitHub Actions to build my app for each platform, code for Windows:
https://code.korbsstudio.com/KorbsStudio/electron-builder-sample/-/blob/main/.github/workflows/build.yml#L52-71
Optionally, you can also use a Windows virtual machine and repeat the same process in there.
Update, for those interested in doing this on Linux, building a EXE setup file seems to be possible. You'll need to have wine installed and use:
npx electron-builder build --win

How to build a Windows driver development kit 7 on 10

I am trying to build a Windows driver for a piece of hardware I am using. The build notes seem dated as they specify using DDK for Win7. I have Windows kit version 10. Are these the same thing just later version? The instructions then state to open a DDK command window environment then use "build -ceZ" in the dir where the files are located. Does v10 have this console and if so where can I find it? Thanks
https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/wdk-and-visual-studio-build-environment
"The Windows Driver Kit (WDK) 8.1 and WDK 8 introduced a major change
to the environment that you use to build a driver. The WDK no longer
uses Build.exe. The WDK build environment for drivers uses MSBuild.exe
and is fully integrated with the Visual Studio development
environment. This means that source files, makefile.inc, makefile.new
and other related build files present in the previous version of the
WDK are no longer used. The WDK now enables you to create, edit,
build, test, and deploy a driver through Visual Studio. The purpose of
this document is to provide information to help users familiar with
previous WDKs in getting started with the WDK 8.1 and WDK 8."
If you want to build the driver as is then you will need to install the Windows 7.1 DDK and build it using its tools.
https://en.wikipedia.org/wiki/Windows_Driver_Kit
https://www.microsoft.com/en-gb/download/details.aspx?id=11800
You are allowed to install different versions of the DDK on the same machine.
You might find it tricky to install DDK 7.1 on Windows 10 though, try and use this to get around any problem install.
https://stackoverflow.com/questions/32091593/cannot-install-windows-sdk-7-1-on-windows-10#:~:text=If%20you%20continue%20with%20Setup,187668%20and%20then%20rerun%20Setup.
Then it's just a case of "choosing the 7.1 ddk environment (32bit or 64bit)" so that it's tools are accessible/used when "building" your driver.
Look in your startmenu at "StartMenu -> Windows Driver Kits -> WDK XXXX -> Build Environments" to find a command prompt to open.
If you can't/don't want to install the DDK 7.1 and a WDK8+ version of your driver project isn't available then it may be possible to convert the driver from using the older "makefile" into new msbuild way of building, but might be fiddly.
https://community.osr.com/discussion/289475/build-exe-to-msbuild-exe-migration-advice
"If you go into VS you should be able to create a WDK driver project.
It will give you a solution with (I think) one C file filled with
everything necessary to make a driver which does nothing. But, most
importantly, it will generate an XML file that MSBuild will accept.
The XML format is not documented. After you have this XML file you
should be able to figure out how to add your files to it by hand, but
you could move the existing driver files to the project using the GUI.
That may be easiest."

kotlin Native Unknown Host Target

I have created a new Hello World Kotlin Native project in CLion IDE but i am getting. kotlin native unknown host target error in.
if (NOT KONANC_TARGET)
if (APPLE)
set(KONANC_TARGET macbook)
elseif (UNIX)
set(KONANC_TARGET linux)
else ()
**message(FATAL_ERROR "Unsupported host target")**
Because I am using windows and KONANC is only supported on macOS and Linux.
How can I fix this error and run Kotlin Native project on windows ?
I followed this Kotlin Native Tutorial.
This problem is known, but only limited to CMake files. You could still use Gradle or command line tools on Windows.

F# code porting from windows to ubuntu

I am windows developer and trying to write a program on ubuntu in F#
I have ubuntu 16.04 and I am following video https://channel9.msdn.com/Events/Build/2016/T661
I have installed dotnet-dev-1.0.0-preview2.1-003177
Now I am able to do a small hello world program in C#
But when I follow steps from above video I get error when I do 'dotnet run'
"
The specified framework 'Microsoft.NETCore.App', version '1.0.0' was not found.
- Check application dependencies and target a framework version installed at:
/usr/share/dotnet/shared/Microsoft.NETCore.App
- The following versions are installed:
1.1.0
- Alternatively, install the framework version '1.0.0'.
"
Also one thing I observed is I don't have 'Nuget.config' like the video shows.
I have below questions:
How to resolve above query
Is there any tutorial available for development of f# on ubuntu either using .net core or mono as finally I would like to port my Actor model akka.net code from windows to ubuntu.
Regards,
Amit Bhagwat

Vala/Genie builds for Win/Mac?

Is the Vala/Genie compiler available on the Windows and Mac OS X platforms? I know that it is possible to use GLib and GTK on Windows and Mac OS X, but there are no official downloads of Vala for either platform.
Vala 0.28 is currently available on Mac OS X in just the same way as the rest of the GLib/GTK platform is. Here are the official instructions for setting up a GLib/GTK development environment on Mac OS X. To build the Vala/Genie compiler, run jhbuild build vala after completing those instructions.
I don't know the answer for Windows.
There are no "official" builds of Vala as such. Vala is officially released as source code only. The source is then built by various distributors who package and distribute the builds.
On Linux this is done by distributions like Fedora and Ubuntu. On Mac OS X probably the most relevant is Brew and on Windows MSYS2. For more details on all of these ways see the Installing Vala section of the Vala wiki.
There are several ways of getting Vala compiler to work on Windows. The easiest solution would be installing MSYS2 which always provides fresh version of vala as one of it's packages.

Resources