Skip to content

Fix CMake stale linux build dir#1071

Open
runlevel5 wants to merge 2 commits intoRobertBeckebans:masterfrom
runlevel5:fix/cmake-linux-build-dir
Open

Fix CMake stale linux build dir#1071
runlevel5 wants to merge 2 commits intoRobertBeckebans:masterfrom
runlevel5:fix/cmake-linux-build-dir

Conversation

@runlevel5
Copy link
Copy Markdown

Problem:

mkdir build
cd build
../neo/cmake-<somthing>.sh
make -j32
make: getcwd: No such file or directory
make: *** No targets specified and no makefile found.  Stop

Why? rm -rf build and mkdir build in those scripts are culprits. Since you're already sitting inside the build directory when you run the script, the directory gets deleted and recreated underneath you. Your shell still holds a file descriptor to the old (now deleted) inode, so make fails with getcwd: No such file or directory.

Solution: instead of rm -rf build && mkdir build, just clean the contents of the directory

The scripts did rm -rf build && mkdir build, which invalidates the
cwd of any shell already inside the build directory. Replace with
mkdir -p build && cd build && rm -rf * to clean the contents while
preserving the directory inode.
@runlevel5 runlevel5 force-pushed the fix/cmake-linux-build-dir branch from 74b83e1 to d28b452 Compare February 8, 2026 11:51
@SRSaunders
Copy link
Copy Markdown

@runlevel5 I always thought these command-line build scripts were designed to work from the RBDoom3BFG/neo directory, not from the build directory. However, your change adds that use case and makes things more flexible.

Note this is also applicable to the cmake-macos-*.sh scripts (but not the cmake-xcode-*.sh ones). Please feel free to update this PR and apply the same changes to: cmake-macos-release.sh and cmake-macos-retail.sh.

@runlevel5
Copy link
Copy Markdown
Author

@SRSaunders amended

@SRSaunders
Copy link
Copy Markdown

Thanks @runlevel5 for adding this!

@runlevel5
Copy link
Copy Markdown
Author

@RobertBeckebans the PR is ready for review. Great thanks

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.

2 participants