|
229 | 229 | make install
|
230 | 230 | install_license /usr/share/licenses/libuv/LICENSE
|
231 | 231 | """
|
232 |
| - build_output_meta = do_build(build_path, script, platform, gcc_version) |
| 232 | + build_output_meta = @test_logs (:info, "Building for $(triplet(platform))") (:warn, r"Linked library libgcc_s.so.1") match_mode=:any do_build(build_path, script, platform, gcc_version) |
233 | 233 | # Extract our platform's build
|
234 | 234 | @test haskey(build_output_meta, platform)
|
235 | 235 | tarball_path, tarball_hash = build_output_meta[platform][1:2]
|
|
470 | 470 |
|
471 | 471 | mktempdir() do build_path
|
472 | 472 | hello_world = ExecutableProduct("hello_world_fortran", :hello_world_fortran)
|
473 |
| - build_output_meta = @test_logs (:warn, r"CompilerSupportLibraries_jll") match_mode=:any begin |
| 473 | + build_output_meta = @test_logs (:warn, r"CompilerSupportLibraries_jll") (:warn, r"Linked library libgfortran.so.5") (:warn, r"Linked library libquadmath.so.0") (:warn, r"Linked library libgcc_s.so.1") match_mode=:any begin |
474 | 474 | autobuild(
|
475 | 475 | build_path,
|
476 | 476 | "hello_fortran",
|
|
488 | 488 | [platform],
|
489 | 489 | #
|
490 | 490 | Product[hello_world],
|
491 |
| - # No dependencies |
| 491 | + # Note: we purposefully don't require CompilerSupportLibraries, even if we |
| 492 | + # should, but the `@test_logs` above makes sure the audit warns us about |
| 493 | + # this problem. |
492 | 494 | Dependency[];
|
493 | 495 | )
|
494 | 496 | end
|
@@ -518,14 +520,20 @@ end
|
518 | 520 | @test_logs (:warn, r"links to libgfortran!") match_mode=:any begin
|
519 | 521 | @test !Auditor.audit(Prefix(testdir); platform=BinaryBuilderBase.abi_agnostic(platform), autofix=false)
|
520 | 522 | # Make sure audit is otherwise happy with the executable
|
521 |
| - @test Auditor.audit(Prefix(testdir); platform=platform, autofix=false) |
| 523 | + # Note by Mosè: this test was introduced before |
| 524 | + # https://github.com/JuliaPackaging/BinaryBuilder.jl/pull/1240 and relied on the |
| 525 | + # fact audit was ok with not depending on CSL for packages needing GCC |
| 526 | + # libraries, but that was a fallacious expectation. At the moment I don't know |
| 527 | + # how to meaningfully use this test, leaving here as broken until we come up |
| 528 | + # with better ideas (just remove the test?). |
| 529 | + @test Auditor.audit(Prefix(testdir); platform=platform, autofix=false) broken=true |
522 | 530 | end
|
523 | 531 |
|
524 | 532 | # Let's pretend that we're building for a different libgfortran version:
|
525 | 533 | # audit should warn us.
|
526 | 534 | libgfortran_versions = (3, 4, 5)
|
527 | 535 | other_libgfortran_version = libgfortran_versions[findfirst(v -> v != our_libgfortran_version.major, libgfortran_versions)]
|
528 |
| - @test_logs (:warn, Regex("but we are supposedly building for libgfortran$(other_libgfortran_version)")) readmeta(hello_world_path) do oh |
| 536 | + @test_logs (:warn, Regex("but we are supposedly building for libgfortran$(other_libgfortran_version)")) (:warn, r"Linked library libgfortran.so.5") (:warn, r"Linked library libquadmath.so.0") (:warn, r"Linked library libgcc_s.so.1") readmeta(hello_world_path) do oh |
529 | 537 | p = deepcopy(platform)
|
530 | 538 | p["libgfortran_version"] = "$(other_libgfortran_version).0.0"
|
531 | 539 | @test !Auditor.audit(Prefix(testdir); platform=p, autofix=false)
|
|
624 | 632 | @test length(libfoo_rpaths) == 1 broken=Sys.isapple(platform)
|
625 | 633 | end
|
626 | 634 | end
|
| 635 | + |
| 636 | + @testset "GCC libraries" begin |
| 637 | + platform = Platform("x86_64", "linux"; libc="glibc", libgfortran_version=v"5") |
| 638 | + mktempdir() do build_path |
| 639 | + build_output_meta = nothing |
| 640 | + @test_logs (:info, "Building for $(triplet(platform))") match_mode=:any begin |
| 641 | + build_output_meta = autobuild( |
| 642 | + build_path, |
| 643 | + "rpaths", |
| 644 | + v"2.0.0", |
| 645 | + # No sources |
| 646 | + FileSource[], |
| 647 | + # Build two libraries, `libbar` in `${libdir}/qux/` and `libfoo` in |
| 648 | + # `${libdir}`, with the latter linking to the former. |
| 649 | + raw""" |
| 650 | + # Build fortran hello world |
| 651 | + make -j${nproc} -sC /usr/share/testsuite/fortran/hello_world install |
| 652 | + # Install fake license just to silence the warning |
| 653 | + install_license /usr/share/licenses/libuv/LICENSE |
| 654 | + """, |
| 655 | + [platform], |
| 656 | + # Ensure our library products are built |
| 657 | + [ExecutableProduct("hello_world_fortran", :hello_world_fortran)], |
| 658 | + # Dependencies: add CSL |
| 659 | + [Dependency("CompilerSupportLibraries_jll")]; |
| 660 | + autofix=true, |
| 661 | + ) |
| 662 | + end |
| 663 | + # Extract our platform's build |
| 664 | + @test haskey(build_output_meta, platform) |
| 665 | + tarball_path, tarball_hash = build_output_meta[platform][1:2] |
| 666 | + # Ensure the build products were created |
| 667 | + @test isfile(tarball_path) |
| 668 | + # Ensure reproducibility of build |
| 669 | + @test build_output_meta[platform][3] == Base.SHA1("06ddfbeb9914a534ed3f21795b5da5b536d33c16") |
| 670 | + |
| 671 | + # Unpack it somewhere else |
| 672 | + @test verify(tarball_path, tarball_hash) |
| 673 | + testdir = joinpath(build_path, "testdir") |
| 674 | + mkdir(testdir) |
| 675 | + unpack(tarball_path, testdir) |
| 676 | + # Make sure auditor set the rpath of `hello_world`, even if it links only to |
| 677 | + # libgfortran. |
| 678 | + @test Auditor._rpaths(joinpath(testdir, "bin", "hello_world_fortran")) == ["\$ORIGIN/../lib"] |
| 679 | + end |
| 680 | + end |
627 | 681 | end
|
628 | 682 |
|
629 | 683 | @testset "Auditor - execution permission" begin
|
|
0 commit comments