MacOS VulkanInfo Reports 0 Validation Layers - macos

I am getting started with Vulkan (vulkansdk-macos-1.1.126.0) on macOS (10.14.6), and have followed a tutorial in setting up an instance which all seems to go well however when I call vkEnumerateInstanceLayerProperties I get a returned layer count of 0.
At first I thought it could be my build arguments/variables, however when I run the vulkanInfo application supplied with the tar.gz it also reports there that there are no layers (Layers: count = 0). I then tried to add environment variables:
PATH=$PATH:$VULKAN_ROOT/bin
export VK_LAYER_PATH=$VULKAN_ROOT/etc/vulkan/explicit_layers.d
export VK_ICD_FILENAMES=$VULKAN_ROOT/etc/vulkan/icd.d/MoltenVK_icd.json
export VK_LAYER_PATH=$VULKAN_ROOT/etc/vulkan/explicit_layers.d
export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation vulkaninfo
#export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation vulkaninfo
and launch vulkanInfo from the terminal. Maybe it is a Mac trying to be too secure issue or has something to do with file permissions. Any suggestions are appreciated since this will seriously hamper debugging.

So as you'd expect I was doing something wrong, just doing 2 different things wrong:
- for launching vulkanInfo from the terminal, you can see that I wasn't exporting the PATH variable.
- for VSCode (where I am building the application) I had the VK_ICD_FILENAMES and VK_LAYER_PATH as preprocessor definitions, not as launch environment variables (set in the launch.json, environment name/value map).

Related

Bash variable of name starting with 'DYLD' is not loaded into environment: bug or feature?

On MacOs, try the following:
export AYLD_VARIABLE=Aa
export BYLD_VARIABLE=Bb
export CYLD_VARIABLE=Cc
export DYLD_VARIABLE=Dd
export EYLD_VARIABLE=Ee
export FYLD_VARIABLE=Ff
env | grep VARIABLE
The variable DYLD_VARIABLE is not displayed among others. It can not be exported.
However, it may be set and used:
DYLD_VARIABLE=DdDd
echo $DYLD_VARIABLE
It is just not present in env.
I know, MacOs uses the acronym 'DYLD' while speaking on some internal files. But this prefix should not be discriminated.
It is not just an academic issue. I failed to do
export DYLD_LIBRARY_PATH=/Users/username/Downloads/instantclient_19_8
which is probably required to install DBD::Oracle for Perl.
How to set it up ?
This is a feature of the hardened runtime environment. Several DYLD_* variables can be used to inject malicious libraries into trusted binaries, so those variables are removed when a binary that uses the hardened runtime environment loads (unless it has the com.apple.security.cs.allow-dyld-environment-variables or com.apple.security.get-task-allow entitlement).
I'm not familiar with how DBD::Oracle is set up, but if it depends on setting DYLD_* variables, it seriously needs to be rewritten to avoid that.
For more info, see Apple's developer documentation on the hardened runtime, and the WWDC19 presentation "All About Notarization" (starting at 16:19, or page 75 of the slide deck).

Electron Windows Production Bundle Command Line Arguments

I'm building an Electron App using electron-builder on macOS.
In my code I access the command line args like this:
const cmd = electron.remote.app.commandLine;
const val = cmd.hasSwitch('myArg')
? cmd.getSwitchValue('myArg')
: undefined;
This works fine for the production build on macOS when providing the arguments:
./my-electron-app.app/Contents/MacOS/my-electron-app --myArg=foo
// or:
open my-electron-app.app --args -myArg=foo
But on Windows I can't get it working.
Here's what I tried using cmd.exe:
my-electron-app.exe --myArg=foo
my-electron-app.exe -myArg=foo
my-electron-app.exe /myArg=foo
my-electron-app.exe myArg=foo
When logging electron.remote.process.argv[1] I can see the passed arguments on macOS and Windows, but hasSwitch and getSwitchValue won't give me the value.
What am I doing wrong? Or is there a better way to get cross platform command line arguments working?
I'm gonna take a guess that this is because of the capital letters in your switch. See this closed issue:
This is intentional. The hasSwitch API is a direct wrapper of the Chromium CommandLine class, which behaves this way on purpose.
From Chromium source:
Switch names must be lowercase.
Though it's not totally clear to me yet why Mac doesn't suffer from the same problem.

How to enable debugging messages in Juno (Julia editor)

The Julia docs are pretty clear on how to enable debugging messages from #debug macros, i.e. run export JULIA_DEBUG=mymodule or export JULIA_DEBUG=all on the command line before starting Julia. However, is there an easy way to enable debugging from within the Juno, or, more generally, while Julia is running?
I tried fiddling with Base.CoreLogging.disable_logging , Base.CoreLogging.BelowMinLevel and Base.CoreLogging._min_enabled_level without success.
I know I can set env variables for Julia in the Juno settings. But that's kind of annoying to work with as it requires restarting Julia. I really want to have the following workflow while working interactively:
Enter a line in the REPL
Stumble upon a bug from your own code that you didn't see coming.
Enable debugging.
Run that line again.
See the debug logs.
Fix your code.
Disable debug logging again.
Which I think is nicer than the common practice of commenting and un-commenting printf everywhere.
Enable #debug everywhere (this will only affect code loaded after running the following expression):
julia>ENV["JULIA_DEBUG"] = "all"
Enable #debug in file foo.jl (according to docs, haven't tested this):
julia>ENV["JULIA_DEBUG"] = "foo"
Disable #debug:
ENV["JULIA_DEBUG"] = ""
important note: macros are evaluated when code is loaded. So the tricks above will only have effect on code that is loaded after changing the value of JULIA_DEBUG. So after setting it to e.g. all, nothing will have changed. Reload the modules you want to #debug.
To enable #debug messages logging in your julia script:
# ... script ...
ENV["JULIA_DEBUG"]="all"
# debug messages are now enabled.
# ... Rest of the script...
The addition of ENV["JULIA_DEBUG"]="all" will enable #debug messages when running the script in Juno or running it with Julia from your terminal.

setting .zshrc for arq jena

I'm trying to set my .zshrc file to export ARQROOT for ARQ (jena) on a mac (mavericks), similar to what is shown on http://jena.sourceforge.net/ARQ/Tutorial/query1.html for windows and linux
tried all sorts of combinations with paths, quotes and syntax but none seems to work. Any thoughts on what the mac/zsh equivalent to export ARQROOT=$HOME/MyProjects/ARQ would be?
many thanks
ARQROOT isn't needed nowadays.
The scripts (in apache-jena-VERSION/bin or /bat) set paths themselves.
The Jena project is now at http://jena.apache.org/ (how did you get to the sourceforge page? It's supposed to redirect).

Path Error running CakePHP's "cake" console utility in Windows

A while ago when I started with Cake, I managed to get the console running in my Windows environment, and I have no idea how. I'm now having problems to make it work again in another computer.
This is what I've done in the new machine:
Downloaded my Cake code from source control (so all the files are exactly the same as the computer where it worked, including the configuration files)
Added PHP and "c:\my_cake_path\cake\console" to the path
If I run "cake OneOfMyShells", either standing on the /app, or in /cake/console directories, I get the following error:
Warning: get_object_vars() expects parameter 1 to be object, null given in C:\my_cake_path\cake\libs\model\connection_manager.php on line 199
Error: Missing Database Connection. Try 'cake bake'
"cake Bake", if run normally, when I try to get it to do the DB config ends up throwing another error (which is not that relevant to this)
However, if I run: cake bake -app "c:\my_cake_path\app"
Then bake works, I can do the database config, and it writes the DB config file (which is useless at this point, since I already had one)
Then, of course: cake OneOfMyShells -app "c:\my_cake_path\app"
does work perfectly well.
So, everything's working fine, I just need to manually specify the path to "app" every single time, which is very annoying.
How can I get around this? Where is Cake looking for to find the path to app?
Thanks!
Daniel
Not much of a difference in the sense you still need to type but you can run cake from the app dir like this: C:\XXX\project\app> ..\cake\console\cake.bat
To make it smaller you can put that line on a .bat or just add the \cake\console dir the windows path

Resources