Hey all! Wondering if there is anyone using devbox? Im trying to run a phoenix app but Im getting
[error] Can't find executable `mac_listener`
[warning] Could not start Phoenix live-reload because we cannot listen to the file system.
You don't need to worry! This is an optional feature used during development to
refresh your browser when you save files and it does not affect production.
my devbox.json content is:
{
"packages": [
"erlang_26@26.1.2",
"elixir_1_15@1.15.7",
"nodejs@18.18.2"
],
"shell": {
"init_hook": ["echo 'Welcome to devbox!' > /dev/null"],
"scripts": {
"test": ["echo \"Error: no test specified\" && exit 1"]
}
}
}
I tried adding these packages, but the result is the same:
When I compile the file_system package, Im getting:
❯ mix deps.compile file_system
08:44:09.841 [info] Compiling file system watcher for Mac...
==> file_system
In file included from c_src/mac/cli.c:2:
In file included from c_src/mac/cli.h:4:
c_src/mac/common.h:5:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from c_src/mac/compat.c:1:
c_src/mac/compat.h:16:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from c_src/mac/main.c:1:
c_src/mac/common.h:5:10: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
08:44:10.788 [error] Could not compile file system watcher for Mac, try to run "clang -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations c_src/mac/*.c -o priv/mac_listener" manually inside the dependency.
Brief editorializing: I don’t know or endorse Devbox, and I think most people should side-eye any Nix abstraction that doesn’t have you still writing in Nix syntax because at some point or another you’ll want to use or write a Nix expression that i.e. JSON, YAML, or TOML simply can’t express. If you are early on your Nix journey, I would recommend not using a framework at all yet.
A flake with flake-parts for brevity ( on flake-utils-plus) would look something like:
So at a glance you’re providing the correct nixpkgs attribute name for the compile-time dependency (darwin.apple_sdk.frameworks.CoreServices) and most likely it’s a Devbox-specific thing for why that’s either not recognized properly or not made available in the same way a standard devShell does.