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

Build failure: super-slicer-latest #349359

Closed
xokdvium opened this issue Oct 17, 2024 · 0 comments · Fixed by #349484
Closed

Build failure: super-slicer-latest #349359

xokdvium opened this issue Oct 17, 2024 · 0 comments · Fixed by #349484
Labels
0.kind: build failure A package fails to build

Comments

@xokdvium
Copy link
Contributor

Steps To Reproduce

Steps to reproduce the behavior:

  1. run nix build github:nixos/nixpkgs/cd286b21e4acb0d10ba8e8d190abeaebbc59ab1d#super-slicer-latest -L

Build log

....
super-slicer> In file included from /build/source/src/jpeg-compressor/jpge.cpp:937:
super-slicer> In file included from /nix/store/n15bxkd7id2gvlwpihm4kp675aqkrwmj-glibc-2.40-36-dev/include/stdio.h:970:
super-slicer> /nix/store/n15bxkd7id2gvlwpihm4kp675aqkrwmj-glibc-2.40-36-dev/include/bits/stdio2.h:128:13: error: use of undeclared identifier '__builtin___vfprintf_chk'; did you mean '__builtin___sprintf_chk'?
super-slicer>   128 |   int __r = __builtin___vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1,
super-slicer>       |             ^
super-slicer> /nix/store/n15bxkd7id2gvlwpihm4kp675aqkrwmj-glibc-2.40-36-dev/include/bits/stdio2.h:128:13: note: '__builtin___sprintf_chk' declared here
super-slicer> /nix/store/n15bxkd7id2gvlwpihm4kp675aqkrwmj-glibc-2.40-36-dev/include/bits/stdio2.h:128:39: error: cannot initialize a parameter of type 'char *' with an lvalue of type 'FILE *const __restrict' (aka 'jpge::_IO_FILE *const __restrict')
super-slicer>   128 |   int __r = __builtin___vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1,
super-slicer>       |                                       ^~~~~~~~
super-slicer> [  4%] Building CXX object src/imgui/CMakeFiles/imgui.dir/imgui.cpp.o
....

Additional context

This can be fixed with a simple patch. I'm very surprised upstream has not done so already

diff --git a/src/jpeg-compressor/jpge.cpp b/src/jpeg-compressor/jpge.cpp
index f2605ad..8641ed5 100644
--- a/src/jpeg-compressor/jpge.cpp
+++ b/src/jpeg-compressor/jpge.cpp
@@ -30,8 +30,9 @@
 
 #include "jpge.h"
 
-#include <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
+#include <cstdio>
 //#include <malloc.h> // not needed, even create bugs in macos
 
 #define JPGE_MAX(a,b) (((a)>(b))?(a):(b))
@@ -934,7 +935,6 @@ namespace jpge {
 	}
 
 	// Higher level wrappers/examples (optional).
-#include <stdio.h>
 
 	class cfile_stream : public output_stream
 	{

Notify maintainers

@cab404 @Moredread @hesiod

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.11.3-cachyos, NixOS, 24.11 (Vicuna), 24.11.20241014.a3c0b3b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.9`
 - nixpkgs: `/nix/store/xnjw9gmfmpppdj6bxpw6cfkspc3h6xwl-source`

Add a 👍 reaction to issues you find important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant