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

perlPackages.XMLParser: Work around cross-compilation regression #75132

Merged
merged 1 commit into from Apr 7, 2020

Conversation

samueldr
Copy link
Member

@samueldr samueldr commented Dec 7, 2019

Since 2.44_01, the behaviour for check_lib in their Makefile.PL has
been "fixed" to fail when the assert_lib function fails to build the
test.

Now, this wouldn't be so bad, since it's good to actually test what
stuff is being compiled against.

Except that something is wonky with the cross-compilation build-time
Perl.

Undefined subroutine &File::Temp::mktemp called at inc/Devel/CheckLib.pm line 236.

As far as I know, this is a built-in function from Perl.

Though, something else is wrong with Checklib.pm. Side-stepping the
issue by (eww) shelling out to mktemp, we get these errors:


/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-armv7l-unknown-linux-gnueabihf-binutils-2.31.1/bin/armv7l-unknown-linux-gnueabihf-ld: assertlib_src1_0.553056903257133: file not recognized: file truncated
collect2: error: ld returned 1 exit status
 -I/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-expat-2.2.8-armv7l-unknown-linux-gnueabihf-dev/include -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-expat-2.2.8-armv7l-unknown-linux-gnueabihf/lib -lexpat
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-armv7l-unknown-linux-gnueabihf-binutils-2.31.1/bin/armv7l-unknown-linux-gnueabihf-ld: assertlib_src2_0.262169388446154: file not recognized: file truncated
collect2: error: ld returned 1 exit status
Can't link/include C library 'expat.h', 'expat', aborting.

Meanwhile, the actual build, while building the library, seemingly has
no issues building using those paths. ¯\_(ツ)_/¯

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @volth as de facto perl peep
cc anyone handy enough with perl :(
cc @matthewbauer @Ericson2314 who could have insight with cross-compilation
cc @flokli as he was doing cross-compilation and maybe had the same issue.

Since 2.44_01, the behaviour for `check_lib` in their `Makefile.PL` has
been "fixed" to fail when the `assert_lib` function fails to build the
test.

 * cpan-authors/XML-Parser@2bc1e90

Now, this wouldn't be so bad, since it's good to actually test what
stuff is being compiled against.

Except that *something* is wonky with the cross-compilation build-time
Perl.

```
Undefined subroutine &File::Temp::mktemp called at inc/Devel/CheckLib.pm line 236.
```

As far as I know, this is a built-in function from Perl.

 * https://perldoc.perl.org/File/Temp.html

Though, something *else* is wrong with `Checklib.pm`. Side-stepping the
issue by (eww) shelling out to `mktemp`, we get these errors:

```

/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-armv7l-unknown-linux-gnueabihf-binutils-2.31.1/bin/armv7l-unknown-linux-gnueabihf-ld: assertlib_src1_0.553056903257133: file not recognized: file truncated
collect2: error: ld returned 1 exit status
 -I/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-expat-2.2.8-armv7l-unknown-linux-gnueabihf-dev/include -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-expat-2.2.8-armv7l-unknown-linux-gnueabihf/lib -lexpat
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-armv7l-unknown-linux-gnueabihf-binutils-2.31.1/bin/armv7l-unknown-linux-gnueabihf-ld: assertlib_src2_0.262169388446154: file not recognized: file truncated
collect2: error: ld returned 1 exit status
Can't link/include C library 'expat.h', 'expat', aborting.
```

Meanwhile, the actual build, while building the library, seemingly has
no issues building using those paths. `¯\_(ツ)_/¯`
@samueldr samueldr added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Dec 7, 2019
@samueldr samueldr changed the base branch from master to staging December 7, 2019 04:18
@samueldr
Copy link
Member Author

samueldr commented Dec 7, 2019

I think it would be best if we can go forward with the update. Though I would prefer not using a workaround and fixing the upstream software, but the issue is way above my knowledge on how to fix upstream. Additionally, it seems that the implementation of CheckLib.pm (a bundled-in external component) is likely to blame and likely needs a revamp.

@FRidh FRidh added this to WIP in Staging via automation Dec 19, 2019
@FRidh FRidh moved this from WIP to Needs review in Staging Dec 19, 2019
@Ericson2314 Ericson2314 merged commit fd85e86 into NixOS:staging Apr 7, 2020
Staging automation moved this from Needs review to Done Apr 7, 2020
@samueldr samueldr deleted the fix/cross/perl-xmlparser branch April 7, 2020 21:31
@jonringer
Copy link
Contributor

this broke the build in staging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants