Skip to content
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

Pre-lock custom hook per layer #105

Open
neilmehta24 opened this issue Dec 19, 2024 · 2 comments
Open

Pre-lock custom hook per layer #105

neilmehta24 opened this issue Dec 19, 2024 · 2 comments
Labels
Affects: Spec Format Affect the stack specification format Category: Enhancement New feature or request

Comments

@neilmehta24
Copy link
Member

There are actions that we always need to take prior to locking a specific layer that we have. For example, when re-locking one of our application layers, we want to rebuild one of our wheels from source beforehand. It would be nice if we could specify that command in the layer toml like so.

[[applications]]
name="src"
...
pre-lock-hook="/path/to/python -m build relative/path/to/src"
@ncoghlan ncoghlan added Category: Enhancement New feature or request Affects: Spec Format Affect the stack specification format labels Dec 20, 2024
@ncoghlan
Copy link
Collaborator

@neilmehta24 I assume the current workaround is just to run a wrapper script that knows about the pre-lock commands for the layers that have them, and executes them all before running the lock step?

(which would work for comprehensive stack builds, but completely ignore the layer selection logic for selective builds, hence the feature request)

@neilmehta24
Copy link
Member Author

@neilmehta24 I assume the current workaround is just to run a wrapper script that knows about the pre-lock commands for the layers that have them, and executes them all before running the lock step?

(which would work for comprehensive stack builds, but completely ignore the layer selection logic for selective builds, hence the feature request)

Yes, the reason why it would be nice to have on a per-layer basis is so we can use --include filter to decide whether to run the hook or not.
Right now we are re-running all builds on every lock command. Which is fine for now since our builds are very fast. But when our build gets larger, ideally we don't have to re-implement the include filtering in our wrapper script.
Overall this issue is a low priority since we have workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Spec Format Affect the stack specification format Category: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants