Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • scilab scilab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 2,562
    • Issues 2,562
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 47
    • Merge requests 47
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • scilabscilab
  • scilabscilab
  • Issues
  • #15918
Closed
Open
Issue created Dec 27, 2018 by scilab bot@scilabbot💬Owner

mylib = lib(libdir) registers functions in the default library instead of in the LHS one

Reported by Samuel GOUGEON (@sgougeon)

BUG DESCRIPTION:
----------------
Let mylib be a library generated with genlib("mylib"). This makes "mylib" the default library name, recorded in the lib file.

In Scilab 5.5, when we call
myLIB = lib(libdir)
the functions are registered in as members of the myLIB library, not of the mylib one.
Then, whereis("a_function_of_the_lib") returns myLIB, not mylib.
This is consistent, and allows calls such as libraryinfo(whereis("a_function_of_the_lib")).

In Scilab 6.0, lib() registers functions in mylib, while the only handle generated is the LHS one, so myLIB.
Hence, "mylib" is an unknown identifier: whereis("a_function_of_the_lib") returns it,
but libraryinfo(whereis("a_function_of_the_lib")) fails!
This makes hardly trackable issues, noticeably in external modules..!

--> path = TMPDIR+"\tmp\";
--> mkdir(path);
--> mputl("function myfun(), disp(""1234""); endfunction",path+"myfun.sci");
--> genlib("myfunlib", path);
--> clear myfunlib
--> myLIB = lib(path);
--> myfun()
 1234
--> whereis("myfun")
 ans  =
 myfunlib

--> myfunlib
Undefined variable : myfunlib


ERROR LOG:
----------
Wrong behavior


HOW TO REPRODUCE THE BUG:
-------------------------
path = TMPDIR+"\tmp\";
mkdir(path)
mputl("function myfun(), disp(""1234""); endfunction",path+"myfun.sci")
genlib("myfunlib", path);
clear myfunlib
myLIB = lib(path);
myfun()
whereis("myfun")
myfunlib


OTHER INFORMATION:
------------------
Bug detected where porting the SIMM module to Scilab 6. 
As well, some issues in loading Celestlab in Scilab 6 could come from this bug.
Assignee
Assign to
Time tracking