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

apt does not build in Xcode 16 #1196

Open
sth0 opened this issue Dec 19, 2024 · 19 comments
Open

apt does not build in Xcode 16 #1196

sth0 opened this issue Dec 19, 2024 · 19 comments

Comments

@sth0
Copy link
Contributor

sth0 commented Dec 19, 2024

apt thinks the compiler is bad in both Xcode 16.1 and 16.2 is not competent. Possibly this is the same not having a return value for int in main(){}. And configure needs to be patched. But haven't had time to check this out tonight.

checking whether the C compiler (gcc   -Wl,-headerpad_max_install_names) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
### execution of ./configure failed, exit code 1
### execution of /tmp/fink.ICyDd failed, exit code 1

Attaching complete fink output
fink-apt.txt

@dhomeier
Copy link
Contributor

dhomeier commented Dec 19, 2024

The specific failure from config.log is

configure:775: checking whether the C compiler (gcc   -Wl,-headerpad_max_install_names) works
configure:791: gcc -o conftest    -Wl,-headerpad_max_install_names conftest.c  1>&5
configure:788:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  788 | main(){return(0);}
      | ^
      | int
1 error generated.

Adding
SetCFLAGS: -std=gnu90
lets this build on x86_64, but arm64 is not recognised; so either ConfigureParams have to be tweaked to use --host=arm-apple-darwin, or config.sub patched e.g. like this:

 perl -pi -e 's/(arm \|)/$1 arm64 \|/;s/(arm-\* \|)/$1 arm64-\* \|/' %b/buildlib/config.sub

This is with command line tools updated to 16.2 as well, but I doubt that's critical.

N.b. Fink's version is nearly a quarter century old, surprised it even knows about arm; I got the "current" (2020) Debian version to patch and build some of the way, but am currently failing at Built target apt-man – can post the WIP info files if anyone is interested to work on this.

@dhomeier
Copy link
Contributor

patching file 'apt-pkg/pkgsystem.h'
perl -pi -e 's|vector.h|vector|g' apt-pkg/pkgsystem.h include/apt-pkg/pkgsystem.h
Can't open include/apt-pkg/pkgsystem.h: No such file or directory, <> line 97.

The second argument does not exist and should be removed from the patch script.

@sth0
Copy link
Contributor Author

sth0 commented Dec 19, 2024

I patched config to have int main(){} and it now gets past that but configure fails on arm64 systems. I think config guess is way out of date? After trying to add arm64 arch to dot-info file similar to x86_64, I get the following architecture error:

checking for arm64-apple-darwin24-ar... no
checking for ar... ar
checking for library containing gethostbyname... none required
checking for library containing connect... none required
checking for db2/db.h... no
checking system architecture... configure: error: failed: use --host=
### execution of ./configure failed, exit code 1

Looks like the current release is 2.4.14 https://salsa.debian.org/apt-team/apt/-/branches and we are using 0.5.4?

@TheSin-
Copy link
Member

TheSin- commented Dec 19, 2024

try apt in my exp, it's been a while but I think I had it working at one point for arm64 and updated config stuff

@sth0
Copy link
Contributor Author

sth0 commented Dec 19, 2024

Will look at that branch. How do I find that branch?

@sth0
Copy link
Contributor Author

sth0 commented Dec 19, 2024

Looks like that branch needs a bunch of extra unsatisified dependencies. debiandoc-sgml, po4a etc. that do not have arm64 / macOS 15 versions.

and deb helper

@TheSin-
Copy link
Member

TheSin- commented Dec 19, 2024

they are all in there likely just need a list added I don't use apt since we don't have a bindist anymore so I likely haven't upkeep them. I started it all 15 years ago when I start the dpkg update

@TheSin-
Copy link
Member

TheSin- commented Dec 19, 2024

deb helper should be in there now it was part of the dpkg update, I'll have to move it over.

@dhomeier
Copy link
Contributor

dhomeier commented Dec 19, 2024

I patched config to have int main(){} and it now gets past that but configure fails on arm64 systems. I think config guess is way out of date? After trying to add arm64 arch to dot-info file similar to x86_64, I get the following architecture error:

Yes, this: #1196 (comment)

Alternatively, and maybe better, could also copy in Fink's %p/lib/fink/update/config.sub.

@sth0
Copy link
Contributor Author

sth0 commented Dec 19, 2024

I don't use apt since we don't have a bindist anymore so I likely haven't upkeep them. I started it all 15 years ago when I start the dpkg update

AFAICT, the fink remove --recursive needs apt. I was trying to cleanup some buildlocks on my system and fink was failing by not being able to call apt. So it sort of seems necessary for the operation of fink. I was surprised that it was not installed during the bootstrap process.

@TheSin-
Copy link
Member

TheSin- commented Dec 19, 2024

yeah I just use dpkg for that, but I know apt is more convenient, I'll see if I can find time to update it.

@sth0
Copy link
Contributor Author

sth0 commented Dec 19, 2024

If fink would call dpkg rather than apt that is another solution. I got into a big loop of updating packages required for apt that seemed to be temporary names etc. Like "dh-autoreconf"'

and "dh-strip-nondeterminism" which I don't have anywhere.

@TheSin-
Copy link
Member

TheSin- commented Dec 19, 2024

those are deb helper modules, they are all in my exp

@sth0
Copy link
Contributor Author

sth0 commented Dec 19, 2024

found dh-autoreconf, but not dh-strip-nondeterminism. But it seems that this includes a large number of new packages and a lot of testing.

@TheSin-
Copy link
Member

TheSin- commented Dec 19, 2024

I've been running it for 15 years, it's how I port things, I added the deb helper so it uses all the Debian build rules, make life so much easier.

@sth0
Copy link
Contributor Author

sth0 commented Dec 20, 2024

Then at some point these packages should be incorporated into the master fink tree. If all these packages are necessary for building apt. Or apt should be removed as a function of the main fink program and declared a non-functional package. It is great that those tools allow you to port things easily, but if it ends up being a secret shadow version of fink, that is somewhat counter productive.

@TheSin-
Copy link
Member

TheSin- commented Dec 20, 2024

absolutely and that was always the intent, but with 15 years for my PR to get accepted I kinda wanted to revisit some of them and update them a little first. This time a year is uber busy for me so I'll try to get to em and slowly start to add all the dh packages.

@sth0
Copy link
Contributor Author

sth0 commented Dec 20, 2024

No rush, I don't actually need apt at the moment. I was trying to get rid of a nasty buildlock and ran into fink not working. It is not necessary at the moment for the actual utilities I am trying to build under Sequoia.

@dhomeier
Copy link
Contributor

dhomeier commented Dec 20, 2024

Can still use the patched 0.5.4 from here until the update is ready.
It is still quite useful to have when fink gives you the usual blurb about fixing conflicting package deps.

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

No branches or pull requests

3 participants