Opened 9 years ago

Closed 9 years ago

#49359 closed defect (fixed)

tDOM @0.8.3: fix build failure with Tcl 8.6

Reported by: gustafn Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: haspatch maintainer Cc: ss@…
Port: tDOM

Description

The tdom port is svn fails with due to an Tcl 8.6 incompatibility:

:info:build /usr/bin/clang -DPACKAGE_NAME=\"tdom\" -DPACKAGE_TARNAME=\"tdom\" -DPACKAGE_VERSION=\"0.8.3\" -DPACKAGE_STRING=\"tdom\ 0.8.3\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_MEMMOVE=1 -DHAVE_BCOPY=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_IS_LONG=1 -DUSE_TCL_STUBS=1 -DXML_DTD=1 -DXML_NS=1 -DTDOM_NO_UNKNOWN_CMD=1 -DUSE_NORMAL_ALLOCATOR=1   -I../generic -I../expat -I"/opt/local/include"    -pipe -Os -arch x86_64 -pipe  -Os -Wall -Wno-implicit-int -fno-common -I/opt/local/include  -c `echo ../generic/tcldom.c` -o tcldom.o
:info:build ../generic/tcldom.c:5937:49: error: no member named 'errorLine' in 'struct Tcl_Interp'
:info:build                 Tcl_GetString(objv[1]), interp->errorLine);
:info:build                                         ~~~~~~  ^
:info:build /usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
:info:build   __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
:info:build                                                        ^
:info:build 1 error generated.
:info:build make: *** [tcldom.o] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_tDOM/tDOM/work/tDOM-0.8.3/unix'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_tDOM/tDOM/work/tDOM-0.8.3/unix" && /usr/bin/make -j8 -w all
:info:build Exit code: 2
:error:build org.macports.build for port tDOM returned: command execution failed
:debug:build Error code: CHILDSTATUS 77151 2
:debug:build Backtrace: command execution failed 

The attached Portfile + patch fixes this (ports/textproc/tdom).

Attachments (4)

Portfile (2.0 KB) - added by gustafn 9 years ago.
tdom-tcl86.patch (471 bytes) - added by gustafn 9 years ago.
Patch
rev_1.diff (874 bytes) - added by gustafn 9 years ago.
diff of portfile
rev_1b.diff (1.4 KB) - added by gustafn 9 years ago.
patch with github portgroup

Download all attachments as: .zip

Change History (16)

Changed 9 years ago by gustafn

Attachment: Portfile added

Changed 9 years ago by gustafn

Attachment: tdom-tcl86.patch added

Patch

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: fix for port tdomtdom: fix build failure with tcl 8.6

Thanks. For future reference, you should provide a unified diff of your portfile changes, instead of a complete new portfile.

comment:2 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

The portfile you've attached here looks like it's based on the one you originally submitted in #32899, and does not take into account the fixes that Josh put in when he committed the port in r95442. Please base your changes off the latest version in the repository instead.

Changed 9 years ago by gustafn

Attachment: rev_1.diff added

diff of portfile

comment:3 in reply to:  2 Changed 9 years ago by gustafn

Replying to ryandesign@…:

The portfile you've attached here looks like it's based on the one you originally submitted in #32899, and does not take into account the fixes that Josh put in when he committed the port in r95442. Please base your changes off the latest version in the repository instead.

Ok, no problem, attached is a unified diff against the newest version (i was installing still from local ports tree and was not aware of the changes).

Is there a way in the ports system to download a tar file from github based on a date? Doing something like:

wget 'https://github.com/tDOM/tdom/tarball/master@{2014-11-01 00:00:00}'

This would allow to get rid of the patch files.

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

Yes, the github portgroup (which this port should be using anyway) lets you get a tarball from any commit. But version 0.8.3 was released in 2008. Pulling the latest code from 2014 would bring in years of changes, in addition to this tcl fix. I would rather not do that. If the developer feels it's ready for release, the developer should tag a release, and then we can update the port to that release. Until then, we should probably just backport the specific fixes that are needed to fix the problem at hand.

comment:5 Changed 9 years ago by gustafn

The upstream maintainer is for some unknown reasons very reluctant to release new versions. Also the conservative ebian switched to a date-based git checkout for debian for that reason. However, for the time being, i see no strong reason for requiring the other changes. The real source for this repository is fossil, the mirroring to github seems as well flaky. However, I've added the time being the 2 portgroup lines, and it seems to work still fine.... and uploaded more more diff.

Changed 9 years ago by gustafn

Attachment: rev_1b.diff added

patch with github portgroup

comment:6 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

I think this will also need to use "github.tarball_from downloads".

comment:7 Changed 9 years ago by gustafn

Oops. The problem was, that "port clean tdom" and "port uninstall tdom" did not remove "/opt/local/var/macports/distfiles/tDOM/tDOM-0.8.3.tgz" and "/opt/local/var/macports/software/tDOM/tDOM-0.8.3_2.darwin_14.x86_64.tgz" on my installation, so the githup options were ignored, and the old .tgz files were used in the builds.

I gave a try to the github portgroup, but was not very successful:

Attempt a)

github.setup    tDOM tdom 0.8.3
github.tarball_from downloads

the leads to

:notice:fetch --->  Attempting to fetch tdom-0.8.3.tgz from https://github.com/downloads/tDOM/tdom
:debug:fetch Fetching distfile failed: SSL peer handshake failed, the server most likely requires a client certificate to connect

Attempt b)

github.setup    tDOM tdom tdom_0_8_3_postrelease
github.homepage https://api.github.com/repos/tDOM/tdom
github.tarball_from tags

