Feature #7427
closedUpdate Rubygems
Added by mame (Yusuke Endoh) almost 12 years ago. Updated almost 12 years ago.
Description
Eric Hodel is planning to update Rubygems by the end of November.
See [ruby-core:48212].
Eric, what's the status?
--
Yusuke Endoh mame@tsg.ne.jp
Updated by mame (Yusuke Endoh) almost 12 years ago
- Priority changed from Normal to 5
Updated by drbrain (Eric Hodel) almost 12 years ago
I plan to commit RubyGems by Thursday Pacific Time.
Updated by mame (Yusuke Endoh) almost 12 years ago
- Priority changed from 5 to 6
drbrain, good work!
The current trunk seems to work on many platforms [1], but unfortunately, usa told me that it does not work on windows [2].
[1] http://rubyci.org/
[2] http://ci.rubyinstaller.org/job/ruby-trunk-x64-test-all/317/console
Can you investigate and fix them?
--
Yusuke Endoh mame@tsg.ne.jp
Updated by usa (Usaku NAKAMURA) almost 12 years ago
- Status changed from Assigned to Closed
I hope... I've fixed... all problems on Windows... cause by rubygems.....
Eric, check these revisions and merge your tree:
r38064, r38065, r38066, r38071, r38074, r38075 and r37077
I'm uncertain about r38071 and r38074.
Eric, please take care of these two commits.
Have a good weekend, especially, mame-san :)
Good-bye until Monday!
Updated by drbrain (Eric Hodel) almost 12 years ago
Thank you for your assistance, usa!
I imported all these fixes and your RDoc fix.
r38074 was good. r38071 is fine. The message may not be completely correct, but without a windows environment it is difficult to tell. (I tried setting one up with MinGW this morning but failed.)
I also update r38075 for ruby 1.8.7 compatibility. Hopefully I won't need to support it soon!
Updated by jonforums (Jon Forums) almost 12 years ago
r38074 was good. r38071 is fine. The message may not be completely correct, but without a windows environment it is difficult to tell. (I tried setting one up with MinGW this morning but failed.)
Eric, what windows version were you using and what specifically failed with your mingw setup this morning? Hopefully one of us can quickly get you up and running.
I'd really like to see you get a workable windows setup (vm or non-vm) given all you work on.
Assuming the problem wasn't standing up a windows system, here's a quick setup similar to what I use on my win7 32bit system. There are other ways, but I prefer this method as it gives more flexibility on tweaking ruby source.
- Separately
git clone
rubyinstaller build recipes and ruby into
c:\projects\rubyinstaller
c:\projects\ruby
-
Ensure any antivirus real-time protection (eg - windows defender, avg, etc) excludes both of the dirs from (1)
-
Checkout whatever ruby branch you want in c:\projects\ruby.
-
cd c:\projects\rubyinstaller
rake clean
rake ruby19 local=c:\projects\ruby dkver=mingw64-32-4.7.2rake devkit:sh
export PATH=/c/projects/rubyinstaller/sandbox/ruby19_mingw/bin:$PATH
cd sandbox/ruby19_build/
make test
make test-all
This will download all the toolchain parts and pre-built native libs and try to build everything with mingw-w64 32bit gcc 4.7.2. Beware of network issues causing download problems for the artifacts and failing the build. Quickest way is to check in c:\projects\rubyinstaller\downloads
for any 0-byte files, delete them, and re-run rake ruby19 local=...
If you're trying on a 64bit system, you'll need to use dkver=mingw64-64-4.7.2
. I don't build on a 64bit system yet, but Hiroshi or Luis can add more info if needed.
Updated by drbrain (Eric Hodel) almost 12 years ago
=begin
I have Windows XP running in VirtualBox. (I don't have a license for a newer version.) I believe I have it set up for 32bit operation, but I can't see how to check in VirtualBox or Windows.
I downloaded mingw-inst-get-20120426 and told it to use the latest packages upon install.
I have mingw32-gcc 4.7.2
When running make I get a link failure (typed by hand):
thread.o:thread.c:(.text=0x3326): undefined reference to `__sync_val_compare_and_swap_4'
collect2.exe: error: ld returned 1 exit status
I understand this function is a GCC builtin that isn't present on MinGW, but I didn't have time to investigate further due to lunch and whatnot.
I'll see what I can do with your setup instructions.
=end
Updated by jonforums (Jon Forums) almost 12 years ago
Don't worry about installing a toolchain and double check that you have a minimal PATH and clean env vars; no pointers to an existing cygwin or mingw install.
We've made the build recipes self-contained so you don't have to worry about installing toolchains, using env vars to influence configure, etc. The rake ruby19 ...
command first downloads all it needs into a download cache and then extracts, configures, and builds everything in a sandbox. There's other things (rake -T
) you can do (build with a toolchain listed in rake devkit:ls
) but my quick start should work.
re: WinXP 32bit...I don't have an XP system any more but I believe Hiroshi has semi-recently built on XP. If you run into compile/link errors with mingw64-32-4.7.2, do a rake clean
(keeps the file download cache) followed by rake ruby19 local=c:\projects\ruby dkver=mingw-32-4.6.2
to build with the mingw.org toolkit rather than the mingw-w64 toolkit. They both should work even though there are header differences. The key (irrelevant to your scenario but an fyi) is to not mix-n-match building ruby with one toolkit while building a native gem with a different toolkit.
Good luck.
Hiroshi...any issues you've had building on XP 32bit I've forgotten?
Updated by drbrain (Eric Hodel) almost 12 years ago
The RubyInstaller build tools are fantastic!
Unfortunately I fail at exactly the same spot, undefined reference to __sync_val_compare_and_swap_4.
Looking closer, ruby_atomic.h checks HAVE_GCC_ATOMIC_BUILTINS and assumes the one I need is there even though it is missing.
There is a check in configure for linux for this builtin, but not for mingw32.
Removing HAVE_GCC_ATOMIC_BUILTINS from config.h allows linking of miniruby
Updated by luislavena (Luis Lavena) almost 12 years ago
drbrain (Eric Hodel) wrote:
The RubyInstaller build tools are fantastic!
Unfortunately I fail at exactly the same spot, undefined reference to __sync_val_compare_and_swap_4.
Looking closer, ruby_atomic.h checks HAVE_GCC_ATOMIC_BUILTINS and assumes the one I need is there even though it is missing.
That is weird, mingw-w64 provides that, which is the compiler we have been using for Ruby 2.0 (GCC 4.7.2)
Perhaps your other mingw-inst-get installation got in the way?
There is a check in configure for linux for this builtin, but not for mingw32.
Removing HAVE_GCC_ATOMIC_BUILTINS from config.h allows linking of miniruby
I'll take a look later tonight. I also have a drop and use package that contains the compilers, a base Ruby and everything to get you up and running quickly.
Updated by drbrain (Eric Hodel) almost 12 years ago
It seems that using rubyinstaller downloaded its own compiler, so I don't think it got in the way. Since configure doesn't check for these GCC builtins I will submit a patch to check for them momentarily.
Updated by drbrain (Eric Hodel) almost 12 years ago
Filed #7485
Updated by jonforums (Jon Forums) almost 12 years ago
Odd. On both my trunk (mingw-w64 gcc 4.7.2) and ruby_1_9_3 (mingw.org gcc 4.6.2) builds, HAVE_GCC_ATOMIC_BUILTINS is defined and all is well on 32bit Win7. I think something else is interferring.
I'm going to try to talk a friend into letting me futz with her WinXP box and try from a fresh start.
From a Command Prompt, would you type set
and put it in a gist along with ruby --version
and gem env
for good measure?
Updated by drbrain (Eric Hodel) almost 12 years ago
set and ruby -v: http://paste.segment7.net/ace.html
gem env: http://paste.segment.net/acf.html
Updated by jonforums (Jon Forums) almost 12 years ago
drbrain (Eric Hodel) wrote:
set and ruby -v: http://paste.segment7.net/ace.html
Looks ok.
gem env: http://paste.segment.net/acf.html
Bad link..should be http://paste.segment7.net/acf.html (missing 7). This in GEM_PATHS is troubling but may be a red-herring since PATH doesn't appear to have other mingw installs:
C:/MinGW/msys/1.0/home/drbrain/.gem/ruby/1.9.1
Try the following on this snippet http://pastie.org/5460872 copied to c:\projects\rubyinstaller as gcc_atomic.c
cd c:\projects\rubyinstaller
rake devkit dkver=mingw64-32-4.7.2
rake devit:sh
gcc --version # should be gcc.exe (rubenvb-4.7.2-release) 4.7.2
gcc -Wall -o atomics.exe gcc_atomic.c
atomics.exe # should be Got 1
If you try the same but with rake devkit dkver=mingw-32-4.6.2
you're rewarded with:
C:\Users\Jon\AppData\Local\Temp\ccgG9KBw.o:gcc_atomic.c:(.text+0x2e): undefined reference to `__sync_val_compare_and_swap_4'
collect2: ld returned 1 exit status
Don't know what this means just yet since I can build with both mingw64-32-4.7.2
and mingw-32-4.6.
Back in awhile after I play on XP.
When you run the following, do you get something similar? Specifically the front part of PATH.
C:\projects\rubyinstaller-git>rake devkit dkver=mingw64-32-4.7.2
mkdir -p C:/projects/rubyinstaller-git/sandbox/.checkpoints
touch C:/projects/rubyinstaller-git/sandbox/.checkpoints/.msys-download
...SNIP...
touch C:/projects/rubyinstaller-git/sandbox/.checkpoints/.mingw-extract
rm -r sandbox/devkit/mingw/mingw32
touch C:/projects/rubyinstaller-git/sandbox/.checkpoints/.mingw-prepare
C:\projects\rubyinstaller-git>rake devkit:sh
Temporarily enhancing PATH to include DevKit...
sh-3.1$ echo $PATH
/usr/bin:/usr/mingw/bin:/c/Program Files/CollabNet/Subversion Client:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:
/c/Windows/System32/WindowsPowerShell/v1.0/:/c/Program Files/ATI Technologies/ATI.ACE/Core-Static:
/c/Program Files/Microsoft Windows Performance Toolkit/:/c/Windows/System32/WindowsPowerShell/v1.0/:/c/tools:
/c/Python27/Scripts:/c/Python27:/c/ruby193/bin:/c/scala/bin:/c/lua/bin:/c/groovy/bin:/c/gnuwin32/curl/bin:/c/gnuwin32/diff/bin:
/c/gnuwin32/grep/bin:/c/gnuwin32/findutils/bin:/c/gnuwin32/sed/bin:/c/gnuwin32/gawk/bin:/c/gnuwin32/less/bin:/c/gnuwin32/upx/bin:
/c/gnuwin32/coreutils/bin:/c/Apps/android-sdk/tools:/c/Apps/android-sdk/platform-tools:/c/Apps/Wix:/c/Apps/git/cmd:/c/Apps/Chocolatey/bin:.
sh-3.1$ gcc --version
gcc.exe (rubenvb-4.7.2-release) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Updated by jonforums (Jon Forums) almost 12 years ago
I can build 2.0.0-preview1 on 32bit XP SP3 (right click My Computer -> properties) using the mingw-32-4.6.2 toolchain. make test
has 0 errors, make test-all
has 7 failures, 3 errors, 86 skips.
Unfortunately, our mingw64-32-4.7.2 toolchain blows up because the first conftest.c fails with an internal compiler error and an unhelpful log msg. And it seems rake devkit:sh
behaves differently on XP and Win7. FYI for your scenario, but the gcc 4.7.2 issue is critical for us (rubyinstaller) to repro, find and fix.
Use the following instead of my previous versions. Remember to run a rake clean
to clean out the build sandbox (devkit, ruby, libs, tools) unless you're in a C-tweak -> rebuild cycle and don't want to rebuild everything.
rake ruby19 local=c:\projects\ruby dkver=mingw-32-4.6.2
rake devkit:sh dkver=mingw-32-4.6.2
I'm out for the evening. If this doesn't get you moving again, hopefully one of the others will saunter in with a solution.
Hey, I'm impressed. A VB vm on your Mac running XP and checking out the two-step that can be mingw. What's this world coming to ;)