New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files added in the cross_compile block cannot vary between platforms #106
Comments
I don't have a solution in mind, and I've been playing around a bunch with the rake-compiler compile-time tasks to see if I can get a working combination. See brianmario/mysql2#586, which changes from an absolute
because at this point the PWD is the directory root. I think the solution will be to teach rake-compiler that for files added at compile time, first try to find them in the target tmp dir, and then fall back on the base code tree. Does this sound reasonable? |
Could you give us command lines that reproduce the problem? |
In a rake-compiler-dev-box, |
Could you describe how to create rake-compiler-dev-box? |
Just followed the directions at https://github.com/tjschuck/rake-compiler-dev-box Are you setting up an environment to replicate the problem? |
Does the following reproduces your problem?
|
Oh, do an initial
|
Thanks. Does the following reproduce your problem?
|
@kou - that looks like maybe you are missing the |
Thanks. Does the following reproduce your problem?
|
Yes! And now in the build directory, run:
and you should see PE32 files in the x64 directory and/or PE32+ files in the x86 directory. |
For the moment, I have worked around this by using rake-compiler-dock, and simply calling brianmario/mysql2#586 (comment) An idea for a better fix: is it possible to specify a file from the build directory that would have a different name in the target gem? e.g. build dir:
target gems:
|
In my implementation of #100, I somewhat[1] mistakenly assumed that the compilation occurred in the main code directory, and that the files added to
spec.files
would be rooted at code root. This turns out to be only half-correct; compilation occurs in a tmp directory, and the all of the files are staged into a package path per target.The issue I found while building mysql2 0.3.18 was that the
vendor/libmysql.dll
that is copied from the MySQL Connector/C package, was either PE32 or PE32+ for all platforms. It should have been PE32 for x86 and PE32+ for x64. I dug in to see what was going on...Rake-compiler creates tmp dirs for each target-platform-and-Ruby combination, changes into each tmp dir, and compiles the gem for each platform-and-Ruby.
Then rake-compiler creates pkg / staging dirs for each target, copies each of the Ruby builds for that target into a Ruby-version-specific subdir, and builds the gem for that target.
What I need is right in the middle of these: within each target platform, I will have the same libmysql.dll across all Rubies (a noop to recopy it for each Ruby in that target, but no harm), however each target platform may have a different build of it.
The text was updated successfully, but these errors were encountered: