-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fixed temporary #27 (Fixed the way to read basic.c to be used as a library.) #31
Conversation
Thank you, @muramasa8191, @olafura and @josevalim. |
… to the older stub code
In this approach, I found that we will meet another future issue that the stub code and the native library conflicts each other when some libraries uses Pelemay at the same time... To solve it, we should name the stub code and the native library after an independent name. |
…h other when some libraries uses Pelemay at the same time
Oh, It doesn't work yet... |
lib/pelemay.ex
Outdated
@@ -40,7 +40,7 @@ defmodule Pelemay do | |||
Db.init() | |||
|
|||
functions | |||
|> SumMag.map(&Optimizer.replace_expr(&1)) | |||
|> SumMag.map(&Optimizer.replace_expr(&1, ("Elixir.PelemayNif" <> (__MODULE__ |> Generator.module_replaced_non())) |> String.to_atom())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative expression instead of __MODULE__
that expresses a caller module of the macro is better.
I can't find this expression.
At last, It works!!! However, it may have another issue that may be caused by this: |
I replaced It works well!!! Huu! |
Unn, it doesn't work well when Pelemay is installed from git branch... |
I found the reason why it doesn't work well. When Pelemay is installed from git or another local path, If Thus, installing by hex requires modification |
I'd like to run
|
@ConnorRigby said in the Elixir-lang Slack:
|
@ConnorRigby Thank you for your comment! I tried it and I confirmed it works well in the case that Pelemay is alone, The test project setting is as follows: defmodule Test.MixProject do
use Mix.Project
def project do
[
app: :test,
version: "0.1.0",
elixir: "~> 1.9",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:pelemay, path: "../pelemay"},
# {:dep_from_hexpm, "~> 0.3.0"},
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
]
end
end
When running
One of this reason is not to build with |
@ConnorRigby I guess it will be solved I create I can't find how to invoke |
@ConnorRigby said:
|
Thank you @ConnorRigby I understand that the approach 3 is to invoke elixir_make by Pelemay itself. @ConnorRigby said:
I'd like to choose 1 or 3. |
Ah, I got it! @ConnorRigby |
Apply @josevalim advice "use
Application.app_dir/2
".This is a just temporary PR. The following error remains:
This indicates the old and the generated PelamayNif modules are inconsistent.