PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Monday the 2nd of November, 2015

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[17:43:22] <Demiurge> is there an example of a project that builds in the destination install directory?
[17:59:51] <ionelmc> Demiurge: what do you need that for?
[18:12:40] <ronny> Demiurge: why wold you want to do that, it breaks all distro&install tools&packaging expectations
[18:22:24] <Demiurge> sorry was lunching
[18:22:27] <Demiurge> i need it for linking
[18:23:35] <Demiurge> i have a lib thats a build_ext that links in build dir
[18:23:45] <Demiurge> but obviously install location is different
[18:23:54] <Demiurge> so then it doesn't find the lib on import
[19:11:24] <ionelmc> Demiurge: `setup.py build --inplace develop` is your best shot
[19:12:10] <ionelmc> sorry, setup.py build_ext --force --inplace develop
[19:12:31] <ionelmc> for installing you should use for some relocation tool
[19:12:38] <ionelmc> s/use/look/
[19:14:10] <Demiurge> well, thats command line
[19:14:17] <Demiurge> i kind of need my module to install with pip
[19:14:24] <Demiurge> without telling people to do extra
[19:14:50] <Demiurge> i can actually build things with inplace style, yes
[19:14:58] <Demiurge> and if i add ./ to link dirs
[19:15:15] <Demiurge> but i dont see any relocation tools
[19:15:29] <Demiurge> if i could just change the build dir, it seems one hack is better than two hacks
[19:16:20] <ionelmc> Demiurge: install location is not fixed/standard? it won't work?
[19:16:25] <ionelmc> am i missing something here?
[19:16:25] <Demiurge> its not
[19:16:36] <Demiurge> can't tell :)
[19:16:41] <Demiurge> it should work with virtualenv
[19:17:35] <Demiurge> the funny thing is, it does work with inplace and venv, but then its important to never delete the build location, because those libs are being used as opposed to those in targer install dir :))
[19:17:45] <Demiurge> found this by accident :)
[19:19:54] <ionelmc> Demiurge: what are you linking?
[19:20:11] <Demiurge> c libraries build as part of the project
[19:20:29] <Demiurge> custom stuff that is being relied on
[19:20:36] <ionelmc> and you vendor those?
[19:20:53] <Demiurge> not sure what you mean by 'vendor'?
[19:21:46] <Demiurge> i just made a C++ extension that builds *.cpp
[19:22:02] <Demiurge> and has a name, and outputs to .so
[19:22:18] <ionelmc> you you "bundle" those shared libs?
[19:22:22] <Demiurge> ah yes
[19:22:31] <ionelmc> that's called "vendoring"
[19:22:42] <Demiurge> ok, yes, it needs to build on various systems
[19:22:50] <ionelmc> afaik conda does some relocation
[19:22:57] <ionelmc> maybe there's something you could reuse
[19:23:02] <Demiurge> yeah, i looked at that, it is SO hackish
[19:23:05] <Demiurge> my last resort
[19:23:08] <Demiurge> to do binary patching
[19:23:11] <Demiurge> and alignment
[19:23:12] <Demiurge> haha
[19:23:18] <ionelmc> the alternative is to dload no?
[19:23:33] <Demiurge> i think if i could JUST build in final install dir
[19:23:35] <Demiurge> it would all work
[19:23:42] <ionelmc> dlopen i mean
[19:23:42] <Demiurge> conda doesnt have that option
[19:23:47] <Demiurge> they distribute binaries
[19:24:17] <Demiurge> i can do this by hand, actually, just create the final dir, cd there, build there with inplace
[19:24:23] <ionelmc> you can prolly hack the build command to have a difffent dir
[19:24:27] <Demiurge> yes
[19:24:29] <ionelmc> and make the install a no-op
[19:24:30] <ionelmc> but
[19:24:31] <Demiurge> thats exactly what im looking for
[19:24:36] <ionelmc> that is fairly tricky to do
[19:24:38] <Demiurge> well something like it
[19:24:39] <ionelmc> good luck :)
[19:24:41] <Demiurge> hm
[19:24:47] <ionelmc> distutils is not easy to extend
[19:24:48] <Demiurge> well i cant find it in source code yet
[19:24:52] <Demiurge> where these paths are
[19:25:00] <ionelmc> code is very dynamic, hard to understand how stuff works
[19:25:01] <Demiurge> so any existing package that does it would be helpful
[19:25:10] <ionelmc> Demiurge: try hunter, it might help ya
[19:25:13] <Demiurge> yeah, i looked at setuptools first, but it doesnt actually set any paths
[19:25:27] <Demiurge> looking at distutils now. whats hunter?
[19:25:40] <ionelmc> https://github.com/ionelmc/python-hunter
[19:25:54] <Demiurge> cool, thanks
[19:26:03] <ionelmc> tracing tool, i use it when i want to understand how stuff works
[19:26:26] <Demiurge> yeah thats great, i wrote something similar before using trace module
[19:26:35] <ionelmc> Demiurge: i happen to have customized commands in it's setup.py but they are far from what you want :)
[19:26:41] <ionelmc> https://github.com/ionelmc/python-hunter/blob/master/setup.py
[19:27:09] <ionelmc> i suppose you could override self.build_lib
[19:27:18] <ionelmc> i have never tried that :-)
[19:27:25] <Demiurge> i started by subclassing it
[19:27:29] <ionelmc> let me know what solution you come up with
[19:27:32] <Demiurge> but looking for the paths to patch
[19:27:52] <Demiurge> ok :)
[19:27:56] <ionelmc> Demiurge: you can print expressions with hunter btw
[19:28:39] <ionelmc> like PYTHONHUNTER='Q(module="distutils", action=CodePrinter("self.build_lib"))' setup.py whatever
[19:28:39] <Demiurge> hmm what do you mean by that?
[19:29:04] <Demiurge> ok, i saw that i can add a custom cmd to setup
[19:29:06] <Demiurge> that can be traced
[19:29:14] <ionelmc> if that var (self) is in scope it will print the expression
[19:30:00] <Demiurge> do you have an example for PYTHONHUNTER?
[19:30:31] <ionelmc> Demiurge: https://python-hunter.readthedocs.org/en/latest/
[19:30:41] <ionelmc> if there's smething missing ping me
[19:32:29] <Demiurge> ok thanks
[19:37:22] <ionelmc> Demiurge: i gave you a bad example, try PYTHONHUNTER='Q(lambda ev: ev.module.startswith("distutils"), action=VarsPrinter("self.build_lib"))' python setup.py build
[19:37:46] <ionelmc> hunter is in development, may have rough edges :)
[19:38:47] <Demiurge> i see
[19:39:15] <Demiurge> lambdas are flexible :)
[19:52:57] <nanonyme> lambdas are a PITA :(
[19:53:18] <Demiurge> flexiblity -> complexity -> pita
[19:53:21] <Demiurge> yes
[20:00:45] <ionelmc> Demiurge: almost forgot, you must disable all bdist commands
[20:00:55] <ionelmc> otherwise pip will make wheel and that will be broken
[20:01:08] <Demiurge> hmm havent run into that yet
[20:01:15] <ionelmc> pip 7.0
[20:49:20] <nanonyme> Demiurge, meh, lambdas can't even do statements. Doesn't sound that flexible to me
[20:58:49] <Demiurge> they're more flexible than module name string
[20:59:05] <Demiurge> if they could do statements, they might be more PITA
[20:59:11] <Demiurge> to handle
[20:59:12] <Demiurge> :)
[21:11:33] <nanonyme> Why so?
[21:48:34] <Demiurge> because you can do more things, you can do more bad things
[22:17:20] <dstufft> I think you rely on some hack to build in the target dir you're gonna have a bad time
[22:17:47] <ngoldbaum> i think conda's binary patching thing is going to be your best bet TBH
[22:20:46] <Demiurge> well
[22:20:58] <Demiurge> trouble but works is better than not works/
[22:20:58] <Demiurge> ?
[22:21:27] <Demiurge> is there a non-hacky way to link to the right final installation path?
[22:22:27] <Demiurge> ngoldbaum: haven't exhausted simpler methods yet, just havent figured them out quite yet
[22:28:47] <dstufft> I'm not sure we (pip) evne tell you what the final destination is going to be
[22:30:09] <Demiurge> yeah, it seems that way, thats why i was looking at distutils