Skip to content

Build error occurred; My prior commit broke the build commands. - #268

Closed
Blake-sama wants to merge 1 commit into
hyprwm:mainfrom
Blake-sama:main
Closed

Build error occurred; My prior commit broke the build commands.#268
Blake-sama wants to merge 1 commit into
hyprwm:mainfrom
Blake-sama:main

Conversation

@Blake-sama

Copy link
Copy Markdown
Contributor

Using these build commands found on the main page of the repo:
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target hyprpaper -jnproc 2>/dev/null || getconf _NPROCESSORS_CONF

I caused this error when building:
/home/blake-sama/Developer/hyprpaper/src/main.cpp: In function ‘int main(int, char**, char**)’:
: error: unable to find string literal operator ‘operator""source’ with ‘const char [19]’, ‘long unsigned int’ arguments
/home/blake-sama/Developer/hyprpaper/src/main.cpp:6:90: note: in expansion of macro ‘GIT_COMMIT_MESSAGE’
6 | Debug::log(LOG, "Welcome to hyprpaper!\nbuilt from commit {} ({})", GIT_COMMIT_HASH, GIT_COMMIT_MESSAGE);
| ^~~~~~~~~~~~~~~~~~
make[3]: *** [CMakeFiles/hyprpaper.dir/build.make:205: CMakeFiles/hyprpaper.dir/src/main.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/Makefile2:87: CMakeFiles/hyprpaper.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:94: CMakeFiles/hyprpaper.dir/rule] Error 2
make: *** [Makefile:189: hyprpaper] Error 2

After ChatGPT'ing the error, when the build tried to compile, it detected a bad commit message. Well, that's because the most recent commit to the project was mine which had "source=" in the commit message. It failed to read the "" marks in my commit message correctly, breaking the compiler's ability to build hyprpaper.

I'm also not very great at explaining so here's ChatGPT expressing what this fix does:
"The fix I added ensures that any " characters in the commit message are escaped ("), so that when the macro is expanded into C++, it stays within the bounds of a valid string literal. This prevents the preprocessor from misinterpreting the contents of commit messages."

tl;dr I'm sorry I broke the build with a bad commit message, lesson learned . . . don't use "" marks in commits.

… on the main GitHub page because my commit contained "" marks. These two adjustments to CMakeLists.txt resolve this by escaping "" marks in commit messages.
@Blake-sama

Copy link
Copy Markdown
Contributor Author

Wait . . . I broke something & made a pull request too early, brb!

@Blake-sama Blake-sama closed this Jul 27, 2025

@vaxerski vaxerski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes senes

@vaxerski

Copy link
Copy Markdown
Member

huh ok

@Blake-sama

Copy link
Copy Markdown
Contributor Author

Give me like ten seconds. I'm really sorry, I'm still learning git and tl;dr I fixed this in the main repo (no perms), went and updated my fork with the same fix, but um, my fork didn't build correctly, so now I need to check what I did different.

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