Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Add support for python patching#1

Open
klaussfreire wants to merge 4 commits into
torian:masterfrom
jampp:python_patches
Open

Add support for python patching#1
klaussfreire wants to merge 4 commits into
torian:masterfrom
jampp:python_patches

Conversation

@klaussfreire

Copy link
Copy Markdown

No description provided.

Comment thread tasks/build.yml
src="{{python_src_prefix}}/{{python_src_pkg}}"
dest="{{python_src_prefix}}"

- name: Patch code

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'd probably change a few things here, to improve a bit on idempotency.

  1. use the get_url module, and iterate along the patches urls. Register successful downloads
  2. Use:
args:
  chdir: "{{python_src_prefix}}"

instead of cd ...
3. Using the register var from get_url apply the patche.
4. Not sure about removing the patches. IMO it is a good idea to actually know what has been applied, and also, that would break get_url idempotency.

@klaussfreire klaussfreire Jan 3, 2017

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

sha1 checksum checking for get_url is only there for ansible 2.0 and above. Prior versions support only the sha256sum argument, which is deprecated on 2.0, so maintaining cross compatibility becomes very cumbersome.

Idempotence is already broken since get_url in the previous step is currently unconditional (when is commented), unarchive is unconditional as well, and the build is currently conditional only on python not being installed (so it won't pick up changes in source code even if all the above tasks actually report changed or not correctly).

You can never fully ascertain which patches were applied also, there's no way to know whether a binary was built with or without a patch. So even if the patches were left on the source path, that still doesn't guarantee they were built into the binary. So preserving idempotence in the presence of patches seems like a tall order.

The other changes don't seem like a big deal

@torian

torian commented Jan 3, 2017

Copy link
Copy Markdown
Owner

This is a good one to have 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants