Opened 9 years ago

Closed 9 years ago

#313 closed defect (fixed)

[MacOS] python loadable modules cannot find C++ dynlibs in source tree

Reported by: jinmei Owned by: jreed
Priority: medium Milestone: y2 6 month milestone
Component: build system Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0.75 Internal?: no

Description

So you cannot test/run BIND 10 from source on MacOS unless you explicitly set DYLD_LIBRARY_PATH to the in-source paths to the libraries.

I've not come up with a better solution than setting this environment variable for the tests and run_bind10.sh. This is an ugly hack, but I think it's acceptable because it only affects the "from source" mode of operation.

Subtickets

Change History (7)

comment:1 Changed 9 years ago by jinmei

  • Owner changed from jinmei to UnAssigned
  • Status changed from new to reviewing

branches/trac313 is ready for review. Diff is r2764.

This is a proposed ChangeLog? entry:

  88.	[build]		jinmei
	(Darwin/Mac OS X specific) Specify DYLD_LIBRARY_PATH for tests and
	experimental run under the source tree.  Without this loadable
	python modules refer to installation paths, which may confuse the
	operation due to version mismatch or even trigger run time errors
	due to missing libraries. (Trac #311, rTBD)

comment:2 Changed 9 years ago by jinmei

  • Priority changed from minor to major

Could someone take a look at this?

It should be quite trivial. And it's crucial for my development environment now that I'm updating libdns++ and its python loadable module.

I believe it's mostly okay to skip review, so if no one can have time to review the branch soon, I'll merge it to trunk anyway, and watch any build problem reports from buildbot.

Thanks,

comment:3 follow-up: Changed 9 years ago by jreed

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 0.0 to 0.25

Not sure I understand why B10_LIBRARY_PATH is set for some of the python unit tests. I don't see what uses it.

comment:4 in reply to: ↑ 3 Changed 9 years ago by jinmei

Replying to jreed:

Not sure I understand why B10_LIBRARY_PATH is set for some of the python unit tests. I don't see what uses it.

It's a makefile variable, and make substitutes it. For example, xfrin tests will go as follows:

% make check
make  check-local
for pytest in xfrin_test.py ; do \
	echo Running test: $pytest ; \
	env PYTHONPATH=/Users/jinmei/src/isc/bind10/branches/trac313/src/lib/dns/python/.libs:/Users/jinmei/src/isc/bind10/branches/trac313/src/bin/xfrin:/Users/jinmei/src/isc/bind10/branches/trac313/src/lib/python:/Users/jinmei/src/isc/bind10/branches/trac313/src/lib/python \
	DYLD_LIBRARY_PATH=/Users/jinmei/src/isc/bind10/branches/trac313/src/lib/dns/.libs:/Users/jinmei/src/isc/bind10/branches/trac313/src/lib/exceptions/.libs:/Users/jinmei/src/isc/bind10/branches/trac313/src/lib/xfr/.libs:$DYLD_LIBRARY_PATH \
	/opt/local/bin/python3.1 /Users/jinmei/src/isc/bind10/branches/trac313/src/bin/xfrin/tests/$pytest ; \
	done
Running test: xfrin_test.py
...

that is, make replaces the placeholder B10_LIBRARY_PATH with "DYLD_LIBRARY_PATH=...". No other programs don't have to care about it.

I don't know if I need to tweak the branch due to this, but rename it to LIBRARY_PATH_PLACEHOLDER in case it's less confusing (r2779). Does this explnation and/or r2779 address your concern?

comment:5 Changed 9 years ago by jinmei

  • Add Hours to Ticket changed from 0.0 to 0.5
  • Owner changed from UnAssigned to jreed
  • Total Hours changed from 0.25 to 0.75

comment:6 follow-up: Changed 9 years ago by jreed

This looks good. I didn't test, but you may commit.

comment:7 in reply to: ↑ 6 Changed 9 years ago by jinmei

  • Resolution set to fixed
  • Status changed from reviewing to closed

Replying to jreed:

This looks good. I didn't test, but you may commit.

okay, thanks. committed. closing ticket.

Note: See TracTickets for help on using tickets.