Browse Source

punk::repl 0.2.0: wire interp_sync_package_paths into codethread and code interp for package prefer propagation

The codethread init_script now propagates package prefer via a new %packageprefer% scriptmap entry. The code interp (punk/0 repltype) creation replaces the manual epoch-only copy with punk::lib::interp_sync_package_paths code -libunknown 1, which propagates tm list, auto_path, package prefer, and libunknown epoch+init from the codethread to the code interp. This fixes the issue where package prefer latest set in punk_main.tcl was not inherited by the REPL's code interp, causing 999999.0a1.0 dev modules to be passed over in favour of stable VFS-bundled versions.
master
Julian Noble 2 weeks ago
parent
commit
91178a458f
  1. 13
      src/modules/punk/repl-999999.0a1.0.tm
  2. 4
      src/modules/punk/repl-buildversion.txt

13
src/modules/punk/repl-999999.0a1.0.tm

@ -3197,6 +3197,7 @@ namespace eval repl {
} %tmlist% [list [tcl::tm::list]] {*}{
} %autopath% [list $::auto_path] {*}{
} %lib_epoch% [list $::punk::libunknown::epoch] {*}{
} %packageprefer% [list [package prefer]] {*}{
}
]
#scriptmap applied at end to satisfy silly editor highlighting.
@ -3211,6 +3212,7 @@ namespace eval repl {
#this sets the auto_path in the thread but outside of the code interp that will be created.
#It will also need to be added in that interp
set ::auto_path %autopath%
package prefer %packageprefer%
set tclmajorv [lindex [split [tcl::info::tclversion] .] 0]
#jmn
#puts stdout "CODETHREAD tm list"
@ -3604,13 +3606,10 @@ namespace eval repl {
}
punk - 0 {
interp create code
code eval [list namespace eval ::punk::libunknown {}]
catch {
#JJJ REVIEW.
#If libunknown was loaded when packages already in the package database
#then the epoch info may be wrong.
code eval [list set ::punk::libunknown::epoch $::punk::libunknown::epoch]
}
#use punk::lib helper to propagate tm list, auto_path, package prefer,
#and libunknown epoch + init from this codethread to the code interp.
package require punk::lib
punk::lib::interp_sync_package_paths code -libunknown 1
}
punkisland {
interp create code

4
src/modules/punk/repl-buildversion.txt

@ -1,6 +1,8 @@
0.1.6
0.2.0
#First line must be a semantic version number
#all other lines are ignored.
#0.2.0 - codethread init_script now propagates package prefer via %packageprefer% scriptmap entry
#0.2.0 - code interp (punk/0 repltype) now uses punk::lib::interp_sync_package_paths -libunknown 1 instead of manual epoch-only copy, propagating tm list, auto_path, package prefer, and libunknown to the code interp
#0.1.6 - repl::init routes default console construction through punk::console::default_console (also gains the probe-byte store unification)
#0.1.5 - repl::init comment updated: ambiguous capability settles at first console use via punk::console::settle_can_respond (no behaviour change)
#0.1.4 - repl::init constructs the process-default console object (opunk::console instance: default) and settles can_respond 1 for interactive stdin (negative settle deliberately not done at init - see comment)

Loading…
Cancel
Save