Not really a bug report per se, but this seems like the best forum for people working with the code. What are folks using to build the source repo? And how’s it going for you?
I’ve been trying to build on an M1 MacBook with 15.3.1 which the Wiki indicates should work. However so far I haven’t been successful with either Ruby 3.0.4 or or 3.4.1. Right now I’m hitting some sort of linkage error when rvm tries to compile Ruby 3.0.4.
Does anyone have the build working on an M1 (or M2/M3/M4) Mac? Or are folks using Linux or X86 Macs?
FWIW, most of the developers on staff have a similar setup (for me, M1 Pro, Mac 15.2). The Development Setup Guide hasn’t been updated in a while, but I think we updated the last time a staffer needed to get a local Rails env up and running. Are you doing this?
CFLAGS="-Wno-error=implicit-function-declaration" rvm install $(cat .ruby-version)
rvm use
had some problems with rbenv then used rvm but destroyed my whole command line config with it. Lastly I used asdf-vm which worked for me.
Nevertheless, if I should need to setup the dev env again I would use a docker container before breaking my laptop again, which I can highly recommend. As the whole deployment already has a Dockerfile it should be fairly easy to create a dev docker container.
There has been an error while running make. Halting the installation.
And in make.log I find multiple problems with maybe_unused in big_decimal.c:
bigdecimal.c:249:5: error: ‘maybe_unused’ attribute cannot be applied to types
249 | ENTER(1);
I’ve tried various things to get past that, but so far haven’t managed to get all the way to a working build.
Wild guess: everyone who currently has a working build started on an earlier Mac OS X/XCode Tools combo where Ruby 3.0.4 could build, then upgraded to a newer OS. The previously built binary works, but cannot be compiled on 15.3.1 and possibly some other versions.
Continuing the exploration. in make.log I find multiple problems with maybe_unused in big_decimal.c:
bigdecimal.c:249:5: error: ‘maybe_unused’ attribute cannot be applied to types
249 | ENTER(1);
I can fix that with a patch for maybe_unused — but so far haven’t managed to get all the way to a working build.
Wild guess: everyone who currently has a working build started on an earlier Mac OS X/XCode Tools combo where Ruby 3.0.4 could build, then upgraded to a newer OS. The previously built binary works, but cannot be compiled on 15.3.1 and possibly some other versions.
Now obviously these are issues in Ruby, not in the core iNat code base. However, it does warn us that:
A) iNat is vulnerable to perhaps undiscovered bugs and security issues in Ruby 3.0.4 that are not going to be fixed by the Ruby maintainers.
B) We could have a lot of trouble building iNat in the future if any of the currently working laptops are lost or damaged
Possibly we could work around B by installing an older OS/XCode, installing Ruby there, and then upgrading the OS. If anyone knows the last MacOS/XCode tools versions that they were able to setup, I can downgrade a MacBook to that and see if that works. It’s also possible someone with more Ruby experience than me can get this all the way to a working install on the current OS. Linux might also be an option for building.
However, it does feel like right now the iNat codebase doesn’t have very firm foundations, and fixing this should be a high priority code health item. I haven’t yet been able to bring it up on Ruby 3.4.1. Maybe I can try 3.1 as an intermediate step.
I don’t think any of us have hit that specific problem but it looks like many others have. You might try some of those solutions. Juggling homebrew and openssl is kind of a nightmare but it’s generally one that ends… eventually.