Skip to content

pcre: fix hardwired reference to /usr/bin/file in configure#166539

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

pcre: fix hardwired reference to /usr/bin/file in configure#166539
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Mar 31, 2022

The configure script that ships with pcre expects to be able to use
"file", via the hardwired path "/usr/bin/file". When cross-compiling
in a sandboxed build this will cause it to mis-detect the ability to
create shared libraries.

Let's fix this, and perform the substitution only for cross compiles,
in order to avoid a mass-rebuild.

Currently this problem is preventing Hydra from generating the
bootstrap tarball for mips64el-linux-gnuabi64.

Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • mips64-linux-gnuabi64, cross from x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

The configure script that ships with pcre expects to be able to use
"file", via the hardwired path "/usr/bin/file". When cross-compiling
in a sandboxed build this will cause it to mis-detect the ability to
create shared libraries.

Let's fix this, and perform the substitution only for cross compiles,
in order to avoid a mass-rebuild.

Currently this problem is preventing Hydra from generating the
bootstrap tarball for mips64el-linux-gnuabi64.

The configure script that ships with pcre expects to be able to use
"file", via the hardwired path "/usr/bin/file".  When cross-compiling
in a sandboxed build this will cause it to mis-detect the ability to
create shared libraries.

Let's fix this, and perform the substitution only for cross compiles,
in order to avoid a mass-rebuild.

Currently this problem is preventing Hydra from generating the
bootstrap tarball for mips64el-linux-gnuabi64.
@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 31, 2022

The failure which occurs without this commit can be found here:

./configure: line 9843: /usr/bin/file: No such file or directory
./configure: line 9851: /usr/bin/file: No such file or directory
./configure: line 9859: /usr/bin/file: No such file or directory

leading to:

checking whether to build shared libraries... no

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 31, 2022

@ofborg build pkgsCross.mips64el-linux-gnuabi64.pcre

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 31, 2022

Yep, it built:

shrinking /nix/store/7ggx4sdpad6smyq9rmrr141q571sxkz2-pcre-mips64el-linux-gnuabi64-8.45/lib/libpcre.so.1.2.13

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 31, 2022

@ofborg build this-is-a-kludge

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 31, 2022

The problem appears to come from the code below. Apparently when cross-compiling to some platforms, autoconf uses file to figure out certain things about the host platform.

mips64*-*linux*)
  # Find out what ABI is being produced by ac_compile, and set linker
  # options accordingly.
...
  test $ac_status = 0; }; then
    emul=elf
    case `/usr/bin/file conftest.$ac_objext` in

It does this for most linux-kernel host platforms, including x86_64, mips64el, sparc, and powerpc, but not for aarch64, which is probably why we haven't noticed it before.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Mar 31, 2022
@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 31, 2022

Ugh, the same problem happens elsewhere.

I need to fix this at the source, in libtool.

@ghost ghost closed this Mar 31, 2022
@ghost ghost deleted the pcre-needs-usr-bin-file branch January 23, 2024 06:46
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants