-
-
Notifications
You must be signed in to change notification settings - Fork 68
./ CONTRIBUTING updates for macOS #306
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
base: work
Are you sure you want to change the base?
Conversation
erik-thompson-seattle
commented
Jun 1, 2025
- Added: Instructions for mkimage tools
- Added: Notes observed in building ev3 build
- Added: Updates for newer version of poetry
- Fixed: Command errors
- Added: Details to install python3.10 on systems with older or newer versions of python
* Added: Instructions for mkimage tools * Added: Notes observed in building ev3 build * Added: Updates for newer version of poetry * Fixed: Command errors * Added: Details to install python3.10 on systems with older or newer versions of python
@laurensvalk @dlech Built the ev3 firmware and found a few updates for the CONTRIBUTING.md |
@@ -127,6 +128,15 @@ checkout out on-demand when running `make`. | |||
cd pybricks-micropython | |||
code . # Opens the project in VS Code | |||
|
|||
### Installing Python 3.10.x |
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.
I would say "or later" here. It doesn't need to be exactly 3.10.x
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.
Makes sense. I was going off the preceding instructions that specified 3.10.x
https://github.com/pybricks/pybricks-micropython/pull/306/files#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055R12
brew install python3.10 | ||
|
||
Note: On MacOS you will need to add a symlink for the build process to work | ||
ln -s `which python3.10` python |
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.
This scares me a bit. It could break other things that use Python.
Instead, we can provide an explicit Python version/path to the poetry command to create the virtual environment.
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.
It's local to the repo so they would have to be in that directory if we can get the build to use the poetry version then that would be better, I didn't look at making alterations to any files, just reviewed updating the documentation on the issues I worked through in the build.
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.
I'm not sure I follow. I didn't need to do this set to get a working build on my Mac.
I just ran the build in the virtual environment which already took care of making sure python
is defined and points to the Python of the virtual environment.
@@ -153,10 +163,17 @@ To activate the environment, run: | |||
|
|||
poetry shell | |||
|
|||
On poetry version 2.1.3, run: | |||
poetry env activate |
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.
Let's just replace the existing poetry shell
. No one should be running an older version.
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.
WIll do
@@ -188,6 +205,7 @@ Where `<target>` is one of the bricks listed in the `bricks/` directory, e.g. | |||
Hopefully all goes well and the firmware builds. The results of the build can | |||
be found in `bricks/<target>/build/`. | |||
|
|||
Note: You will get make errors, you will need to make the target a few times. |
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.
We should fix the build rather than telling everyone it is broken.
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.
I did not look into the cause, the error did not state anything of use other than a make build error number. I would venture to guess it failed as a result of pulling the submodules as it got a bit further on each make for ev3.
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.
It looks like this is caused by using an older version of make, I assume from xcode.
% make --version
GNU Make 3.81
% which make
/usr/bin/make
According to the SO comment, we need >= 4.4.
So I think we can work around this with brew install make
and using gmake
or modifying PATH
.
==> Caveats
GNU "make" has been installed as "gmake".
If you need to use it as "make", you can add a "gnubin" directory
to your PATH from your bashrc like:
PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"
Using gmake
seems to work for me locally.
All the updates are against trying to |
brew install --cask gcc-arm-embedded | ||
brew info gcc-arm-embedded # you will need the install path later |
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.
What do we need the path for? I didn't need it to build on my Mac.
The command prompt will now start with `(.venv)` to remind you that you are | ||
working in the virtual environment. You should run `poetry shell` any time you | ||
open a new terminal window while working on `pybricks-micropython`. | ||
|
||
### Installing mkimage tools | ||
macOS | ||
brew install u-boot-tools # this install mkimage capabilities on MacOS |
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.
Might as well put this with the other prerequisites. (and mention that it is only needed for EV3)
brew install python3.10 | ||
|
||
Note: On MacOS you will need to add a symlink for the build process to work | ||
ln -s `which python3.10` python |
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.
I'm not sure I follow. I didn't need to do this set to get a working build on my Mac.
I just ran the build in the virtual environment which already took care of making sure python
is defined and points to the Python of the virtual environment.