Skip to content
Tcl Source Code History Of Ticket 6b3618ed9363e6038df3efc113093eef9a86323c
Login

History Of Ticket 6b3618ed9363e6038df3efc113093eef9a86323c

Artifacts Associated With Ticket 6b3618ed9363e6038df3efc113093eef9a86323c

  1. Ticket change [75bbf55e87] (rid 164800) by anonymous29 on 2018-08-03 05:55:24:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      i am updating tcl from 8.4.13 to 8.6.8. 
      i am getting error "can't find package opt 0.1". 
      when i replace 
      package unknown {::tcl::tm::UnknownHandler ::tclPkgUnknown} 
      by
      package unknown {tclPkgUnknown}
      in init.tcl file, 
      No error seen. 
      How can i fix this error ?
      
    5. foundin initialized to: "8.6.8"
    6. is_private initialized to: "0"
    7. login: "anonymous29"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "f31bbee5d57cdca64b0ff5fb39afeb99e5f9c194"
    10. resolution initialized to: "None"
    11. severity initialized to: "Critical"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous29"
    14. subsystem initialized to: "- New Builtin Commands"
    15. title initialized to: "can't find package opt 0.1"
    16. type initialized to: "Bug"
  2. Ticket change [500c20ceab] (rid 164801) by sebres on 2018-08-03 08:26:07:

    1. icomment:
      It looks like you may have a "broken" pkgIndex.tcl (or tclIndex) that avoid correct loading of all expected packages...
      Or just a wrong dependencies or version conflict somewhere in your tcl-library.
      
      Since 8.5 Tcl provides package opt with version >= 0.4. Do you see opt/pkgIndex.tcl somewhere?
      
      What do you see if you evaluate `package require opt` in the tclsh?
      If you get an error, what is the output of `set ::errorInfo`?
      
      The order how the packages are loaded is dependend from `set ::auto_path`, this simple script provides output which they may be (not auto_path can be changed during loading process):
      
      foreach p $::auto_path {
        foreach p [glob -nocomplain -directory $p pkgIndex.tcl */pkgIndex.tcl] {puts $p}
      }
      
      If you've another package with name opt, please remove or rename it (if it's your own).
      Also to find the possible evil-doers search inside tcl-library for "opt 0.1" (maybe even with "-exact" prefixed).
      
    2. login: "sebres"
    3. mimetype: "text/plain"
  3. Ticket change [707d63fa91] (rid 164802) by anonymous29 on 2018-08-03 09:11:14:

    1. icomment:
      Thanks sebres  for your comments
      
      below is the out of command which u suggested  
      > package require opt 0.1
      can't find package opt 0.1
      
      > set ::errorInfo
      can't find package opt 0.1
          while executing
      "package require opt 0.1"
      
      > set ::auto_path
      tools/inca/files/tcl/library
      tools/inca/files/tcl
      tools/lib
      libs/tcl/library
      
      Yes "opt/pkgIndex.tcl" present in <path>/tcl8.6.8 directory.
      symbolic link present in tools/inca/files/tcl/library
      i.e 
      tools/inca/files/tcl/library/opt/pkgIndex.tcl -> <path>/tcl/library/opt/pkgIndex.tcl
      tools/inca/files/tcl/library/opt/optparse.tcl -> <path>/tcl/library/opt/optparse.tcl
      
      How can i use this information to debug further ?
      Thanks
      
    2. login: "anonymous29"
    3. mimetype: "text/plain"
  4. Ticket change [812dfbef67] (rid 164803) by anonymous29 on 2018-08-03 09:14:00:

    1. icomment:
      <path>/tcl/library/opt/optparse.tcl means <path>/tcl8.6.8/library/opt/optparse.tcl
      
      tcl -> tcl8.6.8
      
    2. login: "anonymous29"
    3. mimetype: "text/plain"
  5. Ticket change [8cd7b9c424] (rid 164804) by sebres on 2018-08-03 09:54:50:

    1. icomment:
      I suggested to test `package require opt` and not `package require opt 0.1`...
      
      I don't completely understand what you try to explain here, so please provide the output of script I wrote below (starting with foreach p ...).
      Or check that opt/pkgIndex.tcl is definitely in this output.
      
      Additionally try to load this index directly:
      
      % source <path>/tcl/library/opt/pkgIndex.tcl
      % package require opt
      
      if it fails, provide errorInfo.
      
      You can also try to invoke the script parts defined as ifneeded in pkgIndex directly, like:
      
      % package vsatisfies [package provide Tcl] 8.2
      % source [file join <path>/tcl/library/opt optparse.tcl]
      
      What do you see there? If it fails, provide errorInfo after each command that fails.
      
    2. login: "sebres"
    3. mimetype: "text/plain"
  6. Ticket change [3b71f8ab29] (rid 164807) by anonymous29 on 2018-08-03 11:20:22:

    1. icomment:
      Hi sebres,
      below is the ouput of commands
      
      > foreach p $::auto_path {
      >   foreach p [glob -nocomplain -directory $p pkgIndex.tcl */pkgIndex.tcl] {puts $p}
      > }
      /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/tcltest/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/opt/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/dde/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/dde1.1/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/http/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/http1.0/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/http2.3/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/msgcat/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/msgcat1.0/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/platform/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/reg/pkgIndex.tcl
      /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/tcltest/pkgIndex.tcl
      
      > source /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt/pkgIndex.tcl
      can't read "dir": no such variable.
          while executing
      "file join $dir optparse.tcl"
          (file "/dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt/pkgIndex.tcl" line 12)
          invoked from within
      "source /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt/pkgIndex.tcl"
      
      > set ::errorInfo
      can't read "dir": no such variable
          while executing
      "file join $dir optparse.tcl"
          (file "/dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt/pkgIndex.tcl" line 12)
          invoked from within
      "source /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt/pkgIndex.tcl"
      
      > package require opt
      can't find package opt.
      
      > set ::errorInfo
      can't find package opt
          while executing
      "package require opt"
      > package vsatisfies [package provide Tcl] 8.2
      1
      
      > source [file join /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt optparse.tcl]
      
      > set ::errorInfo
      can't find package opt
          while executing
      "package require opt"
      
      > exit
      
      Thanks
      
    2. login: "anonymous29"
    3. mimetype: "text/plain"
  7. Ticket change [9b2430aaf8] (rid 164808) by sebres on 2018-08-03 11:49:34:

    1. icomment:
      So I see at least 2 pkgIndex for opt:
      <ul><li>/dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/opt/pkgIndex.tcl
      </li><li>/dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt/pkgIndex.tcl
      </li></ul>
      
      Have you compared both (that are text/tcl-source)?...
      
      Is there another package called opt?
      
      If you loads it directly (specify dir-var to each directory), can you then use package:
      <code><pre style="padding-left:10pt">
      set dir /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/opt; source $dir/pkgIndex.tcl
      package require opt
      </pre></code>
      and (in new shell):
      <code><pre style="padding-left:10pt">
      set dir /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt; source $dir/pkgIndex.tcl
      package require opt
      </pre></code>
      
      If it's not your project/software where you tries to upgrade tcl, please contact the maintainer of this project/software.
      
      For example some binaries could be not compatible anymore and should be rebuild.
      Additionally as already said if you have another (not tcl-default) package "opt", it should be renamed resp. all references corrected in the source code.
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [4edf7793ab] (rid 164810) by anonymous29 on 2018-08-03 13:32:35:

    1. icomment:
      Actually both pkgIndex.tcl is same because 
      /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/ is installation directory 
      and there is symbolic link from installation directory to tcl source directory
      (/dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/opt/pkgIndex.tcl -> /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt/pkgIndex.tcl)
       
      Terminal 1:
      > set dir /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/opt; source $dir/pkgIndex.tcl
      > package require opt
      0.4.6
      > exit
      
      Terminal 2:
      > set dir /dv/p4users06nd/arvindk/tcl16/inca/src/libs/tcl/library/opt; source $dir/pkgIndex.tcl
      > package require opt
      0.4.6
      > exit
      
      There is not any other opt directory
      
    2. login: "anonymous29"
    3. mimetype: "text/plain"
  9. Ticket change [604dd8e0bb] (rid 164813) by sebres on 2018-08-03 14:46:28:

    1. icomment:
      So it works by direct loading of package index...
      The question is: why does not work on demand.
      
      It looks like some module tries to load package opt (possibly on demand within pkgIndex/tclIndex) BEFORE auto_path is properly set, or just some similar issue.
      
      1. Simple try (as already said in my first comment):
      <p style="margin-left:10pt; border-left:1px solid gray; padding-left:3pt">
      Also to find the possible evil-doers search inside tcl-library for "opt 0.1" (maybe even with "-exact" prefixed).
      </p>
      2. More complex try:<br/>
      Insert following code into begin of init.tcl and try again to start or do package require opt...
      <code><pre style="padding-left:10pt">
      ## ----------------------------------------------------------------------------
      ## inject to trace all-sources:
      if {[namespace which -command ::_org_source] eq ""} {
        rename ::source ::_org_source
        proc ::source {args} {
          ::puts "** DBG:[string repeat "  " [info level]]** [linsert $args 0 ::source] **"
          if {[catch {
            uplevel 1 [linsert $args 0 [set args ::_org_source]]
          } err opt]} {
            ::puts "** ERR: $::errorInfo"
            return {*}$opt $err
          }
          ::puts "** DBG:[string repeat "  " [info level]]** \[OK\] **"
        }
      }
      ## /inject
      ## ----------------------------------------------------------------------------
      </pre></code>
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  10. Ticket change [7746156b0f] (rid 164816) by anonymous29 on 2018-08-03 18:57:45:

    1. icomment:
      Hi,
      Getting below output after adding (2. More complex try:)
      
      ** DBG:      ** ::source /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/strobe.tcl **
      ** DBG:      ** [OK] **
      > source /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/xmsimrc
      ** DBG:        ** ::source /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/tcl/library/history.tcl **
      ** DBG:        ** [OK] **
      ** DBG:  ** ::source /dv/p4users06nd/arvindk/tcl16/dvproject/dep/tools/inca/files/xmsimrc **
      ** DBG:  ** [OK] **
      
      > package require opt
      can't find package opt.
      
      > exit
      
      Thanks,
      
    2. login: "anonymous29"
    3. mimetype: "text/plain"
  11. Ticket change [89230d1424] (rid 164817) by sebres on 2018-08-04 22:29:02:

    1. closedate changed to: "2458335.43682976"
    2. closer changed to: "sebres"
    3. icomment:
      I cannot follow what you try to source here...
      
      Anyway if it is all what you see there, you have something other as normal Tcl-installation (some special project-based build or similar).
      I think your init.tcl/package.tcl are not the default version (or injected by the project, or something similar).
      Or just the program you trying to use is not default tcl (so can do another things as in standard release like manipulate auto_path, rewrite loading mechanisms, etc).
      For example why your prompt started with `>` (in opposite to tclsh/wish/etc where it is `%`)?
      
      Below you'll find how it looks on mainstream tcl8.6 by `package require opt`:
      <code><pre style="padding-left:10pt">
      % package require opt
      ** DBG:        ** ::source /path-to-tcl/library/history.tcl **
      ** DBG:        ** [OK] **
      ** DBG:        ** ::source /path-to-tcl/library/tm.tcl **
      ** DBG:        ** [OK] **
      ** DBG:        ** ::source /path-to-tcl/library/package.tcl **
      ** DBG:        ** [OK] **
      ** DBG:    ** ::source /path-to-tcl/library/http/pkgIndex.tcl **
      ** DBG:    ** [OK] **
      ** DBG:    ** ::source /path-to-tcl/library/http1.0/pkgIndex.tcl **
      ** DBG:    ** [OK] **
      ** DBG:    ** ::source /path-to-tcl/library/msgcat/pkgIndex.tcl **
      ** DBG:    ** [OK] **
      ** DBG:    ** ::source /path-to-tcl/library/opt/pkgIndex.tcl **
      ** DBG:    ** [OK] **
      ** DBG:    ** ::source /path-to-tcl/library/platform/pkgIndex.tcl **
      ** DBG:    ** [OK] **
      ...
      ** DBG:  ** ::source /path-to-tcl/library/opt/optparse.tcl **
      ** DBG:  ** [OK] **
      0.4.6
      </pre></code>
      
      Normally if tcl evaluates `package require`, it will load package.tcl and hereafter all pkgIndex.tcl in all directories from `auto_path`.
      So it will know where each package is placed and what it has to do to load this package.
      
      But in your case it's totally different. So I assume you use something else (a special build). 
      
      So you should generate the package structure (resp. architecture of pkgIndex-load mechanism) how it is expected from this build/project.
      
      Or just stay on 8.4.
      
      Neither we have the knowledge how your project/app handles this all, nor this will be possible without take a look into whole project infrastructure (e.g. I see strobe.tcl loaded as first directly in init.tcl or even this file xmsimrc you tried to source, both are unknown to me).
      
      Therefore we cannot help you here, thus closed as 3rd party issue.
      
    4. login: "sebres"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Invalid"
    7. severity changed to: "Minor"
    8. status changed to: "Closed"
  12. Ticket change [28c16df1f2] (rid 164830) by anonymous29 on 2018-08-06 05:27:19:

    1. closedate changed to: "2458336.727311"
    2. closer changed to: "anonymous29"
    3. icomment:
      Thanks a lot sebres. 
      Your comments and suggestion was very help full to debug this issue. 
      This is porting issue.
      
    4. login: "anonymous29"
    5. mimetype: "text/plain"