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

Revert "st: copy config file in 'prePatch' instead of 'preBuild'" #85775

Merged
merged 1 commit into from Apr 29, 2020

Conversation

oxzi
Copy link
Member

@oxzi oxzi commented Apr 22, 2020

If I'm not mistaking, this previously merged PR has broken common usage and the compatibility of patches.

The following was my argumentation from the PR #85443, as @Mic92 recommended me to create a new PR.

I'm not quite sure about this changes, but I think it is breaking with common usage. I would guess that most users are adding some provided patches from upstream and a custom configuration file.

By default, the patches were written against the vanilla release version. Thus, by applying the patches first, they should work. The custom configuration file will then just replace the (potentially patched) config file.

However, if the custom configuration is applied at first, some patches are not compatible anymore because they are also adjusting the configuration file. This obviously fails, because it is no longer in its vanilla state.

Furthermore, I think the argumentation is wrong. Afaik, the patch phase is run before the build phase, not afterwards. The explained state in the commit message was already there before.

In a nutshell, this reverts that patches need to be compatible with the user's custom configuration. The user config will override the previously patched default configuration.

@FRidh
Copy link
Member

FRidh commented Apr 22, 2020

When modifying files, either use patches or postPatch. prePatch can indeed be problematic because it can cause patches to fail to apply. preBuild may work but is not correct because patching is not meant to be done in that phase.

Also change the custom config generation to the postPatch phase.
@oxzi
Copy link
Member Author

oxzi commented Apr 22, 2020

@FRidh: I have updated the commit to add the custom configuration in the postPatch phase. So the patches (inherit patches) are applied first and the configuration is dropped (postPatch) afterwards.
What is your opinion on this?

@Mic92 Mic92 merged commit e0cf3f8 into NixOS:master Apr 29, 2020
@Mic92
Copy link
Member

Mic92 commented Apr 29, 2020

backported:

[detached HEAD 8136104f44b] Revert "st: copy config file in 'prePatch' instead of 'preBuild'"
Author: Alvar geistesk@users.noreply.github.com
Date: Wed Apr 22 13:37:42 2020 +0000
1 file changed, 2 insertions(+), 3 deletions(-)

@oxzi oxzi deleted the revert-85443-st branch April 29, 2020 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants