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

Ports: Building "file" fails due to version mismatch #18415

Closed
BenWiederhake opened this issue Apr 17, 2023 · 4 comments · Fixed by #24326
Closed

Ports: Building "file" fails due to version mismatch #18415

BenWiederhake opened this issue Apr 17, 2023 · 4 comments · Fixed by #24326
Labels
bug Something isn't working ports

Comments

@BenWiederhake
Copy link
Collaborator

Steps to reproduce:

  • Install Debian stable (or anything else that uses file in a version different from 5.44; Debian stable uses 5.39 at the time of writing)
  • Install the package file (which pulls in dependencies like libmagic1 and libmagic-mgc), take care to install version 5.39 (or any version other than 5.44)
  • Build serenity
  • In $SERENITY_ROOT/Ports/file, run ./package.sh

Expected behavior: Builds and installs just fine

Actual behavior: Fails to install, apparently it tries to use some host files; presumably the host magic files?

[file/build]   CC       dprintf.lo
<SNIP some warnings in funcs.c and der.c>
[file/build]   CCLD     libmagic.la
[file/build]   CCLD     file
[file/build] make.real[3]: Leaving directory '/home/user/serenity/Build/x86_64/Ports/file/file-5.44/src'
[file/build] make.real[2]: Leaving directory '/home/user/serenity/Build/x86_64/Ports/file/file-5.44/src'
[file/build] Making all in magic
[file/build] make.real[2]: Entering directory '/home/user/serenity/Build/x86_64/Ports/file/file-5.44/magic'
[file/build] Cannot use the installed version of file (5.39) to
[file/build] cross-compile file 5.44
[file/build] Please install file 5.44 locally first
[file/build] make.real[2]: *** [Makefile:862: magic.mgc] Error 1
[file/build] make.real[2]: Leaving directory '/home/user/serenity/Build/x86_64/Ports/file/file-5.44/magic'
[file/build] make.real[1]: *** [Makefile:462: all-recursive] Error 1
[file/build] make.real[1]: Leaving directory '/home/user/serenity/Build/x86_64/Ports/file/file-5.44'
[file/build] make.real: *** [Makefile:371: all] Error 2
Error in step file/build (status=2)

CC @supercomputer7, you seemed interested in this.

See also #18238.

@kleinesfilmroellchen kleinesfilmroellchen added the bug Something isn't working label May 26, 2023
@supercomputer7
Copy link
Member

supercomputer7 commented May 11, 2024

So I looked at this again today, we basically have 2 options:

  • Build file with the host compiler and use it for bootstrapping a cross-compiled version.
  • Remove this port if we don't want it anymore, as we have our own implementation (albeit it is lacking in the features' aspect).

I'd suggest trying the first option, but it's quite silly to require a natively-compiled version to do bootstrapping of a cross-compiled version (but then it's not doing that automatically).

@ADKaster
Copy link
Member

The ports for Python3 and Ruby also have this requirement, but we have scripts in Toolchain to build the host version from source. Requiring it for a utility like file does seem kinda silly though. Not sure what the best approach is. @timschumi What do you think? Toolchain/BuildFile.sh, or yeet the port?

@ADKaster ADKaster added the ports label May 11, 2024
@timschumi
Copy link
Member

We only rarely yeet ports, so of those two options I'd rather have a BuildFile.sh (or just some host_env trickery?).

@supercomputer7
Copy link
Member

We only rarely yeet ports, so of those two options I'd rather have a BuildFile.sh (or just some host_env trickery?).

I rather not add another build script (that is counter intuitive in my opinion, because this port is quite somewhat niche) just because some port requires a matched-version of the software it will compile.
Maybe we could bootstrap it when we actually build the port package, so it's done automatically in the port package script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ports
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants