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

Recompact fail with "failed recompaction: No such file or directory" #2048

Closed
framillien opened this issue Nov 12, 2021 · 6 comments · Fixed by #2390
Closed

Recompact fail with "failed recompaction: No such file or directory" #2048

framillien opened this issue Nov 12, 2021 · 6 comments · Fixed by #2390
Labels
Milestone

Comments

@framillien
Copy link

framillien commented Nov 12, 2021

In rare cases, on our builds we got this error during recompact step:

'C:/ProgramData/chocolatey/bin/ninja.exe' '-C' '<SOME_PATH>' '-t' 'recompact'
    failed with:
      ninja: warning: bad deps log signature or version; starting over
    ninja: error: failed recompaction: No such file or directory  

Trying to trace back why this is failing, we see that:

  • DepsLog::Load delete ninja_deps and return LOAD_SUCCESS if version mismatch or headers are corrupted.
  • OpenDepsLog(/*recompact_only=*/ true) doesn't stop because onLOAD_SUCCESS
  • DepsLog::Recompact fail because of the missing ninja_deps file.

In our case we need to find why the file loading fail (corrupted file ?) but I wonder if this is intentionnal to fail in this case ?

  • if no, returning a LOAD_NOT_FOUND instead of LOAD_SUCCESS will skip the recompaction since the file was deleted.
  • if yes, a more explicit error message could help

thanks,

@framillien
Copy link
Author

An additionnal note: When we do the migration on our CI infra from version 1.9.X to version 1.10.2, we see similar error and decide to purge all workspaces to fix it.

Now we have investigated current issue, I suppose that having a LOAD_NOT_FOUND returned when version mismatched would have helped us to do a smooth Ninja upgrade (but not sure this is the very same error)

@framillien
Copy link
Author

Doing some analyse of our jobs reports, we see at least 10 occurences of this problem, on few hundred of builds, only on Windows.

No clue for now on why the file is 'corrupted' but if recompaction could not fail when DepsLog::Load decide to silently delete the file to be recompacted, this will stabilize our builds.

@LeeRuns
Copy link

LeeRuns commented Feb 17, 2022

The -C option has never worked for me...really frustrating. I am running windows as well.

@obfuscated
Copy link

obfuscated commented Jun 1, 2022

We started seeing this problem on our build farm after we've upgraded from 1.8 to 1.10.
After some investigation it turned out that the problem happens if the following steps are executed:

  1. setup minimal cmake project
  2. install ninja 1.8
  3. build the project with it using cmake <path> -G Ninja; ninja
  4. install ninja 1.10 or 1.11
  5. run cmake . in the build folder.

These steps reliably reproduce the problem.
The problem happens even in 1.11 or master.

Here is the full log of commands:

 ~/projects/temp/cmake_minimal/build 0 > ninja-build --version
1.8.2
 ~/projects/temp/cmake_minimal/build 0 > cmake .. -G Ninja
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/obf7/projects/temp/cmake_minimal/build
 ~/projects/temp/cmake_minimal/build 0 > ninja-build 
[2/2] Linking CXX executable cmake_minimal
 ~/projects/temp/cmake_minimal/build 0 > ninja-build --version
1.11.0
 ~/projects/temp/cmake_minimal/build 0 > cmake .
-- Configuring done
-- Generating done
CMake Error:
  Running

   '/usr/bin/ninja-build' '-C' '/home/obf7/projects/temp/cmake_minimal/build' '-t' 'recompact'

  failed with:

   ninja: warning: bad deps log signature or version; starting over

  ninja: error: failed recompaction: No such file or directory



CMake Generate step failed.  Build files cannot be regenerated correctly.
 ~/projects/temp/cmake_minimal/build 1 > 

OS: CentOS 7
CMake: 3.22.2

@obfuscated
Copy link

This issue is still reproducible with the 1.12.0 release. Same steps as above. I'm using cmake 3.29.3 and Rocky 8 Linux if it matters.

@jhasse
Copy link
Collaborator

jhasse commented May 28, 2024

same output? If you can reproduce it, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants