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

Unable to compile gleam_otp in a Phoenix app #21

Closed
MattCheely opened this issue Dec 31, 2020 · 3 comments
Closed

Unable to compile gleam_otp in a Phoenix app #21

MattCheely opened this issue Dec 31, 2020 · 3 comments

Comments

@MattCheely
Copy link

When incorporating gleam_otp into a Phoenix application, the library fails to compile. This isn't a big deal for me, as I have a workaround for now, and it's for a personal side project that currently only runs on my dev machine.

Compile output

➜ mix compile
===> Rebar3 detected a lock file from a newer version. It will be loaded in compatibility mode, but important information may be missing or lost. It is recommended to upgrade Rebar3.
===> Compiling gleam_otp
===> Compiling src/gleam_otp_external.erl failed
src/gleam_otp_external.erl:14: can't find include file "gen/src/gleam@otp@process_Sender.hrl"
src/gleam_otp_external.erl:15: can't find include file "gen/src/gleam@otp@process_Exit.hrl"
src/gleam_otp_external.erl:16: can't find include file "gen/src/gleam@otp@process_PortDown.hrl"
src/gleam_otp_external.erl:17: can't find include file "gen/src/gleam@otp@process_ProcessDown.hrl"
src/gleam_otp_external.erl:18: can't find include file "gen/src/gleam@otp@process_StatusInfo.hrl"

src/gleam_otp_external.erl:119: record process_down undefined
src/gleam_otp_external.erl:122: record port_down undefined
src/gleam_otp_external.erl:125: record exit undefined
src/gleam_otp_external.erl:194: record sender undefined
src/gleam_otp_external.erl:207: record status_info undefined
src/gleam_otp_external.erl:210: variable 'Debug' is unbound
src/gleam_otp_external.erl:210: variable 'Mode' is unbound
src/gleam_otp_external.erl:210: variable 'Parent' is unbound
src/gleam_otp_external.erl:212: variable 'Mode' is unbound
src/gleam_otp_external.erl:212: variable 'Parent' is unbound
src/gleam_otp_external.erl:212: variable 'State' is unbound
src/gleam_otp_external.erl:214: variable 'Mod' is unbound

src/gleam_otp_external.erl:118: Warning: variable 'Pid' is unused
src/gleam_otp_external.erl:118: Warning: variable 'Reason' is unused
src/gleam_otp_external.erl:121: Warning: variable 'Port' is unused
src/gleam_otp_external.erl:121: Warning: variable 'Reason' is unused
src/gleam_otp_external.erl:124: Warning: variable 'Pid' is unused
src/gleam_otp_external.erl:124: Warning: variable 'Reason' is unused
src/gleam_otp_external.erl:192: Warning: variable 'Pid' is unused
src/gleam_otp_external.erl:193: Warning: variable 'Prepare' is unused

** (Mix) Could not compile dependency :gleam_otp, "/home/matt/.mix/rebar3 bare compile --paths /home/matt/projects/beam_ci/_build/dev/lib/*/ebin" command failed. You can recompile this dependency with "mix deps.compile gleam_otp", update it with "mix deps.update gleam_otp" or clean it with "mix deps.clean gleam_otp"

Other Notes

This happens when building with both gleam_compile and mix_gleam

Workaround

I've worked around this by copying gleam.toml from my local checkout of gleam_otp into the deps/gleam_otp folder and running rebar3 compile there. Once it's compile once, everything works.

@lpil
Copy link
Member

lpil commented Jan 1, 2021

It seems that header files are handled differently with mix than with rebar3. The build stuff is currently being rewritten so this should be fixed soon.

@jeffkreeftmeijer
Copy link

jeffkreeftmeijer commented Jan 7, 2021

This also happens for me when running rebar3 compile in the test_project in https://github.com/jeffkreeftmeijer/shine, which is not an Elixir project. It’s resolved if I remove shine from the project_plugins in https://github.com/jeffkreeftmeijer/shine/blob/main/test_project/rebar.config#L8.

The workaround worked for me when I copied gleam.toml into test_project/_build/default/plugins/gleam_otp/ and then ran rebar3 compile, so I’m not blocked on this either. Thanks for mentioning that! 👍

jeffkreeftmeijer added a commit to jeffkreeftmeijer/shine that referenced this issue Jan 22, 2021
jeffkreeftmeijer added a commit to jeffkreeftmeijer/shine that referenced this issue Jan 22, 2021
jeffkreeftmeijer added a commit to jeffkreeftmeijer/shine that referenced this issue Jan 23, 2021
@lpil
Copy link
Member

lpil commented Jan 12, 2022

As we've remake the Mix plugin I'm going to close this as being outdated. If you have further issues please open a new ticket, thank you

@lpil lpil closed this as completed Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants