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

Install error: variable has incomplete type 'struct stat64' #1752

Closed
Robert-Murphy opened this issue Aug 10, 2021 · 3 comments · Fixed by #1775
Closed

Install error: variable has incomplete type 'struct stat64' #1752

Robert-Murphy opened this issue Aug 10, 2021 · 3 comments · Fixed by #1775

Comments

@Robert-Murphy
Copy link

Hi, Attempting to install rpm on Big Sur with M1 chip via HomeBrew.
Initially getting "Error: rpm: no bottle available"

I have since tried both of the following commands:
brew install --build-from-source rpm and brew install rpm --build-bottle

Both give me the following error:

robertmurphy@ALT-RM-13205 Repositories % brew install --build-from-source rpm
==> Downloading http://ftp.rpm.org/releases/rpm-4.16.x/rpm-4.16.1.3.tar.bz2
Already downloaded: /Users/robertmurphy/Library/Caches/Homebrew/downloads/490bdabcf09ad0ae5e0dc4820a86faad5112c2470621cb3153e74a4003d3776c--rpm-4.16.1.3.tar.bz2
==> ./configure --prefix=/opt/homebrew/Cellar/rpm/4.16.1.3 --localstatedir=/opt/homebrew/var --sharedstatedir=/opt/homebrew/var/lib --sysconfdir=/opt/homebrew/etc --with-path-magic=/o
==> make install
Last 15 lines from /Users/robertmurphy/Library/Logs/Homebrew/rpm/02.make:
/bin/sh ../libtool --tag=CC --mode=compile clang -DHAVE_CONFIG_H -I.. -I.. -I../include -I../misc -I/opt/homebrew/opt/lua/include/lua -I/opt/homebrew/Cellar/openssl@1.1/1.1.1k/include -g -O2 -c -o fts.lo fts.c
/bin/sh ../libtool --tag=CC --mode=compile clang -DHAVE_CONFIG_H -I.. -I.. -I../include -I../misc -I/opt/homebrew/opt/lua/include/lua -I/opt/homebrew/Cellar/openssl@1.1/1.1.1k/include -g -O2 -c -o fnmatch.lo fnmatch.c
libtool: compile: clang -DHAVE_CONFIG_H -I.. -I.. -I../include -I../misc -I/opt/homebrew/opt/lua/include/lua -I/opt/homebrew/Cellar/openssl@1.1/1.1.1k/include -g -O2 -c fnmatch.c -fno-common -DPIC -o .libs/fnmatch.o
libtool: compile: clang -DHAVE_CONFIG_H -I.. -I.. -I../include -I../misc -I/opt/homebrew/opt/lua/include/lua -I/opt/homebrew/Cellar/openssl@1.1/1.1.1k/include -g -O2 -c fts.c -fno-common -DPIC -o .libs/fts.o
fts.c:1120:16: error: variable has incomplete type 'struct stat64'
struct stat64 sb;
^
fts.c:1120:9: note: forward declaration of 'struct stat64'
struct stat64 sb;
^
1 error generated.
make[2]: *** [fts.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2

Can anybody help me with this please?
Let me know if any more information is required. Thanks

@ffesti
Copy link
Contributor

ffesti commented Aug 11, 2021

The compiler is tripping over this line https://github.com/rpm-software-management/rpm/blob/master/misc/fts.c#L1124

The file is the implementation for the fts functions for systems not supporting them. So the actual issue is that your system is not (yet) taking into account at the top of the file where stat64 is redefined as stat for systems that don't support stat64 and fstat64. You might want to add a section there are modify the behaviour to match your system.

@ffesti
Copy link
Contributor

ffesti commented Aug 17, 2021

OK, to be more clear: This needs to be fixed by someone with such machine at hand. It shoudn't be too hard. Patches are welcome.

@MagicTmac1
Copy link

how to solve the problem?

emilazy added a commit to emilazy/rpm that referenced this issue Sep 14, 2021
The Apple Silicon toolchain removes the *64 stat symbols (deprecated
since 10.6) in favour of their unprefixed form.

This change might not work properly before 10.6, but 10.5 has been out
of support for over a decade, so that hopefully shouldn't be relevant.

Fixes rpm-software-management#1752.
emilazy added a commit to emilazy/rpm that referenced this issue Sep 14, 2021
The Apple Silicon toolchain removes the *64 stat symbols (deprecated
since 10.6) in favour of their unprefixed form.

This change might not work properly before 10.6, but 10.5 has been out
of support for over a decade, so that hopefully shouldn't be relevant.

Fixes rpm-software-management#1752.
ffesti pushed a commit that referenced this issue Sep 14, 2021
The Apple Silicon toolchain removes the *64 stat symbols (deprecated
since 10.6) in favour of their unprefixed form.

This change might not work properly before 10.6, but 10.5 has been out
of support for over a decade, so that hopefully shouldn't be relevant.

Fixes #1752.
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 a pull request may close this issue.

3 participants