Closed Odiumediae closed 5 years ago
To resolve this, rm -fr deps/picam
, run mix deps.get
and rebuild. There's might be a better way, but the goal is to clean out the picam
dependency's source directory.
The issue is that picam
compiles its C source code to deps/picam
instead of _build
. At some point, you changed the Nerves system that you were using - maybe switching between one Raspberry Pi to a different one or upgrading the Nerves system. Since the C code is not compiled to _build
, elixir_make
doesn't know to rebuild it. The code in question might work on the Raspberry Pi Zero without being rebuilt, but it's not guaranteed and debugging that problem is hard. Nerves detects this and raises the error that you saw.
The right fix for this is for picam
to update its Makefile
and mix.exs
to build to the _build
directory. @GregMefford - check out Elixir Circuits or nerves_runtime
for examples.
Thanks @fhunleth! I’ll work on a fix for that, probably tonight. :thumbsup:
Thanks for you help, @fhunleth!
Unfortunately, this workaround does not work for me. I was positive that I had tried this already, but I tried it again for good measure. First, I made sure I had the bare project, as if freshly cloned from a repo:
rm -rf _build deps mix.lock
Then:
export MIX_TARGET=rpi0
mix do deps.get, firmware
Followed by the same error as quoted above (of course).
Then:
rm -rf deps/picam
mix do deps.get, firmware
But then I get the same error again. I suppose, I'm still doing something wrong.
I tried everything, but I cannot get it to work, probably because I don't have any experience with C and makefiles.
When I use {:picam, "~> 0.3.0"}
, though, the Nerves project builds and the image gets burned on the SD-card without any problems.
I'd have liked to fix this bug myself, but unfortunately I really don't get it, sorry. I'll try the latest version again after you've patched it. Thanks in advance!
Wow, I reproduced the problem. I think that you did everything right. There's another issue. I'm totally tied up with family this week, so I won't be looking into it soon, but I'm curious as to what causing the issue now.
Yeah I got the Makefile
updated but ended up seeing the same error, so working on digging into what the cause is (but likely won't solve it tonight).
I'll have another try at fixing it (or at least finding probable causes) myself, tonight. Anyway, thank you both!
New developments:
gcc
command that is output during the build, I get the correct file type, which makes very little sense to me.github
dep instead of a path
dep, everything works.I am suspecting that it's something related to https://github.com/elixir-lang/elixir_make/pull/32 since Picam is still using a priv
directory, so I'm going to try reworking that to match @fhunleth's comments in that issue thread and see if that solves the problem when building from a path
dep.
Yep, the path dep works after I did some more re-work to eliminate the priv
directory in Picam, and only copy things into the _build
directory instead. See #44 if you're curious.
Until that gets merged and released, feel free to try building your project using the following as a picam
dependency and let me know if that works for you! 🚀
{:picam, github: "elixir-vision/picam", branch: "build_outside_deps"}
@JesterPrince I was planning to merge that PR and make an updated release, but wanted to check and see if you'd had a chance to try this branch and if it solved the problem for you.
Version 0.4.1
has been released, which will hopefully solve the issue you were running into. I'd love to hear back whether or not it works for you. 🚀
I'm trying to build firmware with Nerves and Picam, but so far I haven't been able to, due to an error that I cannot quite understand.
I'm trying to build formware for a "Raspberry Pi Zero W", which should be supported, at least that's what's the README.md seems to say.
It's definitely an error related to Picam, because the firmware builds when I don't use Picam. The source is literally just a default Nerves project with
{:picam, "~> 0.4.0"}
added to themix.exs
.I also checked the 4 suggestions, and I'm sure none of them are the reason for the problem.
Is this a bug, am I doing something blatantly wrong or am I just being an idiot? Any Help would be appreciated.