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

Ninja build script fails because of libpng build generated configuration #4971

Open
Jarten0 opened this issue Feb 2, 2025 · 0 comments
Open

Comments

@Jarten0
Copy link

Jarten0 commented Feb 2, 2025

pnglibconf.dfa fails to properly build when using LF file ending encoding.

third_party/libpng/scripts/pnglibconf.dfa

# scripts/pnglibconf.dfa - library build configuration control
#
@/*- pnglibconf.dfn intermediate file
@ *  generated from scripts/pnglibconf.dfa
@ */
#
com pnglibconf.h - library build configuration
com
version
com
com Copyright (c) 2018-2023 Cosmin Truta
com Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
com
com This code is released under the libpng license.
com For conditions of distribution and use, see the disclaimer
com and license in png.h
com

...

This configuration results in this being generated.

build/third_party/libpng/pnglibconf.c

/*- pnglibconf.dfn intermediate file
 * generated from scripts/pnglibconf.dfa
 */
 PNG_DFN "/* pnglibconf.h - library build configuration */" 
 PNG_DFN "" 
 PNG_DFN "/* libpng version 1.6.40
 */" 
 PNG_DFN "" 
 PNG_DFN "/* Copyright (c) 2018-2023 Cosmin Truta */" 
 PNG_DFN "/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */" 
 PNG_DFN "" 
 PNG_DFN "/* This code is released under the libpng license. */" 
 PNG_DFN "/* For conditions of distribution and use, see the disclaimer */" 
 PNG_DFN "/* and license in png.h */" 
 PNG_DFN "" 
 PNG_DFN "/* pnglibconf.h */" 
 PNG_DFN "/* Machine generated file: DO NOT EDIT */" 
 PNG_DFN "/* Derived from: scripts/pnglibconf.dfa */" 
 PNG_DFN "#ifndef PNGLCONF_H" 
 PNG_DFN "#define PNGLCONF_H" 
...

Trying to build aseprite with this causes this error

ninja aseprite
[3/31] Generating pnglibconf.out
FAILED: third_party/libpng/pnglibconf.out /home/jarten/Tools/aseprite/build/third_party/libpng/pnglibconf.out 
cd /home/jarten/Tools/aseprite/build/third_party/libpng && /usr/bin/cmake -DINPUT=/home/jarten/Tools/aseprite/build/third_party/libpng/pnglibconf.c -DOUTPUT=/home/jarten/Tools/aseprite/build/third_party/libpng/pnglibconf.out -P /home/jarten/Tools/aseprite/build/third_party/libpng/scripts/genout.cmake
/home/jarten/Tools/aseprite/build/third_party/libpng/pnglibconf.c:6:10: warning: missing terminating '"' character [-Winvalid-pp-token]
 PNG_DFN "/* libpng version 1.6.40
         ^
/home/jarten/Tools/aseprite/build/third_party/libpng/pnglibconf.c:7:4: warning: missing terminating '"' character [-Winvalid-pp-token]
 */" 
   ^
2 warnings generated.
line 13 incorrectly formatted PNG_DFN line:
 PNG_DFN "/* libpng version 1.6.40
CMake Error at scripts/genout.cmake:86 (message):
  Failed to generate
  /home/jarten/Tools/aseprite/build/third_party/libpng/pnglibconf.out.tf2


ninja: build stopped: subcommand failed.

I was able to work around the error by removing the version line from pnglibconf.dfa, since it only generates a comment, but this should probably be fixed for if other people try to deal with End Of Line Sequence stuff.

Side note: I was using LF file ending encoding because of another build error, identical to this stack overflow question which gives the same error, which can in turn be fixed by the same solution given there.

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

No branches or pull requests

2 participants