the leads to

:notice:fetch --->  Attempting to fetch tdom-tdom_0_8_3_postrelease.tar.gz from https://api.github.com/repos/tDOM/tdom/tarball/tdom_0_8_3_postrelease
:debug:fetch Fetching distfile failed: The requested URL returned error: 404 Not Found

where a cut&paste of the same url works perfectly with wget. I had to provide the github.homepage path, otherwise the generated path from the portgroup was substantilally wrong (i.e. not confirming to the documented API of https://developer.github.com/v3/repos/contents/#get-archive-link)

Shouldn't we stick with the old-fashioned working way (first patch)?

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:8 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

If the github portgroup doesn't work, that's something we need to fix. However, this would be the first report of such a problem, so I would have to investigate why it's not working for you.

comment:9 Changed 9 years ago by gustafn

Not sure, what might be special about my installation. I've tried to debug macports and found the following:

When NOT using the github portgroup in the Portfile (just using

master_sites  https://github.com/downloads/tDOM/tdom"

), the code in "macports/lib/port1.0/portfetch.tcl" uses the following commands (i've added a debug line for the "port fetch" command)

:debug:fetch Executing org.macports.fetch (tDOM)
:info:fetch --->  tDOM-0.8.3.tgz doesn't seem to exist in /opt/local/var/macports/distfiles/tDOM
:notice:fetch --->  Attempting to fetch tDOM-0.8.3.tgz from http://nue.de.distfiles.macports.org/macports/distfiles/tDOM
eval curl fetch --progress ui_progress_download {http://nue.de.distfiles.macports.org/macports/distfiles/tDOM/tDOM-0.8.3.tgz} {/opt/local/var/macports/distfiles/tDOM/tDOM-0.8.3.tgz.TMP}
:debug:fetch Privilege de-escalation not attempted as not running as root.
:debug:checksum checksum phase started at Sat Oct 24 19:43:27 CEST 2015
....

When using the github portgroup with "github.tarball_from downloads", the port fetch command is

:debug:fetch Executing org.macports.fetch (tDOM)
:info:fetch --->  tdom-0.8.3.tgz doesn't seem to exist in /opt/local/var/macports/distfiles/tDOM
:notice:fetch --->  Attempting to fetch tdom-0.8.3.tgz from http://nue.de.distfiles.macports.org/macports/distfiles/tDOM
eval curl fetch --ignore-ssl-cert --progress ui_progress_download {http://nue.de.distfiles.macports.org/macports/distfiles/tDOM/tdom-0.8.3.tgz} {/opt/local/var/macports/distfiles/tDOM/tdom-0.8.3.tgz.TMP}
:debug:fetch Fetching distfile failed: The requested URL returned error: 404 Not Found
:notice:fetch --->  Attempting to fetch tdom-0.8.3.tgz from http://lil.fr.distfiles.macports.org/tDOM
eval curl fetch --ignore-ssl-cert --progress ui_progress_download {http://lil.fr.distfiles.macports.org/tDOM/tdom-0.8.3.tgz} {/opt/local/var/macports/distfiles/tDOM/tdom-0.8.3.tgz.TMP}
:debug:fetch Fetching distfile failed: The requested URL returned error: 404 Not Found
...
eval curl fetch --ignore-ssl-cert --progress ui_progress_download {https://github.com/downloads/tDOM/tdom/tdom-0.8.3.tgz} {/opt/local/var/macports/distfiles/tDOM/tdom-0.8.3.tgz.TMP}
:debug:fetch Fetching distfile failed: SSL peer handshake failed, the server most likely requires a client certificate to connect

So, when not using the github portgroup, the fetch goes to "nue.de.distfiles.macports.org/macports/distfiles/tDOMtdom-0.8.3.tgz" and NOT to github. Interestingly when using the portgroup "--ignore-ssl-cert" is used, but then the fetch fails. Later the fetch to github fails during handshake, although "--ignore-ssl-cert" is used.

I would be curious, if the behavior would be different for you.

When looking at the code of portfetch.tcl, i saw some desperate quoting and deprecated code. I would recommend to use the Tcl expand operator as shown in the following patch (not related to the issue).

--- /opt/local/libexec/macports/lib/port1.0/portfetch.tcl-orig	2015-10-24 18:50:00.000000000 +0200
+++ /opt/local/libexec/macports/lib/port1.0/portfetch.tcl	2015-10-24 19:32:05.000000000 +0200
@@ -536,7 +536,7 @@
             foreach site $urlmap($url_var) {
                 ui_notice "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $distfile $site]"
                 set file_url [portfetch::assemble_url $site $distfile]
-                if {![catch {eval curl fetch $fetch_options {$file_url} {"${distpath}/${distfile}.TMP"}} result] &&
+                if {![catch {curl fetch {*}$fetch_options $file_url "${distpath}/${distfile}.TMP"} result] &&
                     ![catch {file rename -force "${distpath}/${distfile}.TMP" "${distpath}/${distfile}"} result]} {
                     set fetched 1
                     break

comment:10 Changed 9 years ago by ss@…

Cc: ss@… added

Cc Me!

comment:11 Changed 9 years ago by ss@…

A working tdom port would greatly ease macports-based deployment of my Tcl apps.

comment:12 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Port: tDOM added; tdom removed
Resolution: fixed
Status: assignedclosed
Summary: tdom: fix build failure with tcl 8.6tDOM @0.8.3: fix build failure with Tcl 8.6

Sorry about the delay. Committed attachment:rev_1.diff in r142647 to fix the Tcl 8.6 build failure.

Note: See TracTickets for help on using tickets.