Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
orchestrator-core
Advanced tools
Currently, all the build is performed through node-gyp. Gyp generates Visual Studio 2017 project files on the fly, and there currently is nothing checked into the oc.sln
file.
TODO: add a ceremonial/sacrificial C++ project to the
oc
solution to facilitate debugging. It won't be the actual project file used to generate the package!
# Go to node directory.
cd \src\TScience\Orchestrator\oc\oc_node_authoring
# Build debug
npm install . # Note period
(or npm install -g .) # Global
oc.sln
as Release
.# Set up environment for 64-bit native
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
# Build the solution as Release | x64
MsBuild.exe D:\src\TScience\Orchestrator\oc\oc.sln /t:Build /p:Configuration=Release /p:Platform=x64
# Go to node directory.
cd \src\TScience\Orchestrator\oc\oc_node_authoring
# Set up visual studio for node-gyp
npm config set msvs_version 2019
# Build debug
npm run rebuild:dev
rebuild:dev
command is doing by looking at package.json
binding.gyp
file.# Go to node directory.
cd \src\TScience\Orchestrator\oc\oc_node_authoring
# Run tests
npm run test
There are tests and a sample. Most likely you will be debugging one of these. To debug, you can use Visual Studio or Vscode.
To Debug C++ code in oc_node_authoring, I had to perform the following.
Node-pre-gyp is responsible for the process of pulling down the "tarball" (.tgz) file and unarchiving and placing the binaries. This process is a direct stand-in for the "normal" path (node-gyp) of building the binaries on your machine when you perform "npm install" - it's just placing the binaries in the spot that the build process would normally copy the output. To that end, if you use something like "Visual Studio" or other platform tools, the output directory is something like "./build/Debug" or "./build/Release".
Currently, in the build process, we truncate the build output directory so the user experience (ie, node.js code) can load the library without directory structure. For example:
const oc = require('orchestrator-core.node') <= "Good"
vs.
const oc = require('./build/Release/orchestrator-core.node') <= "Bad"
However, truncating the build output to the local directory (for some reason) causes havoc when attempting to debug on Windows with Visual Studio/Visual Studio Code.
To debug C++ code, try the following:
package.json
"binary": {
"module_name": "orchestrator-core",
"module_path": "./build/Debug",
"host": "https://bfsmodelsscratch.azureedge.net/native"
},
binding.gyp
# "target_defaults": {
# "msvs_configuration_attributes": {
# "OutputDirectory": ""
# }
# },
oc_app.js
const oc = require('./build/Debug/orchestrator-core.node');
Rebuild (See below for more details):
npm run rebuild:dev
This shifts the build to ./build/Debug
and enables you to debug C++ code.
Here's an example configuring Visual Studio using the sample.
oc_abi
but you can set breakpoints in code in the node.js interop layer.Similarly, you can configure for tests - see the configuration for Visual Studio Code below.
In launch.json
(Click Shift-Ctrl-D and click on the gear symbol), you can add something like the following (fixing the paths).
Note: This sets up the C++ debugger (cppvsdbg).
{
"type": "cppvsdbg",
"request": "launch",
"name": "Launch nodejs app via NPM",
"program": "C:\\Program Files\\nodejs\\node.exe",
"args": [
"oc_app.js"
],
"cwd": "d:\\src\\TScience\\Orchestrator\\oc\\oc_node_authoring"
},
{
"type": "cppvsdbg",
"request": "launch",
"name": "Launch MOCHA test via NPM",
"program": "C:\\Program Files\\nodejs\\node.exe",
"stopAtEntry": false,
"args": [
".\\node_modules\\mocha\\bin\\mocha",
"tests/",
// "-g",
// "Remove"
],
"cwd": "d:\\src\\TScience\\Orchestrator\\oc\\oc_node_authoring",
"externalConsole": false
},
Note: -g
in the MOCHA test stands for grep. You can filter specific tests. For example: "Remove"
it('Remove example.', async function () {
// Arrange
var orc = new oc.Orchestrator();
FAQs
Orchestrator for Node.js
The npm package orchestrator-core receives a total of 47 weekly downloads. As such, orchestrator-core popularity was classified as not popular.
We found that orchestrator-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.