-
Notifications
You must be signed in to change notification settings - Fork 149
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
Fails to install gem on mswin64 #3273
Comments
Do you have
I think it is common and fine, here it is used to build libprism.so/dylib/dll, I think sqlite3 and nokogiri and plenty of other gems do the same when they need to build a regular dynamic library not linking to any Ruby API, and then an extension library linking to that library. Notably it enables having other cflags than what CRuby uses. |
@flavorjones would probably have a little more context on this since he helped put this together. But it's my understanding that extconf's responsibility (in the current setup) is to compile the extension, whereas we rely on make to compile the static library. I think we could change it, truthfully I'm not sure of the implications. |
AFAICT, we would have to copy the Prism source in to the |
That's what I meant by "flatten" above. One concern is we would stop being in control of the cflags, which I think on its own is a non-trivial concern, it seems best to always compile prism non-extension C files with a consistent set of flags and a unique way to describe how to compile them (the Makefile at the root). Note the
One consequence I can think of is in development one would see 2 copies of each .c file in their editor/IDE. That's a potential to waste some time editing the wrong file. @mame Could you confirm on your system you only have |
This seems bad doesn't it? It feels like Prism should work with any optimization level or
We should maintain a
It seems like the Prism gem is treating the Prism C library ( Is TruffleRuby using the |
I don't have I agree with @tenderlove . Calling the |
This commit teaches mkmf about the libprism sources and allows it to compile them directly Fixes #3273
This commit teaches mkmf about the libprism sources and allows it to compile them directly Fixes #3273
This commit teaches mkmf about the libprism sources and allows it to compile them directly Fixes #3273
This commit teaches mkmf about the libprism sources and allows it to compile them directly Fixes #3273
Calling "make" from the extconf was intended to be a temporary solution to help transition the project from "just build a static archive" to "ship a static archive and a shared object file and also make a gem out of it". There were a few different opinions on how to proceed, and it wasn't clear how TruffleRuby integration or CRuby integration was going to be implemented. My recollection is that once we had something working, we all moved onto more urgent tasks rather than argue about how to finish untangling it. |
I think my solution in #3289 continues to support CRuby and non-CRuby implementations correctly. IMO we should think about the Prism repository as actually containing 2 different projects:
I think the goals for
The second goal means that fully embedding the source of Since Anyway, I don't think anything I've written above is contrary to anything anyone else here has said. But it's the mental framework I used for the changes in #3289, and why I think it's ok for the gem to stop producing an intermediate |
Right, the Makefile is at least tested in Prism CI when installing the prism gem on JRuby & TruffleRuby (e.g. https://github.com/ruby/prism/actions/runs/12221401729/job/34090404723?pr=3293#step:5:1).
I see I think your PR is fine and agree it's a straightforward way to address this issue.
It's used when building TruffleRuby itself, libprism.a is used there as the only Ruby parser in TruffleRuby (https://github.com/ruby/prism/blob/main/docs/build_system.md#building-prism-as-part-of-truffleruby for more details, I'll fix the broken link there). |
gem install prism
for mswin64 Ruby fails due toNo such file or directory - make
.(Calling
make
duringextconf.rb
seems like an extremely bad idea to me.)The text was updated successfully, but these errors were encountered: