tabemann / zeptoforth

A not-so-small Forth for Cortex-M
MIT License
192 stars 18 forks source link

Refine the utils scripts a bit. #60

Closed arlaneenalra closed 1 year ago

arlaneenalra commented 1 year ago

While attempting to build out a dev branch of zeptoforth on a macOs machine (Ventura 13.5 on an M1 to be specific) I ran into a few incompatibilities with the that tripped me up for a while. In particular:

In theory, I didn't change the calling semantics of the scripts (though they should be less sensitive to their working directory now) and I only have a Raspberry Pi Pico to play with so I can't test the other chips. So far I've built the full and full_usb images using these.

tabemann commented 1 year ago

Chris,

Thanks for doing all this work ─ I don't have access to a Mac environment so I would not have been able to test this. However, I have a small quibble ─ could you modify your scripts to use plain Bourne shell and not bash, because xBSD's often do not come with bash out of the box?

Thanks,

Travis

arlaneenalra commented 1 year ago

I can give it a shot. I'm not sure if I have a system that actually has a real bourne shell on it (most Linux systems I've worked with symlink sh to something Bourne like ). Is there a particular xBSD you use for testing?

On Tue, Aug 22, 2023, 01:01 tabemann @.***> wrote:

Chris,

Thanks for doing all this work ─ I don't have access to a Mac environment so I would not have been able to test this. However, I have a small quibble ─ could you modify your scripts to use plain Bourne shell and not bash, because xBSD's often do not come with bash out of the box?

Thanks,

Travis

— Reply to this email directly, view it on GitHub https://github.com/tabemann/zeptoforth/pull/60#issuecomment-1687492094, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACYAPYCQEP4I67W4CRLU6LXWRDNLANCNFSM6AAAAAA3XUXXMQ . You are receiving this because you authored the thread.Message ID: @.***>

tabemann commented 1 year ago

I can give it a shot. I'm not sure if I have a system that actually has a real bourne shell on it (most Linux systems I've worked with symlink sh to something Bourne like ). Is there a particular xBSD you use for testing?

I do not use xBSD myself, but I know people who do use xBSD (primarily FreeBSD). To use what is almost Bourne shell rather than Bash just specify #!/bin/sh at the top of your script. (Bash detects this and enters a fallback emulation mode when it is specified.)

arlaneenalra commented 1 year ago

True enough, though I just built a freebsd vm to play with. If I can't make that work, I'll use the bash emulation as you suggest.

On Tue, Aug 22, 2023, 18:54 tabemann @.***> wrote:

I can give it a shot. I'm not sure if I have a system that actually has a real bourne shell on it (most Linux systems I've worked with symlink sh to something Bourne like ). Is there a particular xBSD you use for testing?

I do not use xBSD myself, but I know people who do use xBSD (primarily FreeBSD). To use what is almost Bourne shell rather than Bash just specify #!/bin/sh at the top of your script. (Bash detects this and enters a fallback emulation mode when it is specified.)

— Reply to this email directly, view it on GitHub https://github.com/tabemann/zeptoforth/pull/60#issuecomment-1689068894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACYAP44OALCX24FIZYECN3XWVBDLANCNFSM6AAAAAA3XUXXMQ . You are receiving this because you authored the thread.Message ID: @.***>

arlaneenalra commented 1 year ago

Hmm I think I have some variable scoping issues that didn't show up in bash .. trying to get those sorted out ...

arlaneenalra commented 1 year ago

Ok, how's that? I can't test the stuff with st-flash calls and my FreeBSD vm wound up being unstable in proxmox. ( Still need to figure that out but it's unrelated to this). I noticed two things with it though:

Past that, I had to switch back to my Mac for testing.

tabemann commented 1 year ago

I have tried it out with my Pico W and it works for me. The only thing that I noticed was that I had to install the python3.11-venv Debian package, which I had not expected. However, using that does improve things w.r..t. avoidng having users manually install pySerial. (On the other hand, some people are a bit paranoid about PIP, seeing that as a security thread for some reason.)

arlaneenalra commented 1 year ago

I'm not sure of a good answer for that ... is pySerial normally installed via a debian package or manually? I'm actually surprised venv is a separate package, I thought that was a core part of python now.

Either way, adding a fallback or flag/env variable to make the venv stuff optional wouldn't be too difficult. The other nice thing about venv's is that if something ever goes wrong with it, the right answer is almost always delete the venv and rebuild it. We use a technique like this all the time at the day job.

On Wed, Aug 23, 2023, 14:35 tabemann @.***> wrote:

I have tried it out with my Pico W and it works for me. The only thing that I noticed was that I had to install the python3.11-venv Debian package, which I had not expected. However, using that does improve things w.r..t. avoidng having users manually install pySerial. (On the other hand, some people are a bit paranoid about PIP, seeing that as a security thread for some reason.)

— Reply to this email directly, view it on GitHub https://github.com/tabemann/zeptoforth/pull/60#issuecomment-1690529766, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACYAPYGPM3RDWHFTQXO6O3XWZLRRANCNFSM6AAAAAA3XUXXMQ . You are receiving this because you authored the thread.Message ID: @.***>

tabemann commented 1 year ago

I'm not sure of a good answer for that ... is pySerial normally installed via a debian package or manually? I'm actually surprised venv is a separate package, I thought that was a core part of python now. Either way, adding a fallback or flag/env variable to make the venv stuff optional wouldn't be too difficult. The other nice thing about venv's is that if something ever goes wrong with it, the right answer is almost always delete the venv and rebuild it. We use a technique like this all the time at the day job.

I installed pySerial via Debian package, but that was a while ago, and I don't see any reason to not install it via PIP. As for why venv is a separate package, take into consideration the love of the Debian people to divide up things into separate packages as far as possible.

All in all, I think in retrospect that doing this with venv was the right way to do it, because of its reducing dependency issues by limiting packages to a particular project (the whole Haskell Cabal hell mess reminds me of how making packages project-specific is a good idea).