-
Notifications
You must be signed in to change notification settings - Fork 1
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
Ner build fixups #180
Ner build fixups #180
Conversation
I coded this all in notepad lol python is funny. |
|
||
command = [] | ||
#if args.docker: | ||
# print("Dockerized openocd unsupported for gdb") |
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.
can we clean out unused code comments
print("Error: No ELF file found in ./build/") | ||
sys.exit(1) | ||
|
||
elf_file = os.path.basename(os.path.normpath(elf_files[0])) # Take the first ELF file found |
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.
whats this basename command for. I trust it works ig but i thought u could just directly do elf_files[0]
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.
The filepath is different inside of docker.
if stderr_output: | ||
print(stderr_output, file=sys.stderr) | ||
|
||
process = subprocess.Popen(command, text=True) |
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.
did we find a way to get this streaming to work without that while loop? i thought we added that explicitly to get some form of sreamed output
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.
Just don't use PIPE. Everything apparently works as long as the code doesn't need to access the output.
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.
Idk I tested before adding this and running flash showed nothing on output, but if u tested this then alright
@@ -294,6 +348,18 @@ def disconnect_usbip(): | |||
command = ["sudo", "usbip", "detach", "-p", "0"] | |||
run_command(command, exit_on_fail=False) | |||
|
|||
def is_wsl(v: str = platform.uname().release) -> int: | |||
""" | |||
detects if Python is running in WSL |
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.
there are better ways to detect WSL:
if platform.system() == "Linux" and "microsoft" in platform.uname().release.lower():
or
if 'WSL_DISTRO_NAME' in os.environ:
return 2 # WSL2
id rather us use one of these, seems cleaner than ur method
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.
approving to get goign on a new PR which will address the only desired change here
Fixups for NER build. Mainly switch to WSL as it is closer to Linux. See accompanying Cerb PR.