Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple elixir plugin #2462

Merged
merged 3 commits into from
Jan 3, 2025
Merged

Add simple elixir plugin #2462

merged 3 commits into from
Jan 3, 2025

Conversation

clessg
Copy link
Contributor

@clessg clessg commented Dec 20, 2024

Summary

Adds a very basic elixir plugin to simplify installation to a simple devbox add elixir. Also now properly stores Mix/Hex artifacts in .devbox/virtenv.

How was it tested?

  • Tested it against the existing elixir example in the repo. Seems to work fine.
  • Tested on my own projects as well, separately on Mac + Ubuntu.

@Lagoja
Copy link
Contributor

Lagoja commented Jan 2, 2025

Hey @clessg, this PR looks really helpful!

Just wondering -- why does the plugin install CoreServices on darwin systems? Does this fix an issue you were seeing with Elixir and Devbox?

@clessg
Copy link
Contributor Author

clessg commented Jan 2, 2025

Hey John, thanks for the response! So happy to see Devbox is alive and well, I can't live without it now :)

Anyway, yup! I should have mentioned the Darwin part. On Mac/Darwin, the Elixir package file_system (https://hexdocs.pm/file_system/readme.html) fails to install, seemingly because it requires native libraries to compile. That package is used by Phoenix (Elixir's main web framework) and a few other frameworks for live-reloading in the browser. Here is the error message produced:

(devbox) ➜  mix phx.server

18:18:14.316 [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.

18:18:14.697 [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.

Adding CoreServices seems to resolve the issue. Maybe there's another way but I haven't found it. Considering Elixir almost always goes in tandem with Phoenix (a la Ruby and Rails) or another live-reloading framework, I figured I'd throw in that fix to minimize unexpected errors on Mac.

@Lagoja
Copy link
Contributor

Lagoja commented Jan 3, 2025

Thanks for the explanation! Going to merge and will test further in the next pre-release

@Lagoja Lagoja merged commit 5fa89f8 into jetify-com:main Jan 3, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants