-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
BuildEnvironment: accumulate module changes to poke to all relevant modules #32340
Conversation
@spackbot fix style |
Let me see if I can fix that for you! |
I was able to run spack style --fix==> Running style checks on spack
selected: isort, mypy, black, flake8
==> Modified files
lib/spack/spack/build_environment.py
==> Running isort checks
isort checks were clean
==> Running mypy checks
Success: no issues found in 558 source files
mypy checks were clean
==> Running black checks
reformatted lib/spack/spack/build_environment.py
All done! ✨ 🍰 ✨
1 file reformatted.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> spack style checks were clean
I've updated the branch with isort fixes. |
It looks like you had an issue with style checks! I can help with that if you ask me! Just say:
... and I'll try to fix style and push a commit to your fork with the fix. Alternatively, you can run: $ spack style --fix And then update the pull request here. |
It looks like you had an issue with style checks! I can help with that if you ask me! Just say:
... and I'll try to fix style and push a commit to your fork with the fix. Alternatively, you can run: $ spack style --fix And then update the pull request here. |
1 similar comment
It looks like you had an issue with style checks! I can help with that if you ask me! Just say:
... and I'll try to fix style and push a commit to your fork with the fix. Alternatively, you can run: $ spack style --fix And then update the pull request here. |
@spackbot fix style |
Let me see if I can fix that for you! |
I was able to run spack style --fix==> Running style checks on spack
selected: isort, mypy, black, flake8
==> Modified files
lib/spack/spack/build_environment.py
lib/spack/spack/test/build_environment.py
var/spack/repos/builtin.mock/packages/cmake-client-inheritor/package.py
==> Running isort checks
Fixing /tmp/tmpxmage56q/spack/var/spack/repos/builtin.mock/packages/cmake-client-inheritor/package.py
isort checks were clean
==> Running mypy checks
Success: no issues found in 558 source files
mypy checks were clean
==> Running black checks
reformatted lib/spack/spack/test/build_environment.py
All done! ✨ 🍰 ✨
1 file reformatted, 2 files left unchanged.
black checks were clean
==> Running flake8 checks
var/spack/repos/builtin.mock/packages/cmake-client-inheritor/package.py:6: [F401] 'os' imported but unused
flake8 found errors
I've updated the branch with isort fixes. |
@spackbot fix style |
Let me see if I can fix that for you! |
I was able to run spack style --fix==> Running style checks on spack
selected: isort, mypy, black, flake8
==> Modified files
lib/spack/spack/build_environment.py
lib/spack/spack/test/build_environment.py
var/spack/repos/builtin.mock/packages/cmake-client-inheritor/package.py
==> Running isort checks
Fixing /tmp/tmpseclb6dk/spack/var/spack/repos/builtin.mock/packages/cmake-client-inheritor/package.py
isort checks were clean
==> Running mypy checks
Success: no issues found in 558 source files
mypy checks were clean
==> Running black checks
All done! ✨ 🍰 ✨
3 files left unchanged.
black checks were clean
==> Running flake8 checks
var/spack/repos/builtin.mock/packages/cmake-client-inheritor/package.py:6: [F401] 'spack.package.*' imported but unused
flake8 found errors
I've updated the branch with isort fixes. |
This was a breaking change :( It's now impossible to read properties from the parent module. How are build deps like |
changes = spack.util.pattern.Bunch() | ||
dpkg.setup_dependent_package(changes, spec) |
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 don't think many packages would be affected, but this potentially breaks previous semantics since we are not passing something that resembles the module. So if a package was accessing module properties, it won't find them in the Bunch()
. Also, the PackageBase
docstring is now misleading, since it says we are passing package.module
as an argument.
EDIT: Sorry for the double posting, I should have refreshed the browser 😆
…g build env This fixes an issue introduced in spack#32340, which changed the semantics of the "module" object passed to the "setup_dependent_package" callback.
…g build env This fixes an issue introduced in spack#32340, which changed the semantics of the "module" object passed to the "setup_dependent_package" callback.
…g build env (spack#34059) This fixes an issue introduced in spack#32340, which changed the semantics of the "module" object passed to the "setup_dependent_package" callback.
Fixes #32336
Currently, module changes from
setup_dependent_package
are applied only to the module of the package class, but not to any parent classes' modules between the package class module andspack.package_base
.In this PR, we create a custom class to accumulate module changes, and apply those changes to each class that requires it. This design allows us to code for a single module, while applying the changes to multiple modules as needed under the hood, without requiring the user to reason about package inheritance.
@tgamblin you'll probably want to look at this.