Skip to content

./ 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

Open
wants to merge 1 commit into
base: work
Choose a base branch
from

Conversation

erik-thompson-seattle
Copy link

  • 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
@erik-thompson-seattle
Copy link
Author

@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
Copy link
Member

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

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.

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.

Copy link
Member

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
Copy link
Member

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.

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.
Copy link
Member

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.

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.

Copy link
Member

@dlech dlech Jun 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/questions/41470676/makefile-variable-expansion-with-wildcard-when-rule-creates-new-file#comment132120501_41472904

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.

@erik-thompson-seattle
Copy link
Author

All the updates are against trying to make ev3

brew install --cask gcc-arm-embedded
brew info gcc-arm-embedded # you will need the install path later
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants