amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
500 stars 38 forks source link

[Bug] - `audit-libs` rebuild fail #648

Open denisgabriel5 opened 3 months ago

denisgabriel5 commented 3 months ago

Describe the bug I am trying to rebuild 'audit-libs' using 'rpmbuild'.

To Reproduce Steps to reproduce the behavior:

  1. rpmdev-setuptree && cd ~/rpmbuild/SOURCES
  2. dnf download --source audit-libs
  3. Resolve dependecies. I am using sudo dnf builddep audit-3.0.6-1.amzn2023.0.2.src.rpm
  4. rpmbuild -rb audit-3.0.6-1.amzn2023.0.2.src.rpm

Expected behavior The rebuild ends with no errors.

Server:

Additional context

audit_wrap.c: In function '_wrap_audit_rule_data_buf_set':
audit_wrap.c:5010:17: error: cast specifies array type
 5010 |     arg1->buf = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
      |                 ^
audit_wrap.c:5010:15: error: invalid use of flexible array member
 5010 |     arg1->buf = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
      |               ^
audit_wrap.c:5012:15: error: invalid use of flexible array member
 5012 |     arg1->buf = 0;
      |               ^
make[4]: *** [Makefile:516: _audit_la-audit_wrap.lo] Error 1
make[4]: Leaving directory '/home/ec2-user/rpmbuild/BUILD/audit-3.0.6/bindings/swig/python3'
make[3]: *** [Makefile:415: all-recursive] Error 1
make[3]: Leaving directory '/home/ec2-user/rpmbuild/BUILD/audit-3.0.6/bindings/swig'
make[2]: *** [Makefile:412: all-recursive] Error 1
make[2]: Leaving directory '/home/ec2-user/rpmbuild/BUILD/audit-3.0.6/bindings'
make[1]: *** [Makefile:467: all-recursive] Error 1
make[1]: Leaving directory '/home/ec2-user/rpmbuild/BUILD/audit-3.0.6'
make: *** [Makefile:399: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.P8nCxt (%build)

RPM build errors:
    user mockbuild does not exist - using root
    group mock does not exist - using root
    user mockbuild does not exist - using root
    group mock does not exist - using root
    user mockbuild does not exist - using root
    group mock does not exist - using root
    Bad exit status from /var/tmp/rpm-tmp.P8nCxt (%build)

From what I have read online this code was fixed in version 3.0.8. If am rebuilding in the exact same environment audit-3.1.2-2.el9.src.rpm downloaded from CentOS 9 package repository, then it succeeds.

elsaco commented 3 months ago

@denisgabriel5 you mentioned the code was fixed in 3.0.8. You're building a 3.0.6 package!

denisgabriel5 commented 3 months ago

@denisgabriel5 you mentioned the code was fixed in 3.0.8. You're building a 3.0.6 package!

Well, that's because AL2023 repo doesn't have the package up-to-date. I am trying to use only packages from AL2023 repo.