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
semgrep not getting detected #1
Comments
@gand3lf I dont know if you saw the above comment but i am having the same issue |
Hi @R34LUS3R and @gbiagomba, thank you for letting me know about this issue. Unfortunatelly, I don't have a macbook available, for this reason this fix requires a little bit more time. In any case, I will try to fix it very soon. |
@gand3lf do you need help with fixing the code? If you'd like we can schedule some time and look it over together. On another note, I looked at the code and i find the section of code where the err occurs
|
For line 30, would it make more sense to use
|
Semgrepper.zip Please let me know if your solution works. In that case, I will accept your pull request. |
@gand3lf thank you! & fingers crossed! In the meantime, if you have the jar, could you send it to me so I can test it? I know github actions had a successful biuld, I just dont know how to retrieve that build file haha |
@gbiagomba You can download the build here: https://github.com/gand3lf/semgrepper/files/10900441/Semgrepper.zip I have prepared also a version for debugging the issue, can you try this one on your Mac and post the exception message? |
@gand3lf while import there is still no error with your debug build though the extension tab shows this on the same mac
|
@R34LUS3R with this debug version you can print the environment variables in use by the target code: Could you provide me your PATH variable value? Thx |
|
@R34LUS3R ok, I think that executing this command you will solve the problem: Can you launch it and try the original Semgrepper extension please? |
@gand3lf is the version you shared of semgrepper have my "fix" or suggestion in it? If yes, this is the err I got |
So doing research on it, it seems it doesnt know where the file or program is, I am going to do more digging to see if there is a way to work around that. |
@R34LUS3R Try doing |
@gbiagomba in the SS shared in my last comment, when it didn't work with path cc: @gand3lf |
Ohhh Okay, thank you @R34LUS3R , I skimmed over your comment, i should have read it more thoroughly. At least this helps me with my hutch, it seems java doesnt know where to find the executable. There are a couple options we can explore here @gand3lf A. We can add a conditional which checks what OS the user is running and set the variable to call semgrep full path based on the OS. (e.g., NIX == /usr/local/bin/semgrep || Windows == "Program Files\Semgrep\Semgrep") or something like that. I have a work project I need to finish today, tomorrow I should (fingers crossed) have some free cycles to do R&D, I will look into other fixes and see what works. Obviously if either one of you and anyone else reading this finds a fix let us know. Lastly, I am open to having a live cross collab, if you are all free tomorrow for an hour or two. I am on the east cost BTW and my calendar is here. |
@R34LUS3R if memory serves me rgiht, MacOSX does NOT like user controlled binaries placed in |
Thanks for your help @gbiagomba and @R34LUS3R! It contains the following changes:
Please let me know |
@gand3lf still didn't work The fixed version you shared still not able to detect semgrepper on either of these paths :-/ |
@R34LUS3R ok T_T And with this debug version you can print the exception message: Could you give me the result of these two versions? |
env variables:
Message: |
@R34LUS3R That's really strange... Essentially in this temporary version I have substitute all occurrences of "semgrep" with "/opt/homebrew/bin/semgrep" |
@gand3lf this one worked! though wouldn't be for all the other users having the semgrep binary on different paths |
@R34LUS3R thanks for the feedback. I have pushed a new version 1.2 downloadable in the release section. |
I am glad a solution could be worked out! @gand3lf but my question is if |
Thanks for keeping it open source.
On macOS, semgrep is installed using brew
But not getting detected by the extension:
there is no error in the import and I have tried by removing and adding it again but still the same.
uname -a
output:Darwin MacBook-Pro 22.3.0 Darwin Kernel Version 22.3.0: Sun Dec 4 18:16:43 PST 2022; root:xnu-8792.80.21.0.2~9/RELEASE_ARM64_T8103 arm64
The text was updated successfully, but these errors were encountered: