Git Product home page Git Product logo

Comments (3)

fmbraga avatar fmbraga commented on June 13, 2024

I worked around this problem by downloading byebug, patching it, and installing a local-compiled gem.

This patch allows CFLAGS into makefile.

--- a/ext/byebug/extconf.rb
+++ b/ext/byebug/extconf.rb
@@ -5,6 +5,7 @@ require "mkmf"
 makefile_config = RbConfig::MAKEFILE_CONFIG

 makefile_config["CC"] = ENV["CC"] if ENV["CC"]
+makefile_config["CFLAGS"] = ENV["CFLAGS"] if ENV["CFLAGS"]

 makefile_config["CFLAGS"] << " -gdwarf-2 -g3 -O0" if ENV["debug"]

It was pretty straightforward from there on:

$ export CFLAGS="-fdeclspec"
$ bundle exec rake build --trace
** Invoke build (first_time)
** Execute build
byebug 11.1.3 built to pkg/byebug-11.1.3.gem.
$ gem install pkg/byebug-11.1.3.gem
Building native extensions. This could take a while...
Successfully installed byebug-11.1.3
Parsing documentation for byebug-11.1.3
Installing ri documentation for byebug-11.1.3
Done installing documentation for byebug after 17 seconds
1 gem installed

from byebug.

garrettgregor avatar garrettgregor commented on June 13, 2024

Maybe this is a stupid question, but how does one "patch" the byebug file? I've tried a lot of things so far, (a new user account and test environment, updated ruby gems manually, tried to update byebug manually, amongst other steps listed below

I ran gem install bundler in the /ruby-exercises folder, for which it seemed to be successful (error log attached)
Bundle_install_output_230224.txt
:

garrettgregor@One-Pro-to-Rule-them-All ruby_exercises % gem install bundler
Successfully installed bundler-2.4.7
Parsing documentation for bundler-2.4.7
  1. After that I ran bundle install as per the directions and the following output happened (attached because it’s too long to paste)
  2. I’ve tried to install gem install byebug by itself and it seems that some others with M1 architecture might have similar issues
    I don’t know what’s happening, but fwiw, I had no issues with the computer setup initially and here’s what -v produces for ruby, bundle, etc.:
    Ruby
    ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin22]
    Bundle
    Bundler version 2.4.7
    Gem
    3.1.4
    Gem list
*** LOCAL GEMS ***

benchmark (default: 0.1.0)
bigdecimal (default: 2.0.0)
bundler (2.4.7, default: 2.1.4)
cgi (default: 0.1.0)
csv (default: 3.1.2)
date (default: 3.0.0)
dbm (default: 1.1.0)
delegate (default: 0.1.0)
did_you_mean (default: 1.4.0)
diff-lcs (1.5.0)
etc (default: 1.1.0)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.4.1)
forwardable (default: 1.3.1)
getoptlong (default: 0.1.0)
io-console (default: 0.5.6)
ipaddr (default: 1.2.2)
irb (default: 1.2.6)
json (default: 2.3.0)
logger (default: 1.4.2)
matrix (default: 0.2.0)
minitest (5.13.0)
mutex_m (default: 0.1.0)
net-pop (default: 0.1.0)
net-smtp (default: 0.1.0)
net-telnet (0.2.0)
observer (default: 0.1.0)
open3 (default: 0.1.0)
openssl (default: 2.1.2)
ostruct (default: 0.2.0)
power_assert (1.1.7)
prime (default: 0.1.1)
pstore (default: 0.1.0)
psych (default: 3.1.0)
racc (default: 1.4.16)
rake (13.0.1)
rdoc (default: 6.2.1)
readline (default: 0.0.2)
readline-ext (default: 0.1.0)
reline (default: 0.1.5)
rexml (default: 3.2.3)
rspec (3.12.0)
rspec-core (3.12.1)
rspec-expectations (3.12.2)
rspec-mocks (3.12.3)
rspec-support (3.12.0)
rss (default: 0.2.8)
sdbm (default: 1.0.0)
singleton (default: 0.1.0)
stringio (default: 0.1.0)
strscan (default: 1.0.3)
test-unit (3.3.4)
timeout (default: 0.1.0)
tracer (default: 0.1.0)
uri (default: 0.10.0)
webrick (default: 1.6.0)
xmlrpc (0.3.0)
yaml (default: 0.1.0)
zlib (default: 1.1.0)

brew

Homebrew 3.6.20
Homebrew/homebrew-core (git revision 26525bc26ba; last commit 2023-01-31)
Homebrew/homebrew-cask (git revision c61202fc5d; last commit 2023-02-01)

byebug
zsh: command not found: byebug

from byebug.

maxirmx avatar maxirmx commented on June 13, 2024
  • This bug is related to clang, not to MacOS. I got it on Alpine and Ubuntu when clang was used.

  • Byebug requries -fdeclspec switch for clang. Ruby defines CC = clang -fdeclspec but byebug extconfig.rb overwrites this setting with makefile_config["CC"] = ENV["CC"] if ENV["CC"] It is the error, IMHO

  • In order to do it without patching one needs to force -fdeclspec in some other way
    I compile Ruby with custom flags so for me the easierst approach was to use cflags=-fdeclspec at configure step.
    I guess export CC=clang -fdeclspec shall work

(Valid for Ruby 3.0.6; it is very possible that 3.1+ works as 2.7 did)

from byebug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.