-
Notifications
You must be signed in to change notification settings - Fork 12
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
bug: Blight journal is empty #63
Comments
By default, compilation takes place in a docker image that does not have access to your local environment and cmake is not present. Two workarounds are:
Unfortunately, the documentation for the latter is currently lacking... |
Hi @thinkmoore, Thanks for your reply, I have modified the Makefile to install cmake, and now it is able to see cmake, but I think command mate-cli is also still not mounting the sourcr directory into the container. Now I get the error: STDERR: May I ask if you can give some hints about how to use the more detailed mate-cli workflow to specify a container to use for the build, since as you said, the link you shared doesn't have enough information about that. |
I have fixed the error of not being able to find the source directoy by mouning that directory into the container using the docker-compose.yml file by adding an entry to the executer under the volume section. Now, I am facing another issue, my project is compiling successfully, but the build command is not showing any output. I understand that the build command is building the CPG graph. However, it is not showing anything. Is it maybe because I am compiling for riscv not x86? Thanks in advance for your support. |
You might also check |
Here is the output of
When I compare that log output with the log output of the notes.c provided example, it seems that the |
Here is that assertion. |
I am still not sure how to work-around that issue, I have prepared a very simple cmake/make based project with the notes.c source file only. It seems that Mate/blight is not able to intercept the build commands so that it creates bitcode. |
@xreinheitx could you check which version of blight you're running with? It's unlikely, but this may have been a regression on my part (blight is maintained externally, and has undergone changes since MATE was last released). |
@woodruffw , I think Mate is using blight which is shipped with the container |
I wonder if the problem is that CMAKE is hardcoding a path for cc, etc. and so blight's PATH-based interposition isn't working... |
@xreinheitx you can run a shell on that specific container and then check the version using |
Hi @matteasu, Thanks for the hint, the version is 0.0.41
|
@thinkmoore, FYI, I grepped |
Thanks for checking -- that version is pretty old, which is good in this case: it's one that was known to work with MATE 🙂 Per what @thinkmoore said: this suggests something weird about the build itself, since CMake should respect |
Do you mean a mate-cli compile option?
And again here is the log that I got using
|
I believe there's a |
@woodruffw I will search for that option. @thinkmoore, I have tested Mate against an only make simple project (not a cmake-based) with one source file and a Makefile, the Makefile in this case is using $(CC) explicitly. I still see the same issue. |
@woodruffw, I am trying to figure out which option could help me to get more insights with
|
@xreinheitx try this:
that should dump one or more artifact IDs, which you can then do this work:
|
Hi @woodruffw, thanks a lot for the hint. Here is the ouput of the dump command for the artifact, I still don't see where is the problem!
|
Hmm -- that looks pretty reasonable, although I don't actually see where the final object file link step occurs: it produces |
I think I confused you because during this troubleshooting, I modified the Makefile to be very simple and to have an explicit CC. Let me list here what I had for the last output. Here is the source file Here is the current
Here is the directory content
Here is And I got compile-log using your provided instructions above.
|
@woodruffw With that, I still get 0 build completed successfully.
|
Okay, so you're intentionally not producing an executable, right? Just an object file? In that case, this doesn't work by design: MATE expects a compilation step to produce one or more executables, since the CPG build process fundamentally requires a That being said, it's strange that it fails when you do produce a full executable. My only guess is that the linker is somehow being invoked separately, in a way that blight/GLLVM can't detect. |
Hi @woodruffw, In the last example in my last message the make file I used is actually generating an executable with an entry point, it is just the name is test1.c.o, but it is an executable which has an entry point main. And still Mate is unable to build the CPG.
|
Ah, got it. Just confirming: you see the same behavior when you generate the output file as |
Interesting enought to say that when I removed .o from the executable name, it worked!
|
Thenaks @woodruffw for your time! Now we know it worked with that example make project when I removed the .o suffix. Now, when I get back to the simple Cmake-based project, as you know cmake's job is to automatically generate Makefiles that can build the targets mentioned in the CMakeLists.txt file. Now the problem is that when I checked the cmake generated Makefiles, I found that cmake is always adding .o at the end of the generated object file before finally doing the linking.
Here is how the linking is done.
I have modified the Makefiles so that it doesn't have .o suffix, and I run mate-cli again, still I got 0 builds
And here is the compile-log output.
|
No problem! Glad to see we're making progress 🙂 The |
Unfortuantly, this didn't help. Dropped .elf suffix from the final executable as followes:
And still it didn't work, here is the compile-log.
And again here is the docker container log mate-executer-1
|
Oh well. Is CMake calling |
I have replaced every BTW, I have added the suffix .o and .elf back now while having $(CC) instead of /usr/bin/cc, and it worked. But Mate wasn't really telling where exactly the issue untill we went through this process of renaming. |
Glad to hear it!
Yeah, me neither. It could be an environmental step I missed, some default or assumption that's changed, etc. We unfortunately didn't make this part of MATE super easy to debug 😅 |
Thanks for your time a lot, that was really helpful. Since it is midnight here already; I will run now, and tomorrow I will check why cmake is not generating Makefiles with $(CC). I will keep you posted here!, enjoy your rest of the day :) |
Hello,
Today, I have started to use MATE, I was able to compile and go through the notes.c example. However, I wasn't able to compile my example project that is compiled using 'make' after the Makefile generation through cmake. The Makefile is created under the build dir in the root src dir.
I have also tried to creat a tar out of the exampleProject/ dir
tar czf exampleProject.tar.gz exampleProject/
mate-cli artifact create compile-target:tarball exampleProject.tar.gz
mate-cli compile create --wait --make-targets exampleProject.elf --artifact-id 6226e34a987942589c5c9cadb089c9ea
Still, it didn't work!
Any idea what I could did wrong, thank you!
The text was updated successfully, but these errors were encountered: