-
Notifications
You must be signed in to change notification settings - Fork 427
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
patch level guessed incorrectly? #4241
Comments
I believe the code that does the guessing is conda-build/conda_build/source.py Lines 514 to 538 in e458431
It may be confused by the fact that the file does not (yet) exist. P.S. Perhaps I am also making some mistake here; it seems strange to me that this issue would not have been noticed before. I just don't see what my mistake is. |
Hi there, thank you for your contribution! This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this issue to remain open please:
NOTE: If this issue was closed prematurely, please leave a comment. Thanks! |
Latest versions of conda/conda-build still have this issue with patches containing new files:
with
|
* Enable macOS builds for AnchorWave * Bump build number and add run_exports for Anchorwave * Use lowercase name for AnchorWave in metadata * Patch in upstream macOS-x86 support * Patch CMakeLists.txt directly Because of conda/conda-build#4241, new files aren't properly patched in with conda-build, so patch the existing CMakeLists.txt instead of adding a new one and symlinking.
I think I am running into the same problem as @sdebionne. I have a patch that only adds files, so it looks like this:
The code in
The However, in
So, if I use the
my patches get applied correctly. Would this be a something we could do to fix this problem (even though it is not a perfect solution)? Or is there a scenario when git would produce patches that do not have patch level 1? |
Just ran into this while debugging why my patch didn't work in conda-forge/wandb-feedstock#132 (commit: conda-forge/wandb-feedstock@3c716b5). Is there a workaround until the PR is merged? EDIT: I worked around this by modifying a random file in my patch. Note that conda-build determines the patch level as "ambiguous" in this situation, so I could be getting lucky that 1 is preferred over 0 in my case:
|
Actual Behavior
When supplying a patch (produced by
git format-patch
) that creates a new file, it appears that conda-build (3.21.4) guesses the patch level incorrectly, resulting in the file being created in the wrong directory.In the following example, I am applying two patches:
config.patch
that modifies an existing file at the top-level of the packagecmake.patch
that creates a new file at the top-levelAs shown in the build log, the first is applied with
-Np1
and the second is applied with-Np0
.In the end, the build fails because
CMakeLists.txt
was not created in the expected place.Expected Behavior
I would expect both patches to be applied with
-p1
.Steps to Reproduce
Try supplying a patch that creates a new file.
Output of conda info
The text was updated successfully, but these errors were encountered: