-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
libglib: split libraries from glib #103366
Conversation
Formula/glib.rb
Outdated
def post_install | ||
(HOMEBREW_PREFIX/"lib/gio/modules").mkpath | ||
libglib = Formula["libglib"] | ||
include.make_relative_symlink(libglib.opt_include) | ||
lib.make_relative_symlink(libglib.opt_lib) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make symlinks to let the downstream formula access Formula["glib"].opt_include
and Formula["glib"].opt_lib
. These symlinks will be removed when the migration is done.
This approach doesn't work, because it requires writing to paths outside |
6a01942
to
8f92ad3
Compare
Formula/glib.rb
Outdated
def script | ||
<<~EOS | ||
import pickle as pkl | ||
from mesonbuild.minstall import load_install_data | ||
installdata = load_install_data('meson-private/install.dat') | ||
for attrname in ('data', 'emptydir', 'headers', 'install_scripts', 'install_subdirs', 'man', 'symlinks', 'targets'): | ||
attr = getattr(installdata, attrname) | ||
attr = list(filter(lambda data: all('opt/libglib' not in dataattr | ||
for _, dataattr in vars(data) | ||
if isinstance(dataattr, str)), | ||
attr)) | ||
setattr(installdata, attrname, attr) | ||
with open('meson-private/install.dat', mode='wb') as file: | ||
pkl.dump(file, installdata) | ||
EOS | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach would be really hacky that modifies a binary file created by meson
(created by pickle.dump
from Python). I have read the source code of meson
, I don't find any other way to do this.
The file targets can be ignored by changing the mtime
of files (make them older than those files in libglib
). But there are also some symlinks in which we cannot do the same things. Then it will raise PermissionError
due to sandboxing.
The only way to not write things to libglib
is overwriting the install data of meson
.
6eae317
to
0b4384f
Compare
Require |
# TODO: This is a workaround for `brew audit --new-formula`. | ||
# Use `patch` rather than `inreplace` (see also `glib`). | ||
# replace several hardcoded paths with homebrew counterparts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't work around the audits. They are there for a reason.
66b346a
to
899d783
Compare
some test failures
|
I'm in favour of the split. I wanted to work on something similar, inspired by https://uwekorn.com/2020/10/19/r-without-python.html. I am wondering if we could reduce the scope of the split. What is our goal here? Reduce the complexity of the Python dependency tree? In this case, I think there are only 2-3 python scripts in |
@iMichka, do you mean ship binary executables in The current implementation of the split in this PR:
|
Yes. Just to avoid any confusion, here is your proposal: Here is my proposal: |
I think the libglib/glib split is easier and cleaner to maintain. It might be better to add a libglib formula first, migrate and after link glib to it though. |
This seems easier to implement and requires less migration effort. There are only three places contain Python scripts ( |
We've also been discussing this on Slack and I think I like what @iMichka proposed for If you look at the Gentoo ebuild for |
Closed in favor of PR #103916. |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?Include
glib
andlibglib
formulae only inglib
#102045The remaining formulae that depend on
glib
will be migrated in separate PRs.