code logs -> 2015 -> Sat, 12 Sep 2015< code.20150911.log - code.20150913.log >
--- Log opened Sat Sep 12 00:00:21 2015
00:07 Turaiel is now known as TurCycle
00:11 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
00:11 mode/#code [+qo Vornicus Vornicus] by ChanServ
00:12 ArcticLoveBunny [bunny@Nightstar-3122fr.wa.comcast.net] has joined #code
00:35 NSGuest52875 is now known as EvilDarkLord
00:42 TurCycle is now known as Turaiel
01:45 Meatyhandbag [sebastianfe@Nightstar-ohu.854.224.136.IP] has quit [Client exited]
02:03 Meatyhandbag [sebastianfe@Nightstar-ohu.854.224.136.IP] has joined #code
02:20 thalass [thalass@Nightstar-m49.o7s.158.104.IP] has quit [[NS] Quit: kernal update or somesuch]
02:22 thalass [thalass@Nightstar-m49.o7s.158.104.IP] has joined #code
02:22 mode/#code [+o thalass] by ChanServ
02:25 Checkmate [Z@Nightstar-r9lk5l.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
02:27 catadroid` [catalyst@Nightstar-0reahm.dab.02.net] has joined #code
02:29 catadroid [catalyst@Nightstar-trjv0m.dab.02.net] has quit [Ping timeout: 121 seconds]
02:38 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Connection reset by peer]
03:24 Turaiel is now known as Turaiel[Offline]
03:48 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
03:53 * celticminstrel set .git/refs/heads/master as a dependency with scons (for the header file that exposes the current git revision to the code) and it actually worked exactly right.
03:55
<@celticminstrel>
...though I think it'll break down if there's ever more branches.
03:55 * celticminstrel will change it to .git/HEAD
03:58
<@celticminstrel>
...oh.
04:33
<@celticminstrel>
Well anyway, I have something that successfully makes it rebuild only when HEAD changes to point to a different commit, regardless of whether it's detached or not.
04:34
<@celticminstrel>
Rebuild that particular file, I mean. Obviously it rebuilds other things at other times.
04:56 thalass [thalass@Nightstar-m49.o7s.158.104.IP] has quit [Ping timeout: 121 seconds]
05:11 Derakon is now known as Derakon[AFK]
05:16 Meatyhandbag [sebastianfe@Nightstar-ohu.854.224.136.IP] has quit [Client exited]
05:42 Xon [Xon@Nightstar-j72.ku7.252.119.IP] has joined #code
05:59 gizmore [kvirc@Nightstar-grreaf.dip0.t-ipconnect.de] has joined #code
06:56
<@celticminstrel>
Unfortunately, I still have no clue how to figure out where a given dylib is installed.
06:57
<&McMartin>
At runtime?
06:57
<@celticminstrel>
At build time, so that I can copy it into the application bundle.
06:57
<@celticminstrel>
Or for windows, into the program directory.
06:57
<&McMartin>
For Windows, there's a fixed directory search order
06:58
<&McMartin>
And, um, also make sure you are not distributing non-redistributable system files there
06:58
<&McMartin>
(The usual answer for Windows is "have your installer run the appropriate version of vcredist.exe")
06:59
<&McMartin>
For Mac, I think it's otool -Lv to list dynamic dependencies
06:59
<&McMartin>
That's the equivalent of ldd
06:59
<@celticminstrel>
Currently my code for Mac runs otool -L to get a list, then filters it for ones not starting with /System or /usr/lib, which should mean it just gets Boost, SFML, and dependencies of SFML.
06:59
<@celticminstrel>
(Because I did it recursively, though that part's not tested yet...)
06:59
<&McMartin>
OK, right
07:00
<&McMartin>
On Windows, though, it just flat-out searches the current directory for DLLs and then the system directory (which is reprogrammable in a limited way)
07:00
<@celticminstrel>
But, that gives me paths relative to @rpath, mostly.
07:00
<&McMartin>
... oh, right
07:00
<&McMartin>
You want that, because otherwise the binary breaks when you move it
07:00
<@celticminstrel>
I need to transform those into eg /usr/local/lib/libblah.dylib
07:00
<&McMartin>
You Really Do Not Want To Do That
07:01
<@celticminstrel>
Sorry, I haven't been explaining this well.
07:01
<&McMartin>
The only time that is remotely acceptable on the Mac is when you've compiled it on that system with brew
07:01
<@celticminstrel>
I'm using otool to determine which libraries are needed.
07:01
<&McMartin>
Ah, and then the plan is to assemble them into a directory and do the install_name_tool dance on them?
07:01
<@celticminstrel>
Then I need to get the absolute path to those libraries so that I can copy them into the bundle's Frameworks directory.
07:01
<&McMartin>
(please answer this yes)
07:02
<@celticminstrel>
Yes.
07:02
<&McMartin>
OK
07:02
<&McMartin>
You're on the right track.
07:02
<&McMartin>
I have no nonproprietary code to share with you
07:02
<&McMartin>
But yeah, this is the way
07:02
<&McMartin>
Also, a heads up
07:02
<&McMartin>
install_name_tool does not allocate additional space so you when you do the dance you can smash buffers. Make good use of the @executable_path shorteners and their friends.
07:02
<@celticminstrel>
The question I haven't figured out yet is: how do I get the absolute path to the library?
07:03
<&McMartin>
There is no particular reason to believe that one points to the other
07:03
<&McMartin>
This is particularly true on Windows with Visual Studio, because one intentional feature of import libraries is the ability to link against DLLs that do not exist yet
07:03
<@celticminstrel>
...wait a second, are you saying that substituting "libboost_system.dylib" with "@rpath/libboost_system.dylib" could break something? It's been working fine for me so far though (with @executable_path/../Frameworks in place of @rpath).
07:04
<&McMartin>
If the initial values are short enough, then at least in the 10.6 timeframe, yes, it could break things
07:04
<&McMartin>
It would be immediately obvious if it did, but unless they fixed it, beware of lengthening those too long.
07:05
<@celticminstrel>
So using @rpath may even be preferable, then. I haven't tested if that works when distributing it, though.
07:05
<&McMartin>
Yeah, I think @rpath wasn't yet a reliable thing the last time I personally had to deal with this shit
07:05
<@celticminstrel>
Is my only hope to search a fixed set of locations?
07:05
<&McMartin>
For Mac, when you built it you passed it -L options
07:06
<&McMartin>
The dylibs will be in one of those directories.
07:06
<@celticminstrel>
Right, but scons doesn't seem to have any lib paths set.
07:06
<&McMartin>
"I don't believe you"
07:06
<@celticminstrel>
Well, maybe I did something weird, but I got a KeyError trying to access its LIBPATH...
07:06
<&McMartin>
More formally: it's using some "sensible default" to make this work. Raw clang won't guess directories, it'll say "I can't find it"
07:07
<@celticminstrel>
(I suspect the problem with using @rpath is that you also have to tell the linker where @rpath actually points.)
07:07
<&McMartin>
Yeah, but app launching might do that
07:07
<@celticminstrel>
Eh?
07:07
<&McMartin>
My knowledge here is out of date. (We used the @exec stuff)
07:07
<@celticminstrel>
Anyway, uh, lemme try that LIBPATH thing again quickly...
07:08
<&McMartin>
If you're seeing XCode construct bundles and those bundles when otooled say @rpath in them and nothing else
07:08
<&McMartin>
And that's causing them to load the stuff in their frameworks
07:08
<&McMartin>
Then it probably works, you know~
07:08
<&McMartin>
With Windows, my apparently unhelpful but completely sincere advice is to use an equivalent of find . -name whatever.dll
07:08
<&McMartin>
Because the Windows build process literally does not touch the DLLs ever.
07:09
<&McMartin>
It instead touches stub static libraries whose job it is to load the DLL if necessary and set up the imported symbols properly.
07:09 Checkmate [Z@Nightstar-r9lk5l.cust.comxnet.dk] has joined #code
07:09 mode/#code [+o Checkmate] by ChanServ
07:09
<&McMartin>
It'll know where *those* are but it is neither mandatory nor indeed traditional to put them in the same place (I usually see them in $FOO/lib, with the DLLs themselves in $FOO/bin)
07:10
<@celticminstrel>
I would think the import library knows where the dll is?.
07:10
<@celticminstrel>
But I dunno if I can use the otool approach at all on Windows.
07:10
<&McMartin>
It turns out it does not!
07:11
<&McMartin>
You can use the .libs with no difficulty even if the DLL exists nowhere on the system.
07:11
<&McMartin>
DLL load order is fixed by the Windows runtime, and boils down to "put the DLLs in the directory with the EXE please"
07:11
<&McMartin>
There's more to it than that but one shouldn't mess with those parts.
07:12
<&McMartin>
It's *technically possible* to use the otool-like approach on Windows by clever use of PE32 disassemblers
07:12
<@celticminstrel>
The LIBPATH variable is documented but isn't set.
07:12
<&McMartin>
This is not traditional and the tooling does not mess with it
07:12
<@celticminstrel>
I get a KeyError trying to access it.
07:12
<&McMartin>
scons must be doing something to find the libraries it's linking against when LIBPATH is unset, but I could not tell you offhand what it is.
07:12
<&McMartin>
CMake, I know, does a bunch of overly-clever system-level bullshit that breaks the build seven different ways whenever somebody new tries to build the fucking thing
07:13
<&McMartin>
But which is *very* impressive when it works >_>
07:13
<@celticminstrel>
I get the impression that scons actually intends the LIBPATH to be for user libraries only.
07:13 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
07:13
<&McMartin>
Yeah, but if you're on Mac or Windows, boost *really isn't* a system level library
07:13
<@celticminstrel>
Yeah.
07:13
<@celticminstrel>
Well.
07:14
<@celticminstrel>
I currently have it in /usr/local/lib (which is a bit unusual)
07:14
<@celticminstrel>
And the build is finding it with no problem.
07:14
<&McMartin>
Oh
07:14
<&McMartin>
That's probably a system-level default
07:14
<&McMartin>
Also if this is a program you intend to distribute as source maybe don't do that?
07:15
<@celticminstrel>
Don't do which?
07:15
<&McMartin>
People get super-cranky if building something requires installing stuff outside the checkout directory
07:15
<&McMartin>
Except on Linux where the "stuff" is "have these -dev packages installed already please"
07:15
<&McMartin>
(And even there, they want to be told to do that, not have make go and try to run apt-get on its own)
07:15
<@celticminstrel>
I don't think there's any way around this.
07:15
<&McMartin>
OK, let's back up about 50 steps
07:16
<&McMartin>
What exactly are you building here?
07:16
<@celticminstrel>
You need to install Boost and SFML and any dependencies of SFML. (SFML comes bundled with all its dependencies, so that's nice and handy.) On Windows I also need zlib.
07:16
<@celticminstrel>
This is for Blades of Exile.
07:16
<&McMartin>
Aha
07:16
<&McMartin>
OK, I would say that the way to do this is to say "you need to download these libraries and then install them into some directory"
07:17
<&McMartin>
Ideally though should be "the lib subdirectory of the Blades of Exile unzip directory"
07:17
<&McMartin>
*this
07:17
<&McMartin>
Then you set scons's libpath there.
07:17
<&McMartin>
So it finds that one.
07:17
<@celticminstrel>
For Mac I intend to check if MacPorts/Fink/Homebrew is installed and automatically add those to the LIBPATH; I just haven't gotten to that yet.
07:17
<&McMartin>
Yeah
07:18
<&McMartin>
And if you're building a brew recipe for blades of exile you're actually done at that point, and you don't even need to bother with the install_name_tool dance
07:18
<@celticminstrel>
For the scons I'm also not using frameworks.
07:18
<&McMartin>
If your final goal is "here's a binary for that source distro", you need a script to do the dance
07:18
<@celticminstrel>
SFML isn't in MacPorts, actually.
07:18
<@celticminstrel>
Unless it's under a weird name.
07:19
<&McMartin>
I've been answering these questions as if your goal is to submit modifications to the Blades of Exile release that would permit anyone to create a binary that could be run on other people's systems
07:19
<@celticminstrel>
That's the general idea, yes.
07:19
<&McMartin>
You'll want to control this process far more heavily.
07:20
<&McMartin>
I would actually suggest starting from source package releases for Boost and SFML, executing their own builds, and then taking their uninstalled build products and putting them into a separate, supporting .tar.gz
07:20
<@celticminstrel>
Ew.
07:20
<&McMartin>
(Ideally with a bash script or whatever that actually does this for you)
07:21
<&McMartin>
Welcome to The World Without Package Managers.
07:21
<@celticminstrel>
Do you have any idea how long Boost takes to build? >_>
07:21
<&McMartin>
It's grim wasteland
07:21
<@celticminstrel>
Maybe that could work for SFML, but...
07:21
<&McMartin>
Correctly updating boost and making it work with the product I professionally developed at my last job took two weeks of after-work late evenings, yes
07:22
<@celticminstrel>
Also, Boost's build process is weird and confusing for me.
07:22
<&McMartin>
And ANAICT the Apple dev community's reaction to this is "this is your fault for not using XCode for everything in the universe to begin with, also cross-platform development is for loser chumps"
07:22
<&McMartin>
That said, the horrible part was doing the installnametool dance on the results.
07:22
<&McMartin>
Actually building involved unzipping it and then running a script named something like b2.
07:22
<&McMartin>
With a set of options saying which ones we actually needed.
07:22
<@celticminstrel>
Yeah, something like that/
07:23
<@celticminstrel>
But I also had to tell it to use clang and build against libc++... maybe that's the default by now, I dunno.
07:23
<&McMartin>
Dealing with that was in fact precisely the reason I had to do all that >_<
07:23
<@celticminstrel>
Same.
07:23
<&McMartin>
But yeah, this is not easy and Apple's dev center has a negative incentive to help because they want you trapped in their ecosystem
07:24
<@celticminstrel>
Okay, so...
07:24
<&McMartin>
For replicatable results, my suggestion is "your endgame is the same, but the best way to pregenerate your endpoints is to have a lib/prebuilt directory or something"
07:24
<&McMartin>
If you know where they are on *your* system, pull them out, do the install_name_tool dance *once*
07:24
<&McMartin>
Put them in a prebuilt-libraries directory
07:25
<&McMartin>
Point scons at that somehow and ideally verify that it is using them
07:25
<&McMartin>
And then bundle from there
07:25
<@celticminstrel>
I dislike the idea of providing a tgz of dependencies.
07:25
<&McMartin>
This is more pain upfront for you but if you nail it the chances of getting burned by some package system doing a quietly incompatible upgrade drops to zero percent
07:25
<@celticminstrel>
Obviously it does work, it just doesn't feel right.
07:26
<&McMartin>
Back in UQM on Windows we had the luxury of official precompiled distributions of our dependencies, so we could simply point at those.
07:26
<&McMartin>
But the Mac builds were always terrible hacks at release time
07:27
<@celticminstrel>
There's an official precompiled build for SFML, and Boost is easily installable through MacPorts or Homebrew (probably Fink too).
07:27
<&McMartin>
If you can make it work, then, you have to have them tell you where the version of boost you want to copy in is.
07:28
<@celticminstrel>
I can easily tell whether MacPorts, Homebrew, or Fink is installed, and I know the default install locations for MacPorts and Fink.
07:28
<&McMartin>
That feels fragile to me, tbh
07:29
<@celticminstrel>
Maybe, but I can also provide an override.
07:29
<&McMartin>
So you've got taht
07:29
<&McMartin>
Look in those places if you're assuming it's "available somewhow"
07:30
<&McMartin>
Then copy them over from that place when you find them, and do the install_name_tool dance on those
07:30
<@celticminstrel>
So if you install it in a weird place, then you can run 'scons LIBPATH=/your/place'
07:33 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
07:33 mode/#code [+o himi] by ChanServ
07:38
<&McMartin>
But yeah
07:38
<&McMartin>
Needless to say, the final test here is to find some Mac that has never had devtools installed on it and make sure the resulting bundle runs.
07:38
<&McMartin>
It's Gonna Take A Few Tries
07:39
<@celticminstrel>
It took a few tries with the XCode build as well.
07:39
<&McMartin>
There may be some way to command XCode to bundle up the dependencies for you
07:40
<@celticminstrel>
XCode makes it really easy to copy the frameworks into the app bundle.
07:40
<&McMartin>
Am I correctly reading that as "... if they are frameworks as opposed to raw dylibs"?
07:40
<@celticminstrel>
No, it works for dylibs too.
07:41
<@celticminstrel>
I should somehow find a way to cache any extra parameters the user specifies...
07:41
<&McMartin>
Can't scons be set to do its building via Xcode? Any reason to not let Xcode handle the packaging too, then?
07:41
<@celticminstrel>
Well, scons could probably do that, yeah.
07:41
<@celticminstrel>
But the XCode project is itself kind of fragile.
07:42
<@celticminstrel>
So if anything I'd be more inclined to eventually make XCode call scons rather than the other way around.
07:42
<&McMartin>
Doesn't matter if it's regenerated by scons each time, though, right?
07:42
<@celticminstrel>
The XCode project? I'm not sure if scons can generate those. I know it can do MSVC projects.
07:44
<&McMartin>
Mmm. I thought it could, but maybe I have a circuit crossed with cmake again.
07:54 catadroid` is now known as catadroid
08:03 catadroid [catalyst@Nightstar-0reahm.dab.02.net] has quit [Connection closed]
08:03 catadroid [catalyst@Nightstar-0reahm.dab.02.net] has joined #code
08:33 catadroid [catalyst@Nightstar-0reahm.dab.02.net] has quit [[NS] Quit: Bye]
09:06
<@celticminstrel>
Well, I seem to have gotten it working on my Mac, so yay.
09:20 ion_ [Owner@Nightstar-h5r554.vs.shawcable.net] has quit [Ping timeout: 121 seconds]
09:22 ion [Owner@Nightstar-h5r554.vs.shawcable.net] has joined #code
09:26 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
09:40 celticminstrel is now known as celmin|sleep
10:30 ArcticLoveBunny [bunny@Nightstar-3122fr.wa.comcast.net] has quit [Ping timeout: 121 seconds]
11:09 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
11:16 ArcticLoveBunny [bunny@Nightstar-3122fr.wa.comcast.net] has joined #code
11:34 gizmore [kvirc@Nightstar-grreaf.dip0.t-ipconnect.de] has quit [[NS] Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
11:37 gizmore [kvirc@Nightstar-grreaf.dip0.t-ipconnect.de] has joined #code
12:19 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: ]
13:58 Meatyhandbag [sebastianfe@Nightstar-ohu.854.224.136.IP] has joined #code
15:37 kourbou_ [kourbou@Nightstar-deqg8j.fbx.proxad.net] has joined #code
15:37 kourbou_ is now known as kourbou
16:01 celmin|sleep is now known as celticminstrel
16:02 thalass [thalass@Nightstar-m49.o7s.158.104.IP] has joined #code
16:02 mode/#code [+o thalass] by ChanServ
16:36 Meatyhandbag [sebastianfe@Nightstar-ohu.854.224.136.IP] has quit [Client exited]
16:39 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
16:39 mode/#code [+qo Vornicus Vornicus] by ChanServ
16:47 Meatyhandbag [sebastianfe@Nightstar-ohu.854.224.136.IP] has joined #code
17:37
<@celticminstrel>
Now the configuration tests are failing with unresolved external mainCRTStartup...
17:59 kourbou [kourbou@Nightstar-deqg8j.fbx.proxad.net] has quit [Connection closed]
18:09 Derakon[AFK] is now known as Derakon
19:07 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer]
19:09 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
19:25 Turaiel[Offline] is now known as Turaiel
20:56 kourbou_ [kourbou@Nightstar-deqg8j.fbx.proxad.net] has joined #code
20:56 kourbou_ is now known as kourbou
21:50 kourbou [kourbou@Nightstar-deqg8j.fbx.proxad.net] has quit [[NS] Quit: Iām not a psychopath. Iām a high-functioning sociopath. Do your research.]
22:06 tripflag [im@Nightstar-1sfccr.ocv.me] has quit [[NS] Quit: ZNC - http://znc.in]
22:13 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
22:13 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:14 tripflag [im@Nightstar-1sfccr.ocv.me] has joined #code
22:56 Turaiel is now known as Turaiel[Offline]
23:22
<&jerith>
Vornicus! I require your statistics.
23:23
<&jerith>
I have a sequence of N items, where I don't know the value of N until I stop receiving items.
23:23
<&jerith>
I need a uniform sample of k items, where 0 <= k <= N.
23:24
<&jerith>
Is it possible to do this while storing only k items, or do I need to store all N?
23:25
<&jerith>
I know the naive approach of collecting items up to size k and then randomly discarding one each time a new one comes in is biased toward newer items.
--- Log closed Sun Sep 13 00:00:37 2015
code logs -> 2015 -> Sat, 12 Sep 2015< code.20150911.log - code.20150913.log >

[ Latest log file ]