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

Support setting MIX_TARGET #299

Merged
merged 1 commit into from
Jun 21, 2020
Merged

Conversation

jjcarstens
Copy link
Contributor

Resolves #248

This allows you to set MIX_TARGET in a config and have it used in Elixir versions >= 1.8

This is most often used with Nerves and removes a lot of compilation errors in repos relying on a target to be set

I used this little target_test to test and everything seemed to work as expected (built for the target and errors/warnings went away 🙌 )

For elixir-lsp#248

This allows you to set MIX_TARGET in a config and have it used in Elixir versions >= 1.8

This is most often used with Nerves and removes a lot of compilation errors in repos
relying on a target to be set
jjcarstens added a commit to jjcarstens/vscode-elixir-ls that referenced this pull request Jun 17, 2020
if function_exported?(Mix, :target, 0) do
# Even though we know we have the function here,
# Compilation will fail calling Mix.target/0 directly
# since Elixir 1.7 is used to compile - So we get around
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's time we dropped support for 1.7

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was brought up in the original issue, but ultimately decided that things weren't ready to drop the minimum to away from 1.8 - But I'm definitely open to suggestions about making this workaround look better if desired?

Copy link
Member

@axelson axelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! When we drop support for 1.7 we can cleanup the code, but the version checks as-is look good to me. ❤️

@axelson axelson merged commit 891922f into elixir-lsp:master Jun 21, 2020
@jjcarstens jjcarstens deleted the mix-target branch July 24, 2020 19:54
@axelson axelson mentioned this pull request Aug 4, 2020
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

Successfully merging this pull request may close these issues.

Support MIX_TARGET?
3 participants