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

Optionally vendor GNUStep's libobjc2 #44

Closed
wants to merge 8 commits into from

Conversation

madsmtm
Copy link
Owner

@madsmtm madsmtm commented Oct 7, 2021

The idea is that people would be able to play with objc2 without having to setup an entire GNUStep installation.

As a separate crate from objc2_sys so that users don't download the entire GNUStep source when they don't need to (which is very much the common case)!

  • Add gnustep_libobjc2_sys crate w. submodule referencing libobjc2 and build instructions
  • Use ^ in objc2_sys under a crate feature
  • Do the same for gnustep-base (for Foundation)?
  • Clean up how we let the users choose which runtime to build/require. Options:
  • Emit relevant stuff in build.rs so that downstream build scripts can run properly
  • Need to do some things to make objc2_block work better (maybe add objc2_block_sys crate?)
  • ...

@madsmtm madsmtm added the enhancement New feature or request label Oct 7, 2021
@madsmtm
Copy link
Owner Author

madsmtm commented Oct 8, 2021

I was originally gonna be setting it up so that libobjc2 and GNUStep Base (requires GNUStep make and others?) were all optionally vendored, so they could be built and linked against without having them installed on your system. You would do cargo run and everything would just work!

However, now I'm probably gonna be dropping this PR, since it doesn't really have a big enough use-case to make it worth the effort: Developers would probably want to install the toolchain themselves since they'll need all the other tools, and users would be required to since linking would still have to be done dynamically (though maybe not for libobjc2 in the future, see gnustep/libobjc2#211).

Everything in software is a balance, and this would add a bunch of complexity that a project like this one (a fork of only a semi-popular project) is NOT equipped to handle!

That said, this investigation has not been entirely in vain, I've learned a lot about C/C++ build systems, GNUStep, and the relationship between the different runtimes, and I have some ideas for how the cargo build scripts can be better set up.

I'm ready to reopen this discussion if someone has any input.

@madsmtm madsmtm closed this Oct 8, 2021
Comment on lines +23 to +30
// GNUStep only compiles with clang, so try that first.
// (But let the user specify a different path if they need to).
if env::var_os("CC").is_none() {
env::set_var("CC", "clang");
}
if env::var_os("CXX").is_none() {
env::set_var("CXX", "clang++");
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is probably also a bad idea, though not sure if there's a better alternative...

@madsmtm madsmtm deleted the gnustep-libobjc2-vendor branch October 15, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant