-
Notifications
You must be signed in to change notification settings - Fork 21
fix path problems which lead to new projects not running #26
Conversation
Makefile
Outdated
@@ -49,4 +51,4 @@ priv/$(MIX_ENV)/scenic_driver_glfw: $(SRCS) | |||
clean: | |||
$(RM) -r priv/dev |
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.
Why you are not changing priv
with ${RPEFIX}
in clean
target? Also why instead of using ${MIX_ENV}
we have remove call for every environment? Also what if we have a custom ${MIX_ENV}
? From what I can see it would be not cleaned properly …
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.
Thank you. I hadn't even thought of doing that. Changed committed.
Are you able to get |
Also... I really appreciate the help with this! |
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.
Personally I would change all tabulations to 2 spaces and store scenic_driver_glfw
under PROJECT_NAME
variable, but it's not something as important as making it working. I have tested it and it works for me as well, so for me it could be approved.
@boydm Just tried it and |
Randomized with seed 320809 |
@boydm Of course except parent directory and compilation flags (I have no MacOS) all paths are exactly same. After $ mix test
mkdir -p /home/eiji/scenic_driver_glfw/_build/test/lib/scenic_driver_glfw/ebin/../priv/test
cc -O3 -std=c99 `pkg-config --static --cflags glfw3 glew` -fPIC -o /home/eiji/scenic_driver_glfw/_build/test/lib/scenic_driver_glfw/ebin/../priv/test/scenic_driver_glfw c_src/main.c c_src/comms.c c_src/nanovg/nanovg.c c_src/utils.c c_src/render_script.c c_src/tx.c `pkg-config --static --libs glfw3 glew` -lGL -lm -lrt
.
Finished in 3.8 seconds
1 test, 0 failures
Randomized with seed 681971 |
@boydm Interesting, I'm only able to get that error intermittently, but only on the master branch so far (instead of this PR), not sure how to reproduce it. I've been able to get the error on both Mac OS and Linux. What version of Elixir and Erlang are you using? I've tested with Elixir 1.8.1-otp-21 (w Erlang 21.2.4) and Elixir 1.9.1-otp-22 (w Erlang 22.0.7). |
@axelson I'll update to 1.9.1 and see what happens... |
Same with 1.9.1. |
Hmm … I have tried different $ asdf current
elixir 1.9.1-otp-22 (set by …)
erlang 22.0.7 (set by …)
… I still can't reproduce this problem. @axelson said that he got error also on Am I doing something wrong? |
I'm only able to reproduce the error on master with The only thing I can think of is if Boyd's @boydm do you still have errors if you The other weird thing I've noticed is that if I |
@axelson Sorry I'm just lost or did something amazing accidentally 😄 Your example: rm -rf _build; rm -rf priv; git checkout priv; mix test gives me exactly same results i.e. tests works. To make sure I have tried few times.
Sorry, I did not get this, because: # master
$ git clone https://github.com/ejc123/scenic_driver_glfw.git
$ mix deps.get
$ mix test
cc -O3 -std=c99 `pkg-config --static --cflags glfw3 glew` -fPIC -o /home/eiji/scenic_driver_glfw/_build/test/lib/scenic_driver_glfw/ebin/../priv/test/scenic_driver_glfw c_src/main.c c_src/comms.c c_src/nanovg/nanovg.c c_src/utils.c c_src/render_script.c c_src/tx.c `pkg-config --static --libs glfw3 glew` -lGL -lm -lrt
# priv
$ rm -rf _build; rm -rf priv; git checkout priv; mix test
cc -O3 -std=c99 `pkg-config --static --cflags glfw3 glew` -fPIC -o /home/eiji/scenic_driver_glfw/_build/test/lib/scenic_driver_glfw/ebin/../priv/test/scenic_driver_glfw c_src/main.c c_src/comms.c c_src/nanovg/nanovg.c c_src/utils.c c_src/render_script.c c_src/tx.c `pkg-config --static --libs glfw3 glew` -lGL -lm -lrt As you can see on both branches |
Sorry, by |
@axelson ok, got it! Sorry, I though that we are talking about this PR only which points to your repository 😄 On "master" I have now: mkdir -p priv/test
cc -O3 -std=c99 `pkg-config --static --cflags glfw3 glew` -fPIC -o priv/test/scenic_driver_glfw c_src/main.c c_src/comms.c c_src/nanovg/nanovg.c c_src/utils.c c_src/render_script.c c_src/tx.c `pkg-config --static --libs glfw3 glew` -lGL -lm -lrt
Compiling 7 files (.ex)
Generated scenic_driver_glfw app
# from Polish: no such file or directory
sh: /home/eiji/scenic_driver_glfw/_build/test/lib/scenic_driver_glfw/priv/test/scenic_driver_glfw: Nie ma takiego pliku ani katalogu
# + of course failed test |
Looks like same goes to mkdir -p priv/test
cc -O3 -std=c99 `pkg-config --static --cflags glfw3 glew` -fPIC -o priv/test/scenic_driver_glfw c_src/main.c c_src/comms.c c_src/nanovg/nanovg.c c_src/utils.c c_src/render_script.c c_src/tx.c `pkg-config --static --libs glfw3 glew` -lGL -lm -lrt
Compiling 7 files (.ex)
Generated scenic_driver_glfw app
# again from Polish: no such file or directory
sh: /home/eiji/scenic_driver_glfw/_build/test/lib/scenic_driver_glfw/priv/test/scenic_driver_glfw: Nie ma takiego pliku ani katalogu
# again + of course failed test |
@axelson I think that I found problem, but I'm not sure … In my opinion we have 2 problems:
In 1st case we have compiled
In 2nd point we have a similar case i.e. binary is created properly without any problem, but not copied by $ make clean
rm -f -r priv/dev
rm -f -r priv/test
rm -f -r priv/prod
$ mix test
mkdir -p priv/test
cc -O3 -std=c99 `pkg-config --static --cflags glfw3 glew` -fPIC -o priv/test/scenic_driver_glfw c_src/main.c c_src/comms.c c_src/nanovg/nanovg.c c_src/utils.c c_src/render_script.c c_src/tx.c `pkg-config --static --libs glfw3 glew` -lGL -lm -lrt
# again from Polish: no such file or directory
sh: /home/eiji/scenic_driver_glfw/_build/test/lib/scenic_driver_glfw/priv/test/scenic_driver_glfw: Nie ma takiego pliku ani katalogu When we do only WRONG: Maybe EDIT: I found it! The real problem is that we already have CONFIRMED: Just navigate to # clone repo or clean existing:
$ make clean # removes our binary in priv directory
$ rm -fr _build # removes build directory
# now we have a clean project
$ mix test # now works! |
Please make sure to bump elixifr_make requirement in mix.exs. |
Thank you @josevalim! @ejc123 please add that update to the mix.exs file and lets get this into a release. Thank you all! |
@@ -1,6 +1,8 @@ | |||
\MIX = mix | |||
CFLAGS = -O3 -std=c99 | |||
|
|||
PREFIX=$(MIX_COMPILE_PATH)/../priv |
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.
PREFIX=$(MIX_COMPILE_PATH)/../priv | |
PREFIX=$(MIX_APP_PATH)/priv |
Ah, so the issue was that boyd and I were not running the same version of elixir_make. Would it make sense to commit the |
@axelson I was just thinking the same thing |
Too tired to get this in tonight. Don't want to make mistakes. Tomorrow... |
Add a mix.lock file with the latest version of depenedencies. Tests run fine with these for me and they all match `mix.exs`. Will help bugs arising from contributors using different versions of dependencies. Similar to what happened in: ScenicFramework#26
Also for future reference, I believe this is the PR that we needed to bring in from elixir_make: elixir-lang/elixir_make#32 Also should this PR remove |
Includes the latest versions of all direct dependencies > You will notice that when you add a dependency to your project, Mix > generates a mix.lock file that guarantees repeatable builds. The lock > file must be checked in to your version control system, to guarantee > that everyone who uses the project will use the same dependency versions > as you. Source: https://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-projects.html Also will help avoid problems like the issues we had testing ScenicFramework/scenic_driver_glfw#26 in the future.
@axelson Yes, I think so - it's how José see |
Hey all. This is now in master. I added Jose's suggestion and make sure the dep on elixir_make is 0.6. If I could get some confirmations that master works for you on the various systems you use, that would be great. I'll publish an update some time after that. |
@boydm I just tested it:
My environment: $ asdf current
elixir 1.9.1-otp-22 (set by …)
erlang 22.0.7 (set by …)
… Funtoo Linux current x86-64bit on intel64-ivybridge |
@boydm okay, tested scenic.new and my scenic_asteroids repositories with the master branch of |
This is now published in v0.10.1 to hex |
This is a potential fix for #25 and a similar bug in scenic. I have tested it with a fresh project generated from mix scenic.new.example as well as mix scenic.new and it works with both MIX_ENV=prod or MIX_ENV=dev, first time and further times.