Skip to content

Conversation

@lczech
Copy link

@lczech lczech commented Jul 26, 2025

This PR adds a bit of helpful functionality for building Binder during dev:

  • build.py and build-and-run-tests.py have a new flag --update-binder which re-compiles Binder without re-compiling LLVM. This is faster for development when using these scripts to build Binder.
  • test/self-test.py has a new flag --accept-all that accepts all changes, instead of asking about each change. git diff can then be used to show all the changes.

Some further small fixes:

  • test/T42.stl.names.multi.hpp was missing a header include for string.
  • Update the _pybind11_version_ in build.py to the latest commit of the RosettaCommons Pybind11 fork.
  • Add a GitHub Actions test case of Ubuntu using the build-and-run-tests.py script.

@lczech lczech mentioned this pull request Aug 20, 2025
Copy link
Member

@lyskov lyskov left a comment

Choose a reason for hiding this comment

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

Thank you for PR @lczech ! Looks good to me, please see a few comments/suggestions below. Thanks,

Comment on lines +10 to +27
compilejobUbuntu:
strategy:
fail-fast: false
runs-on: ubuntu-latest
name: Binder_on_Ubuntu
steps:
- name: Install
run: |
set -x
uname -a
cat /etc/issue
sudo apt install python3 python3-dev clang make cmake
- name: Checkout
uses: actions/[email protected]
- name: Compile and Test
run: |
python3 build-and-run-tests.py -j 2 --llvm-version 14.0.5

Copy link
Member

Choose a reason for hiding this comment

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

Could you please use something like ubuntu-24.04 instead of latest? We do not want this to suddenly start failing if/when GitHub update latest-runner image.

Copy link
Author

Choose a reason for hiding this comment

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

Sure, will do!

print('LLVM:{} + Binder install is detected at {}, skipping LLVM installation and Binder building procedures...\n'.format(llvm_version, build_dir))

else:
elif not update_binder:
Copy link
Member

Choose a reason for hiding this comment

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

This seems a bit odd, - if signature does not match then it is clear that Binder upgrade is needed. Could you please elaborate on the logic here? My initial impression for a new --update-binder option would be that it will trigger script to check if such upgrade is needed and rebuild Binder if so. Do you see this differently? If so please elaborate.

Copy link
Author

@lczech lczech Aug 21, 2025

Choose a reason for hiding this comment

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

The whole point of this option is to not re-compile LLVM every time, which somehow happened for me each time I called the script after changing Binder code. So with this, LLVM will only be build if --update-binder is not specified.

Copy link
Member

Choose a reason for hiding this comment

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

Hm… it sounds like there is a disconnect here, please let me know if below is not what you are observing on your system:
-- there should not be automatic rebuild unless binder repository have a new commits, - ie changing code should not trigger the rebuilds.
-- to avoid re-build checks (and potential rebuilds) the simplest way is to pass --binder <path-to-binary> option when using build-and-run-tests.py.

Note that I do like the idea of having --update-binder option, but I though it will trigger be something like "rebuild binder binaries even if no new commits are found" so its implementation should probably just call ninja in the right dir (this is what usually do by hands)

parser.add_argument('--pybind11', default='', help='Path to pybind11 source tree')

parser.add_argument("--accept", action="store_true", help="Run tests and accept new tests results as reference")
parser.add_argument("--accept", action="store_true", help="Run tests and ask to accept new tests results as reference")
Copy link
Member

Choose a reason for hiding this comment

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

Since we on this, probably "optional" since it is not directly related to new code: name of this option now clearly misleading, especially with introduction of --accept-all. How about something like --interactive-accept (I am open to suggestions if you have better ideas).

Copy link
Author

Choose a reason for hiding this comment

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

Yep, --interactive-accept sounds more descriptive, good idea! Didn't want to change compatibility there, but if you are happy with that, I can change this.

Copy link
Member

@lyskov lyskov Aug 25, 2025

Choose a reason for hiding this comment

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

I am fine with changing compatibility in this case (I do not think this option is used in automation), so please feel to rename it. Thanks,

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