How to switch JS engine from SpiderMonkey to V8 - cobalt

I have modified the GetVariables() method in my gyp_configuration.py file and ensured that the variables dictionary that is returned contains the following key/value pairs:
'javascript_engine': 'v8',
'cobalt_enable_jit': 1,
But I still can't switch JS engine from SpiderMonkey to V8
How could we switch JS engine from SpiderMonkey to V8?
Cobalt version:RC(release candidate) of Cobalt 2019 LTS
build configuration: qa
platform:Linux/ARM

Related

GCC Minification not working in AEM for ECMASCRIPT_2020

We are using AEM version 6.5.9
and our js processor config was
min:gcc;languageIn=ECMASCRIPT_2018;obfuscate=true
It works for normal cases but in case we have any optional chaining(e.g. adventurer.dog?.name) then it does not work
You can refer to this link for Online Compiler
In this online compiler if the language is ECMASCRIPT_2020 then it is able to compile else for the lower versions it does not.
The list of allowed language versions is from GitHub Link
So similarly in AEM we changed the js processor config to
min:gcc;languageIn=ECMASCRIPT_2020;obfuscate=true
But then also minification does not work.
My questions are:
Does AEM not support ECMASCRIPT_2020?
Is there any way we can update the gcc version being used by AEM?

UWP - Object reference not set to an instance of an object

After upgrading Microsoft.NETCore.UniversalWindowsPlatform I cannot compile my Xamarin app-project in Release anymore, as I get an Internal compiler error: Object reference not set to an instance of an object.
I am using these NuGet packages
Acr.UserDialogs 5.2.2
ExifLib.PCL 1.0.1 (in portable project)
Microsoft.NETCore.UniversalWindowsPlatform 5.2.0
MR.Gestures 1.3.4
Newtonsoft.Json 7.0.1 (in portable project)
Splat 1.6.2 (in portable project)
SQLite.Net.Core-PCL 3.1.1
SQLite.Net-PCL 3.1.1
Win2D.uwp 1.18.0 (in portable project)
Xam.Plugins.Settings 2.1.0
Xamarin.Forms 2.3.0.107
Xamarin.Insights 1.12.3
XLabs.Core 2.2.0-pre02
XLabs.Forms 2.2.0-pre02
XLabs.IoC 2.2.0-pre02
XLabs.Platform 2.2.0-pre02
XLabs.Serialization 2.2.0-pre02
A log can be found here.
I hope anybody in here can help me.
All platforms are set to Compile with .NET Native tool chain.
UPDATE
If I build XLabs myself and set Compile with .NET Native tool chain to unchecked. These errors occurs.
App manifest
Error Found: The app manifest test detected the following errors:
<project> takes a dependency on Microsoft .Net Native Runtime Package 1.x framework but is missing the framework dependency declaration in the manifest.
Binary analyzer
Error Found: The binary analyzer test detected the following errors:
File C:\Program Files\WindowsApps\<project>_1.8.0.0_x64__r1myykanma94r\clrjit.dll has failed the AppContainerCheck check.
Supported APIs
Error Found: The supported APIs test detected the following errors:
API SystemFunction036 in advapi32.dll is not supported for this application type. clrjit.dll calls this API.
API DebugBreak in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API HeapValidate in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API LoadLibraryExW in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API RtlCaptureContext in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API RtlVirtualUnwind in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API TlsAlloc in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API TlsFree in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API TlsGetValue in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API TlsSetValue in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API UnhandledExceptionFilter in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API VirtualAlloc in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API VirtualProtect in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
API ExecuteAssembly in uwphost.dll is not supported for this application type. <project>.exe calls this API.
API DllGetActivationFactory in uwphost.dll is not supported for this application type. <project>.UWP.exe has an export that forwards to this API.
UPDATE 2
I could easily rewrite the code, so I did not use Win2D.uwp anymore. Somehow I have installed Microsoft.NETCore.UniversalWindowsPlatform v 5.2.0 last friday, but the latest in NuGet is now v 5.1.0.
So now I am down to these NuGet packages
Acr.UserDialogs 5.3.0
ExifLib.PCL 1.0.1 (in portable project)
Microsoft.NETCore.UniversalWindowsPlatform 5.1.0
MR.Gestures 1.3.4
Newtonsoft.Json 7.0.1 (in portable project)
Splat 1.6.2 (in portable project)
SQLite.Net.Core-PCL 3.1.1
SQLite.Net-PCL 3.1.1
Xam.Plugins.Settings 2.1.0
Xamarin.Forms 2.3.0.107
Xamarin.Insights 1.12.3
XLabs.Core 2.2.0-pre02
XLabs.Forms 2.2.0-pre02
XLabs.IoC 2.2.0-pre02
XLabs.Platform 2.2.0-pre02
XLabs.Serialization 2.2.0-pre02
And this error occurs The assembly Windows in file C:\Program Files\WindowsApps\<app-name>_1.8.0.0_x64__r1myykanma94r\Windows.winmd has a non-empty exported type reference table. Every Windows Runtime assembly must have an empty exported type reference table.
UPDATE 3
I figured out uninstalling Win2D.uwp and compiling XLabs myself was the way to go.
I had that problem and the resolution was simple: I had a reference to the PCL version Newtonsoft.Json.dll both in my PCLs and in my UWP project. Older portable version (Portable40).
After I updated to the latest version of Newtonsoft.Json.dll (NuGet version 9.0.1) the compilation exception went away.
Keep in mind that when updating I replaced all references to the Newtonsoft libreary i.e.
In my PCLs I now reference the portable version lib\portable-net40+sl5+wp80+win8+wpa81
In my startup project I now reference the Newtonsoft package (my project.json file contents):
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2",
"Newtonsoft.Json": "9.0.1",
"Xamarin.Forms": "2.3.2.127"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}
which effectively uses the reference to C:\Users\<username>\.nuget\packages\newtonsoft.json\9.0.1\lib\portable-net45+wp80+win8+wpa81.
Published my solution at Xamarin forums quite a while ago and some people say this worked for them as well.

Using C++11 features in Oculus Mobile SDK samples

I want to use std::shared_ptr in the Oculus Mobile SDK Sample code. It won't compile. The error message is: 'shared_ptr' is not a member of 'std'.
I'm using:
Oculus Mobile SDK 0.6.0.1
Android NDK r9d
Eclipse 4.2.1
I confirmed that NDK_TOOLCHAIN_VERSION is set to 4.8 in Application.mk (in the root directory ovr_mobile_sdk_0.6.0.1). I tried setting the cpp flags to C++11 values in every Android.mk and Application.mk I can find. I tried using Clang instead of GCC. I made sure the relevant include paths are added and tried adding others. I even tried the latest NDK r10e.
Unfortunately, none of this works. How can I use std::shared_ptr in the Oculus Mobile SDK sample code?

Typescript compiling options to support vendor libraries

Issue: In a freshly generated MVC 5 web project I have the option to set Typescript's compile option to none, RequireJS, or CommonJS. This is a site-wide compile option.
In a particular view, I need to work with esri's javascript api. This api encapsulates both RequireJS and Dojo, and if I choose RequireJS as the typescript compile option, everything works fine.
If I want to use typescript anywhere else in the site I have one of two problems: either the JavaScript emitted is in RequireJS format (no RequireJS is loaded outside of the one view) or if I load RequireJS into the project, I get conflicts with the esri library.
For more background see my Blog Post
Question: Is it possible to specify individual page(s) compile using different options for JavaScript emission within Visual Studio?
One option is to break your solution into multiple projects. In one project you can configure typescript to use AMD modules.
A second option would be to turn off the compiling of typescript at build time by Visual Studio and set up a gulp or grunt task to compile your typescript. This way you can choose to compile one set of files with AMD modules and another without AMD and not have to break your solution into multiple projects.

Native dll module is incompatible with this version of Firefox

I've created an XPCOM DLL in CPP using Gecko/XULRunner v12 (which works on v12), but when I run it with v13, or v14 of firefox I get the following error:
-Native module at path '...\PowerFoxDll.dll' is incompatible with this version of Firefox, has version 12, expected 14
is it possible that the XPCOM DLL XULRunner SDK is not backward compatible???
Is there a way to solve it?
I'm looking for a solution that will not require re-compiling the code for each new version.
Unfortunately, you are right. There is no backward (and forward too) compatibility between native XPCOM plugin and browser. You have to compile code for each new version of Firefox with accordingly version of XULRunner SDK. Thus, if you want to have an up to date solution you have to update you source code every six week.
There is only one way to make stable working solution - using JavaScript. Google 'js-ctypes' - this is solution allows to use code from native dll into Firefox JavaScript extensions directly.

Resources