Skip to content
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

Support cross-VM installation #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LiberalArtist
Copy link

The bespoke C code is already VM independent, but it was being needlessly linked with mzdyn anyway, and the build libraries were going to VM-specific places rather than the VM-independent place (in the sense of (system-library-subpath #f)).

Closes #6.

This works on x86_64 Mac OS. I still need to adjust the build process for i386 Mac OS and the both Linux variants. A complication is that raco ctool doesn't seem to have a flag to do the the equivalent of (parameterize ([current-use-mzdyn #f]) ...) (should it?).

@LiberalArtist
Copy link
Author

I've tried building for i386-macosx, which seems not to be long for this world. It does build something, with these warnings:

ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd

I'll try the result with a Racket distribution for i386-macosx to see if it actually works. (I might even have an old Mac with an actual 32bit Intel chip, but only if I haven't gotten around to getting rid of it yet: Apple has long since ended support.)

Copy link
Owner

@jbclements jbclements left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, well, I should have taken a look at this pull request before duplicating all of your work, sigh. I see that you've included code to dynamically build the callbacks library.

Copy link
Owner

@jbclements jbclements left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: is the cc.rkt file triggered dynamically, or is it intended to be used manually to build missing libraries? I think I'd basically like to grab the cc.rkt file from this pull request, so as not to lose this. It's a nice piece of work, and probably nicer than having the makefiles.

@LiberalArtist
Copy link
Author

I only got as far as using cc.rkt manually for the pre-built libraries. That still needs to happen for Windows and Mac OS, since they don't necessarily provide a C compiler, but I think The Right Thing would be to use pre-install-collection to have raco setup on Unix use it to compile the libraries as needed.

@jbclements
Copy link
Owner

Actually, I think I'm more a fan of building them manually for linux platforms as well; there's no guarantee that a user on a linux platform has a C compiler installed.

@jbclements
Copy link
Owner

Are you willing to trim this PR down to just include the cc.rkt file? I'm happy to do it myself, but then you won't get credit for it. If you care :).

Use some indirection to avoid a package dependency on `dynext-lib`,
since the intent is for "cc.rkt" to be used manually.
@LiberalArtist
Copy link
Author

Sorry it's taken me a while to get back to this. I've changed this to just add "cc.rkt", and I've added a bit of dynamic-require there to avoid creating a package dependency on dynext-lib, since you plan to use this manually. (I like getting packaged libraries for non-standard things on Unix-like systems, too.)

@LiberalArtist LiberalArtist marked this pull request as ready for review August 8, 2020 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cs directories
2 participants