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

PATCHES : make it not fail when reconfiguring #574

Closed
wants to merge 10 commits into from

Conversation

Arniiiii
Copy link

When there's PATCHES, if we reconfigure, it will fail with next logs:

-- CPM: Adding package [email protected] (v1.11.2)
-- Populating packageproject.cmake
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/paxu/code/experiments/ModernCppStarterCPMBoostExample/build/_deps/packageproject.cmake-subbuild
[ 11%] Performing update step for 'packageproject.cmake-populate'
[ 22%] Performing patch step for 'packageproject.cmake-populate'
patching file CMakeLists.txt
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file CMakeLists.txt.rej
gmake[2]: *** [CMakeFiles/packageproject.cmake-populate.dir/build.make:118: packageproject.cmake-populate-prefix/src/packageproject.cmake-populate-stamp/packageproject.cmake-populate-patch] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/packageproject.cmake-populate.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
CMake Error at /usr/share/cmake/Modules/FetchContent.cmake:1679 (message):
  Build step for packageproject.cmake failed: 2
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FetchContent.cmake:1819:EVAL:2 (__FetchContent_directPopulate)
  /usr/share/cmake/Modules/FetchContent.cmake:1819 (cmake_language)
  build/cmake/CPM_0.40.0.cmake:1074 (FetchContent_Populate)
  build/cmake/CPM_0.40.0.cmake:868 (cpm_fetch_package)
  cmake/packages/packageproject.cmake:6 (CPMAddPackage)
  CMakeLists.txt:31 (include)


-- Configuring incomplete, errors occurred!

This can be solved just by adding the -N aka --forward to flags for patch command. patch --help for details.

@Arniiiii Arniiiii changed the title make it not fail when reconfiguring PATCHES : make it not fail when reconfiguring Jul 19, 2024
@Arniiiii
Copy link
Author

wait a little bit, there's a strange problem with /usr/bin/patch: **** strip count ' 1 ' is not a number

@Arniiiii
Copy link
Author

Arniiiii commented Jul 19, 2024

seems to be fixed

yes to /usr/bin/patch: **** strip count ' 1 ' is not a number , no to original issue

@Arniiiii
Copy link
Author

solved by additionally specifying that it's normal patch?

@Arniiiii
Copy link
Author

That's really interesting that it fails examples

I've found that without -n it doesn't fail if specified "-DCPM_SOURCE_CACHE=~/.cache/cpm" , but fails when it's not specified. That's really strange

@Arniiiii
Copy link
Author

after some testing with options:
--forward + --rejectfile=- indeed works, but gives error code 1
--batch indeed works

@Arniiiii Arniiiii closed this Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant