Bug 279345 - ports-mgmt/pkg: 1.21.3 will not build: missing pkg_repos.h
Summary: ports-mgmt/pkg: 1.21.3 will not build: missing pkg_repos.h
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-27 03:21 UTC by John Marshall
Modified: 2024-05-28 08:36 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (pkg)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Marshall 2024-05-27 03:21:36 UTC
pkg_config.c:49:10: fatal error: 'pkg_repos.h' file not found
   49 | #include "pkg_repos.h"
      |          ^~~~~~~~~~~~~

I can't find the file either.
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2024-05-27 07:42:11 UTC
the package has been built properly on the cluster, which means everything is there, it is probably something on your side.
Comment 2 John Marshall 2024-05-27 09:56:36 UTC
(In reply to Baptiste Daroussin from comment #1)

The build failed on two systems (14.1-STABLE: one amd64, one i386). As I said above, I can't find it either. I looked in the port's working direcotry and directly in the distribution file and I can't find it. Is it possible that the header file lives in the live filesystem on the build cluster (but not in the package)?

rwsrv08# find /build/ports/kits/ports/ports-mgmt/pkg/work/pkg-1.21.3 -type f -name pkg_repos\*
/build/ports/kits/ports/ports-mgmt/pkg/work/pkg-1.21.3/docs/pkg_repos.3
rwsrv08#

rwsrv08> tar -tf freebsd-pkg-1.21.3_GH0.tar.gz \*/pkg_repos\*
pkg-1.21.3/docs/pkg_repos.3
rwsrv08> 

Where is it meant to be?

Thank you.
Comment 3 Baptiste Daroussin freebsd_committer freebsd_triage 2024-05-27 10:07:40 UTC
https://github.com/freebsd/pkg/blob/main/libpkg/repo/Makefile.autosetup

pkg_repos.h is created dynamically at build time, hence why I say this must be coming from your side.

to be able to help you I will need more information:
How to you build pkg:
- manually
- poudriere
- other way

What ever mean you have used to build pkg, I would been the full build log.
Comment 4 John Marshall 2024-05-27 10:41:47 UTC
(In reply to Baptiste Daroussin from comment #3)

Thank you, Baptiste.

Manual build with make(1). The output from a script(1) session can be found at the following link.

http://www.jmarshall.id.au/~john/ports/pkg1.21.3/pkg_build_log
Comment 5 Baptiste Daroussin freebsd_committer freebsd_triage 2024-05-27 11:36:15 UTC
it sounds like a race, how many CPU to you have? can you try building in the ports tree with: make MAKE_JOBS_UNSAFE=1
Comment 6 John Marshall 2024-05-27 11:50:44 UTC
(In reply to Baptiste Daroussin from comment #5)

8 CPU's on the 64-bit machine, 2 cpu's on the 32-bit. I was not using 'make -j' but I tried 'make MAKE_JOBS_UNSAFE=1' anyway (because you askewd). No difference in the log apart from the script(1) start and stop times.

Here is the second log
http://www.jmarshall.id.au/~john/ports/pkg1.21.3/pkg_build_log_2

Here is the diff between the logs:
rwsrv08# diff  ~john/web/pub/ports/pkg1.21.3/pkg_build_log*
1,2c1,2
< Script started on Mon May 27 20:27:51 2024
< Command: make -C ports-mgmt/pkg
---
> Script started on Mon May 27 21:39:20 2024
> Command: make MAKE_JOBS_UNSAFE=1 -C ports-mgmt/pkg
167d166
< --- all ---
293c292
< Script done on Mon May 27 20:28:11 2024
---
> Script done on Mon May 27 21:39:40 2024
rwsrv08#
Comment 7 Baptiste Daroussin freebsd_committer freebsd_triage 2024-05-27 11:58:16 UTC
sorry, I have no idea, how I can help here. I have checked, FreeBSD 14.1, 14.0 13.2, 13.3 and current and succeed in building pkg from the ports tree.

I tried manually with make, and I tried with poudriere, I have no more ideas here.
Comment 8 John Marshall 2024-05-27 12:57:39 UTC
(In reply to Baptiste Daroussin from comment #7)

OK. Thanks heaps for your time bapt. I really appreciate you looking at this.

I just patched ports-mgmt/pkg in my ports tree to take it back to 3d57467ec90e (1.21.2) and tried building that. It no longer builds either, and falls over with the same error :-(

Ball's in my court. Really weird that the same thing is happening on two separate servers. Thanks again for your time. Sorry for the noise :-(
Comment 9 John Marshall 2024-05-27 23:00:22 UTC
Guilty!

- I had introduced local.sys.mk files on both systems (fine)
- Inspired by other .mk files, I had wrapped it in '.if !target()' (bad)

- If I removed local.sys.mk, I could build pkg.
- If I replaced local.sys.mk with an empty file, I could build pkg.
- If I introduced a single line with a target (__<local.sys.mk>__:), the build of pkg would break.

It seems that having a target in local.sys.mk is bad news. I have replaced that conditional wrapper with '.if !defined()' and the world is happy again.

Thank you Baptiste for giving some of your time to help me. Sorry again for the noise.