TDBC

View Ticket
Login
Ticket Hash: 625f0ee4648882dcf0cf920b2719c6889ba1b6db
Title: Disable writing to build-dir at install time
Status: Closed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: tdbc Resolution: Fixed
Last Modified: 2018-01-05 05:56:07
Version Found In: 1.0.3
User Comments:
erikleunissen added on 2015-06-23 20:11:38:
The tdbc Makefile has a target "binaries", which lets a copy command write to the build directory. Without prerequisites for this target, this command is executed at build-time as well as at install-time.

This is redundant at least. At worst, it prevents installation of the already built package onto another host than the build-host, using a cross-mounted build directory [*],[**]. This is so in the common cases where:
- the file system hosting the build-dir may be exported to or mounted at host2 in a read-only mode (which seems to be good practice).
- root at install-host does not have the same all-mighty permissions as root on the build-host, even if build-dir was mounted read-write (cf. NFS root-squashing).

All of these considerations/troubles are unnecessary since the writes themselves are unnecessary. Moreover ..., in the case of tdbc the files copied to the build directory aren't even used by [make install]: it installs the pertinent file (tdbc.tcl) directly from the source directory. In other words: the copy command is irrelevant for the install target[**].

Given the complete redundancy, and irrelevance from the perspective of [make install], I propose to simply remove the copy command alltogether, which is what the attached patch does. The patch was created against the trunk at [8a460b3726].


Sincerely,

Erik Leunissen.
--
[*] In fact, as a sub-package of the Tcl8.6 distribution, this is the only obstacle that prevents cross-installation of Tcl8.6, which includes sub-packages as tdbc. (Another obstacle has already been corrected previously through Tcl check-in [9f5893b2e8].)

[**] The error message from [sudo make install] is (note the term "Building" at line 1, sic!):
Building package 'tdbc1.0.3'
make[1]: Entering directory '/usr/local/src/BUILD/x86_64-linux/tcl8.6.4/pkgs/tdbc1.0.3'
cp -p /usr/local/src/SOURCES/tcl8.6.4/pkgs/tdbc1.0.3/library/tdbc.tcl .
cp: cannot create regular file ‘./tdbc.tcl’: Permission denied
Makefile:196: recipe for target 'binaries' failed
make[1]: *** [binaries] Error 1

[***] If there is any other reason for copying these files to the build directory besides package installation through [make install], it'd better be implemented such that the copying happens at build-time only, not at install-time.

jan.nijtmans added on 2015-06-26 21:58:17:
Patch applied. Thanks!

jan.nijtmans added on 2015-10-13 13:22:32:
Commit had to be reverted, due to causing test-failures in other tdbc* packages. Needs some further thoughts.

dgp added on 2015-10-13 13:29:14:
Before declaring something a "harmless" change, please at 
least run the test suite.

erikleunissen added on 2015-10-14 20:54:07:
Sorry (and surprised) to hear about test-failures. Will look into this further.

Erik.

stu (claiming to be Stu) added on 2017-05-25 15:52:28:
Include tdbc.tcl in the build stage.

erikleunissen added on 2017-06-12 17:29:41:
Thanks to stu for taking over

stu (claiming to be a herring) added on 2017-06-13 02:00:50:
Just a note:
I haven't taken over anything.
I've just supplied a patch that may be a way to make this work as the ticket desires.
It's up to the author to evaluate and (maybe) apply.

erikleunissen added on 2017-06-13 16:01:28:
OK. I'll rephrase:

Thanks for delivering what I originally intended to deliver.

erikleunissen added on 2017-06-13 16:33:48:
Stu:

Could you please specify, exactly which version your patch was created against?

From the patch itself, I can deduce that it must be some version carrying the releasenr. 1.0.4. However, since application of this tag (1.0.4), the three files that your patch adresses have also been changed.

stu added on 2017-06-13 18:26:19:
Patch was against trunk same date as patch.

stu added on 2017-06-13 18:29:19:
It's a pretty small patch.
The changes could be applied by hand.

erikleunissen added on 2017-06-14 17:50:43:
I evaluated the patch contributed by Stu, testing it against the version tagged tdbc-1.0.5 (43b96d33bb). Two statements:

1. the test suite passed when run from the build directory (accessed from any host onto which the package is going to be installed).
2. regarding its functionality: it performed well, as I originally intended by this ticket.

One note aside: the TDBC package download from this site (core.tcl.tk) doesn't bring a tclconfig directory holding a recent tcl.m4 and install-sh. These files are required for doing a succesful 'sudo make install'. Experienced Tcl developers will find out how to compensate for that. However, I expect regular users to give up if this isn't included in a regular distribution.

erikleunissen added on 2017-06-14 18:10:20:
Correction: my evaluation of the patch was performed against the current trunk (not against tag tdbc-1.0.5).

kbk added on 2017-12-12 19:40:47:
Patch accepted and merged.

kbk added on 2017-12-14 21:02:12:
status didn't get changed to 'Closed' on the previous edit.

kbk added on 2017-12-14 22:58:29:
OOPS - misunderstood the patch status. Reopening.

stu added on 2018-01-05 05:56:07:
Fixed in a different way in checkin [2386d26cfb].

Attachments: