Skip to content

Do not stage .pc files in src/lib/, clean old generated *.pc files at 'make distclean', fix 'permission denied' errors #29082

@dimpase

Description

@dimpase

#29003 introduced 2-stage installation of generated *.pc files,
via src/lib/pkgconfig- but did not provide a way to clean them up at all. And this is a problem (cf. e.g. #29071).

Also, in some installations, repeated installations this code leads to 'permission denied' errors when trying to overwrite read-only files:

  [openblas-0.3.6.p0]   Wrote /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/var/tmp/sage/build/openblas-0.3.6.p0/inst/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/lib/pkgconfig/blas.pc
  [openblas-0.3.6.p0]   Wrote /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/var/tmp/sage/build/openblas-0.3.6.p0/inst/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/lib/pkgconfig/cblas.pc
  [openblas-0.3.6.p0]   Wrote /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/var/tmp/sage/build/openblas-0.3.6.p0/inst/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/lib/pkgconfig/lapack.pc
  [openblas-0.3.6.p0]   
  [openblas-0.3.6.p0]   real	8m40.259s
  [openblas-0.3.6.p0]   user	45m2.739s
  [openblas-0.3.6.p0]   sys	5m48.754s
  [openblas-0.3.6.p0]   Copying package files from temporary location /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/var/tmp/sage/build/openblas-0.3.6.p0/inst to /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local
  [openblas-0.3.6.p0]   cp: /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/./lib/pkgconfig/cblas.pc: Permission denied
  [openblas-0.3.6.p0]   cp: /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/./lib/pkgconfig/blas.pc: Permission denied
  [openblas-0.3.6.p0]   cp: /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/.tox/local-homebrew-minimal/local/./lib/pkgconfig/lapack.pc: Permission denied

This ticket revises the installation as follows:

  • configure no longer creates .pc files in the build tree
  • Instead it creates rules in make/Makefile that create the .pc files in SAGE_LOCAL.
  • Before pc files are installed into SAGE_LOCAL, the targets are removed, to avoid permission problems

This ticket does not solve everything. There may still be problems when switching from a system library to an spkg-provided library. We will use the follow-up ticket #29387 (Complete solution for installing the generated *.pc files) to address this problem.

CC: @embray @mkoeppe @jhpalmieri @vbraun @kiwifb

Component: build: configure

Author: Matthias Koeppe

Branch/Commit: 329843b

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/29082

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions