From 5d4116b63829ba46f63a5ec7434710edc4b98943 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Dec 2020 09:00:02 +0000 Subject: sync win/rules.vc with Tcl 8.7. No change for 8.6 --- win/rules.vc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/win/rules.vc b/win/rules.vc index a0084a4..76d93cd 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -667,9 +667,10 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg # MSVCRT - 1 -> link to dynamic C runtime even when building static Tcl build # 0 -> link to static C runtime for static Tcl build. # Does not impact shared Tcl builds (STATIC_BUILD == 0) +# Default: 1 for Tcl 8.7 and up, 0 otherwise. # TCL_USE_STATIC_PACKAGES - 1 -> statically link the registry and dde extensions -# in the Tcl shell. 0 -> keep them as shared libraries -# Does not impact shared Tcl builds. +# in the Tcl and Wish shell. 0 -> keep them as shared libraries. Does +# not impact shared Tcl builds. Implied by STATIC_BUILD since Tcl 8.7. # USE_THREAD_ALLOC - 1 -> Use a shared global free pool for allocation. # 0 -> Use the non-thread allocator. # UNCHECKED - 1 -> when doing a debug build with symbols, use the release @@ -724,7 +725,7 @@ MSVCRT = 0 !if [nmakehlp -f $(OPTS) "msvcrt"] !message *** Doing msvcrt !else -!if $(STATIC_BUILD) +!if "$(TCL_MAJOR_VERSION)" == "8" && "$(TCL_MINOR_VERSION)" < "7" && $(STATIC_BUILD) MSVCRT = 0 !endif !endif -- cgit v0.12 From 20e0998a323f571ddb5f5aaf9789dcc8fa6b06b7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Dec 2020 09:38:24 +0000 Subject: Use more 0o??? syntax for octal. Clean up build *.yml files --- .github/workflows/linux-build.yml | 3 ++- .github/workflows/mac-build.yml | 3 ++- .travis.yml | 3 --- tests/chanio.test | 2 +- tests/unixFCmd.test | 4 ++-- tests/unixFile.test | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index bf0a4cb..3d56638 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -20,7 +20,8 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Prepare - run: touch tclStubInit.c tclOOStubInit.c + run: | + touch tclStubInit.c tclOOStubInit.c working-directory: generic - name: Configure ${{ matrix.cfgopt }} run: | diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 3302265..c1144ab 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -11,7 +11,8 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Prepare - run: touch tclStubInit.c tclOOStubInit.c + run: | + touch tclStubInit.c tclOOStubInit.c working-directory: generic - name: Build run: make all diff --git a/.travis.yml b/.travis.yml index d2e3ca9..eb1ec0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -190,7 +190,6 @@ jobs: - BUILD_DIR=win - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build" before_install: &vcpreinst - - rm -rf tests/safe-stock8*.test - touch generic/tclStubInit.c generic/tclOOStubInit.c - PATH="$PATH:$VCDIR" - cd ${BUILD_DIR} @@ -297,7 +296,6 @@ jobs: - BUILD_DIR=win - CFGOPT="--enable-64bit" before_install: &makepreinst - - rm -rf tests/safe-stock8*.test - touch generic/tclStubInit.c generic/tclOOStubInit.c - choco install -y make - cd ${BUILD_DIR} @@ -374,7 +372,6 @@ jobs: script: - make dist before_install: - - rm -rf tests/safe-stock8*.test - touch generic/tclStubInit.c generic/tclOOStubInit.c - cd ${BUILD_DIR} install: diff --git a/tests/chanio.test b/tests/chanio.test index 5586015..28da530 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -5334,7 +5334,7 @@ test chan-io-40.1 {POSIX open access modes: RDWR} -setup { test chan-io-40.2 {POSIX open access modes: CREAT} -setup { file delete $path(test3) } -constraints {unix} -body { - set f [open $path(test3) {WRONLY CREAT} 0600] + set f [open $path(test3) {WRONLY CREAT} 0o600] file stat $path(test3) stats set x [format 0o%03o [expr {$stats(mode) & 0o777}]] chan puts $f "line 1" diff --git a/tests/unixFCmd.test b/tests/unixFCmd.test index 991e489..4b1687f 100644 --- a/tests/unixFCmd.test +++ b/tests/unixFCmd.test @@ -137,11 +137,11 @@ test unixFCmd-1.7 {TclpRenameFile: EXDEV} -setup { cleanup } -constraints {unix notRoot} -body { file mkdir foo/bar - file attr foo -perm 040555 + file attr foo -perm 0o40555 file rename foo/bar /tmp } -returnCodes error -cleanup { catch {file delete /tmp/bar} - catch {file attr foo -perm 040777} + catch {file attr foo -perm 0o40777} catch {file delete -force foo} } -match glob -result {*: permission denied} test unixFCmd-1.8 {Checking EINTR Bug} {unix notRoot nonPortable} { diff --git a/tests/unixFile.test b/tests/unixFile.test index 492e5d0..3669cce 100644 --- a/tests/unixFile.test +++ b/tests/unixFile.test @@ -24,7 +24,7 @@ cd [temporaryDirectory] catch { set oldPath $env(PATH) - file attributes [makeFile "" junk] -perm 0777 + file attributes [makeFile "" junk] -perm 0o777 } set absPath [file join [temporaryDirectory] junk] -- cgit v0.12 From c69d9fda477d73e88273b55ef9e129a7e0ee8690 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Dec 2020 12:17:50 +0000 Subject: Potential fix for [ed5be77734]: win: "comx:" not recognized as serial port. (concluded from code inspection, not tested yet) --- generic/tclFileName.c | 4 ++-- win/tclWinFile.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 15f93f4..cfd76e6 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -242,7 +242,7 @@ ExtractWinRoot( if (path[4] == '\0') { abs = 4; - } else if (path [4] == ':' && path[5] == '\0') { + } else if (path[4] == ':' && path[5] == '\0') { abs = 5; } @@ -264,7 +264,7 @@ ExtractWinRoot( if (path[4] == '\0') { abs = 4; - } else if (path [4] == ':' && path[5] == '\0') { + } else if (path[4] == ':' && path[5] == '\0') { abs = 5; } } diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 6cfeae1..2fa2258 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1250,7 +1250,7 @@ WinIsReserved( if (path[4] == '\0') { return 4; - } else if (path [4] == ':' && path[5] == '\0') { + } else if (path[4] == ':' && path[5] == '\0') { return 4; } } else if ((path[2] == 'n' || path[2] == 'N') && path[3] == '\0') { @@ -1271,7 +1271,7 @@ WinIsReserved( if (path[4] == '\0') { return 4; - } else if (path [4] == ':' && path[5] == '\0') { + } else if (path[4] == ':' && path[5] == '\0') { return 4; } } @@ -3101,6 +3101,7 @@ TclNativeCreateNativeRep( } MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nativePathPtr, len + 1); + nativePathPtr[len] = 0; /* * If path starts with "//?/" or "\\?\" (extended path), translate any -- cgit v0.12 From 45c9e44c82a3494ca972276c1454a9bda8e0900e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Dec 2020 12:31:37 +0000 Subject: Tweak: account for terminating '\0' --- win/tclWinFile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 2fa2258..2967cce 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -3100,7 +3100,7 @@ TclNativeCreateNativeRep( goto done; } MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nativePathPtr, - len + 1); + len + 2); nativePathPtr[len] = 0; /* -- cgit v0.12 From f4ec29ceb25d347536aee82060c3402bc87a94e8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Dec 2020 18:05:34 +0000 Subject: Update "platform" package to handle Big Sur version numbering. Also remove special case for cygwin/msys2, just make it more generic --- library/platform/platform.tcl | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 87d720b..2e54a33 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -94,12 +94,6 @@ proc ::platform::generic {} { } switch -glob -- $plat { - cygwin* { - set plat cygwin - } - msys* { - set plat msystem - } windows { if {$tcl_platform(platform) == "unix"} { set plat cygwin @@ -152,6 +146,9 @@ proc ::platform::generic {} { osf1 { set plat tru64 } + default { + set plat [lindex [split $plat _-] 0] + } } return "${plat}-${cpu}" @@ -178,11 +175,15 @@ proc ::platform::identify {} { } macosx { set major [lindex [split $tcl_platform(osVersion) .] 0] - if {$major > 8} { + if {$major > 19} { + incr major -20 + append plat 11.$major + } else { incr major -4 append plat 10.$major return "${plat}-${cpu}" } + return "${plat}-${cpu}" } linux { # Look for the libc*.so and determine its version @@ -333,7 +334,7 @@ proc ::platform::patterns {id} { lappend res macosx-universal macosx-i386-x86_64 } macosx*-* { - # 10.5+ + # 10.5+,11.0+ if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} { switch -exact -- $cpu { @@ -341,15 +342,28 @@ proc ::platform::patterns {id} { lappend alt i386-x86_64 lappend alt universal } - x86_64 { lappend alt i386-x86_64 } + x86_64 { + lappend alt i386-x86_64 + } default { set alt {} } } if {$v ne ""} { foreach {major minor} [split $v .] break - # Add 10.5 to 10.minor to patterns. set res {} + if {$major eq 11} { + # Add 11.0 to 11.minor to patterns. + for {set j $minor} {$j >= 0} {incr j -1} { + lappend res macosx${major}.${j}-${cpu} + foreach a $alt { + lappend res macosx${major}.${j}-$a + } + } + set major 10 + set minor 15 + } + # Add 10.5 to 10.minor to patterns. for {set j $minor} {$j >= 5} {incr j -1} { lappend res macosx${major}.${j}-${cpu} foreach a $alt { -- cgit v0.12