Tcl Source Code

View Ticket
Login
Ticket UUID: 219866c1e9d1e5cb77347d2ea187b4ce60cea519
Title: platform::identify: regexp doesn't match platform
Type: Bug Created on: 2015-09-25 06:40:20
Submitter: pooryorick Assigned to: jan.nijtmans
Subsystem: 81. Bundled Packages Severity: Minor
Priority: 5 Medium Last modified: 2015-09-29 08:13:19
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2015-09-29 08:13:19
Version: 8.6.4
Description:
platform-1.0.13.tm/::platform::identify contains the following line:

	regexp {^([^-]+)-([^-]+)$} $id -> plat cpu

, which fails to match the following platform name:

	cygwin_nt-6.3-x86_64

One fix is to remove the end-of-line anchor:

	regexp {^([^-]+)-([^-]+)} $id -> plat cpu
User Comments:
jan.nijtmans added on 2015-09-25 08:22:14:
I'll have a look. Removing the end-of-line anchor is not correct, because that would lead to "cygwin_nt" for "plat" and "6.3" for the "cpu"

jan.nijtmans added on 2015-09-25 10:46:38:

Proposed fix in [616b458e3166d3aa] (for core-8-5-branch, to be merged up to trunk). Andreas, can you live with that?

Explanation: The official Cygwin build of Tcl can have up to 3 dashes, dividing the string in 4 parts. The second part is the OS version (6.x), the 3th part can be "wow" (indicating a 32-bit Tcl running on a 64-bit OS). Those middle parts take no role in the compatibility, so they just can be ignored.

When Tcl is built from the unchanged sources, tcl_platform(os) is "Windows NT", then tcl_platform(platform) being "unix" tells us that we are really on Cygwin.


jan.nijtmans added on 2015-09-29 08:13:19:
Fixed in core-8-5-branch and trunk. Will be in Tcl 8.5.19 and Tcl 8.6.5.