32 Commits

Author SHA1 Message Date
Douglas Eichelberger
adfd12cfd0 Enable more typing 2023-03-21 21:42:51 -07:00
Carlo Cabrera
dee3638653
os/mac/{keg,mach}: fix cache invalidation
We were rewriting dylib IDs and install names using `MachO::Tools`,
which doesn't update the state of the file in memory. This leads to
those changes being undone when we call `delete_rpath`.

We fix this by making sure the state of the file in memory always
matches the state of file on disk.

Closes #12832.
2022-02-11 23:19:15 +08:00
Carlo Cabrera
568bc94f3e
os/mac/keg: use MachOFile#delete_rpath instead of MachO::Tools
This will allow us to avoid keeping track of the number of `RPATH`s
while trying to delete duplicates.

See discussion at #12745.
2022-01-19 00:34:39 +08:00
Carlo Cabrera
488ccfdf70
formula_cellar_checks: check keg for mismatched arches
There have been a few instances I've noticed that we've been silently
installing binaries built for x86_64 on ARM. There's probably more that
I haven't found yet, so it seems useful to check this with an audit.
2021-07-18 11:44:37 +08:00
Mike McQuaid
30a65342e8
Deprecate, disable, delete code for Homebrew 3.2.0
Do the usual deprecation, disable, delete dance for Homebrew 3.2.0.
2021-06-17 11:34:32 +01:00
Carlo Cabrera
28c0caae4d
extend/os/mac/keg_relocate: remove RPATHs rooted in build directory
Keeping dangling `RPATH`s is a security risk, and is bad for build
reproducibility.
2021-05-14 01:07:14 +01:00
Bo Anderson
450bc4ab33
Fix brew style 2021-03-26 14:11:03 +00:00
Bo Anderson
b670ab1c7b Deprecate additional arch functions 2021-02-02 16:19:24 +00:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
390deeb5ac Document MachOShim. 2020-08-26 03:13:59 +02:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
William Woodruff
a8c4136e9e
os/mac: Use delegation for Mach-O methods 2019-03-10 21:07:05 -04:00
William Woodruff
54aca0d14f
os/mac: Flush RPATHs from Mach-Os when possible 2019-03-10 21:07:04 -04:00
William Woodruff
618c5cd01a
os/mac: Expose rpaths 2019-03-10 21:07:03 -04:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
d7eca0b57c
Use Bundler to manage vendor directory
Rather than having to manually keep track of what version each thing in
here is and copy files around by hand on update let's use Bundler's
standalone mode and careful use of `.gitignore` to help us do it.

This means a `bundle update --standalone` will allow us to update all
gems in vendor.

We could consider vendoring other gems this way in future but I'd
suggest only doing this for gems with no dependencies or at least gems
with no native extensions. The only gem this applies to that we
currently use is `ruby-prof` and I'm not convinced it's widely used
enough to warrant vendoring for everyone. Perhaps that's another
criteria: it should be functionality that's used by non-developer
commands and/or normal Homebrew usage.
2018-09-13 15:24:18 +01:00
William Woodruff
8bb4c4f96f
mach: Always report Mach-O parsing errors
This retains the raise-on-error behavior for developers, but
otherwise only prints an error message.
2018-06-06 11:22:21 -04:00
Shaun Jackman
d79c5ade1a Implement linkage for Linux 2017-12-03 16:22:51 -08:00
ilovezfs
e8da9613fb Revert "mach: Avoid reopening the file for relocation" 2017-09-27 02:08:23 -07:00
William Woodruff
d618e574fb
mach: Avoid reopening the file for relocation
This commit allows the relocation code to perform install name
and dylib ID changes without reopening the file separately.
2017-09-25 17:46:23 -04:00
Mike McQuaid
57db2e539e Revert "Merge pull request #2597 from MikeMcQuaid/vendor-gems"
This reverts commit 3e4547f52e7ebec633f8bfefc8a396d944edf908, reversing
changes made to 6edf9382bcc1240ad6f97c8b752cfe56cef9965d.
2017-05-07 17:28:39 +01:00
Mike McQuaid
e1bbab6ca6 Revert "Merge pull request #2603 from MikeMcQuaid/tweak-gem-vendoring"
This reverts commit 2372872974d1049c2beafe7dedb7f8f882502058, reversing
changes made to 3e4547f52e7ebec633f8bfefc8a396d944edf908.
2017-05-07 17:28:37 +01:00
Mike McQuaid
33f83be10e Tweak Gem vendoring.
If people have `HOMEBREW_RUBY_PATH` set then things explode in a rather
confusing fashion. Instead, run `bundle` for them with the arguments
that they'd want.

Also, move `macho` requires into the module itself; it's a pain having
to do everything for Bundler before requiring `pathname` which is a core
Ruby class.
2017-05-07 15:33:54 +01:00
Mike McQuaid
ee253e465b Vendor all Homebrew's gems.
Homebrew's actually ended up using a fair few gems. While we want to
avoid Bundler at runtime (and this PR still does that, in fact uses
Bundler even less at runtime than it did before) writing our own version
to use at build-time seems redundant.
2017-05-07 13:52:57 +01:00
FX Coudert
ac8dd9ae7d Don't list duplicate dylibs for universal 2017-03-04 14:05:32 +01:00
William Woodruff
9267511e6b
os/mac: Rename MachO -> MachOShim
Prevents namespace conflict with vendored ruby-macho.
2016-11-09 17:35:56 -05:00
William Woodruff
032ed07bce
os/mac: Allow MachO.dynamically_linked_libraries to be filtered by dylib type.
This allows us to filter out weak linkages during audits, preventing
a false error from occurring when the dylib cannot be found.
2016-11-09 17:35:56 -05:00
William Woodruff
d16e4a782e
os/mac: Delete old cctools-based relocation code.
Disable check for $HOMEBREW_NO_RUBY_MACHO now that no alternative exists.
2016-09-20 17:48:21 -04:00
William Woodruff
35e2209c10 architecture_list: add new module.
remove old mach.rb, replace with cctools_mach.rb and prune ELF case
move ArchitectureListExtension to separate file ELF support is
maintained in Linuxbrew
2016-02-03 21:24:21 +00:00
Xu Cheng
b743cadd87 use Utils.popen_read instead of ENV trick to escape path
Closes Homebrew/homebrew#45021.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-18 22:57:43 +08:00
Xu Cheng
646f94adfe move mach.rb to os/mac/mach.rb 2015-10-18 22:57:42 +08:00