symbolic icon indicating copy to clipboard operation
symbolic copied to clipboard

Get `pkg test symbolic` working

Open cbm755 opened this issue 3 years ago • 7 comments

I think there is a new pkg test ... feature upstream. We should use it, speed up the deprecation of octsympy_tests.

I'd like to see it used in our CI. C.f., #1141 and #1060.

cbm755 avatar Jun 21 '22 16:06 cbm755

And just checked and this now works, presumably b/c of the #1060 fix. So I guess we can use it in CI for example

cbm755 avatar Jun 24 '22 21:06 cbm755

Still seems to run tests for all packages not just symbolic :( Doesn't happen locally

cbm755 avatar Jun 24 '22 23:06 cbm755

Still seems to run tests for all packages not just symbolic :( Doesn't happen locally

~Running docker exec oc octave-cli --eval "pkg test symbolic" in CI actually works!~

Actually, I commented out the wrong line of code. Indeed, the command runs tests outside of symbolic.

alexvong243f avatar Jun 27 '22 06:06 alexvong243f

Looks like an upstream bug to me. In m-file https://hg.savannah.gnu.org/hgweb/octave/file/04120d65778a/scripts/pkg/pkg.m, if we remove those ; in case "test"..., we can see the value of the variables:

installed_pkgs_lst =
{
  [1,1] =
    scalar structure containing the fields:
      name = symbolic
      version = 2.9.0+
      date = 2021-10-16
      author = Colin B. Macdonald <***@***.***>
      maintainer = Colin B. Macdonald <***@***.***>
      title = Octave Symbolic Package using SymPy
      description = Adds symbolic calculation features to GNU Octave.  These  include common Computer Algebra System tools such as algebraic operations,  calculus, equation solving, Fourier and Laplace transforms, variable  precision arithmetic and other features.  Compatibility with other symbolic  toolboxes is intended.
      categories = symbolic
      url = https://octave.sourceforge.io/symbolic
      depends =
      {
        [1,1] =
          scalar structure containing the fields:
            package = octave
            operator = >=
            version = 4.2
      }
      systemrequirements = python, sympy (>= 1.2), mpmath (>= 1.0)
      license = GPL-3.0-or-later
      dir = /usr/share/octave/packages/symbolic-2.9.0+
      archprefix = /usr
      loaded = 1
}
Testing functions in package 'symbolic':
installed_pkgs_dirs =
{
  [1,1] = /usr/share/octave/packages/symbolic-2.9.0+
  [1,2] = /usr
}
installed_pkgs_dirs =
{
  [1,1] = /usr/share/octave/packages/symbolic-2.9.0+
  [1,2] = /usr
}
installed_pkgs_dirs =
{
  [1,1] = /usr
  [1,2] = /usr/share/octave/packages/symbolic-2.9.0+
}

Here /usr is causing pkg test to look for m-file in /usr, which is why tests outside of symbolic run.

After some debugging, it appears m-file https://hg.savannah.gnu.org/hgweb/octave/file/04120d65778a/scripts/pkg/private/expand_rel_paths.m is causing the problem.

This part of the code

    if (strncmpi (pkg_list{i}.dir, "__OH__", 6))
      pkg_list{i}.dir = [ loc pkg_list{i}.dir(7:end) ];
      pkg_list{i}.archprefix = [ loc pkg_list{i}.archprefix(7:end) ];
    endif

never checks if "__OH__" is a prefix of pkg_list{i}.archprefix. It simply assumes so. In our case, pkg_list{i}.archprefix is empty, causing loc (which is /usr) to be prepended to the empty path.

alexvong243f avatar Jun 27 '22 12:06 alexvong243f

nice work! Can you file that upstream and link the issue number here? I guess we'll not be porting our makefile to pkg test quite yet.

cbm755 avatar Jun 27 '22 14:06 cbm755

Sure, the upstream bug is https://savannah.gnu.org/bugs/index.php?62681

alexvong243f avatar Jun 28 '22 22:06 alexvong243f

------- Original Message ------- On Friday, July 8th, 2022 at 11:06 AM, Markus Mützel @.***> wrote:

Update of bug #62681 (project octave):

Item Group: None => Unexpected Error or

Warning Status: Confirmed => Ready For Test


Follow-up Comment #15:

I pushed this change to create the prefix and arch_prefix directories independently from the build rules of the package that is about to be installed: https://hg.savannah.gnu.org/hgweb/octave/rev/65c4d98352d3

That should be fixing the underlying issue that we figured out with your help. (Much appreciate it.)

Additionally, I pushed a slightly different patch from the change you proposed in comment #1 here: https://hg.savannah.gnu.org/hgweb/octave/rev/cf5f46b2e052

That should also work correctly if "OH" happens to be an actual part of the path of those prefixes (and is not the replacement prefix).

Marking as ready for test.


Reply to this item at:

https://savannah.gnu.org/bugs/?62681


Message sent via Savannah https://savannah.gnu.org/

alexvong243f avatar Jul 10 '22 07:07 alexvong243f

Upstream bug https://savannah.gnu.org/bugs/index.php?62681 fixed:

------- Original Message ------- On Tuesday, July 19th, 2022 at 7:18 AM, Markus Mützel @.***> wrote:

Update of bug #62681 (project octave):

Status: Ready For Test => Fixed

Open/Closed: Open => Closed


Follow-up Comment #19:

Thanks for testing again.

Closing as fixed.


Reply to this item at:

https://savannah.gnu.org/bugs/?62681


Message sent via Savannah https://savannah.gnu.org/

alexvong243f avatar Sep 07 '22 08:09 alexvong243f

Fixed in 3070c07f79ff749158a3f3e239c467ddffec7787

alexvong243f avatar Sep 07 '22 08:09 alexvong243f