Bo Anderson
1fc39d2d0d
os/mac/keg_relocate: add fallback to default Perl version when using tab
...
While this should never be necessary for per-OS bottles, this could be useful for :all bottles where the OS it was built on uses a Perl version that doesn't exist on all macOS versions.
2021-05-31 16:31:26 +01:00
Carlo Cabrera
ada399c7db
Fix perl shebang rewriting for perl
formula
...
See
https://github.com/Homebrew/homebrew-core/issues/77797
https://github.com/Homebrew/brew/issues/11275#issuecomment-846522409
2021-05-23 11:05:17 +01:00
Carlo Cabrera
e8b5eb7e42
extend/os/mac/keg_relocate: fix relocation of duplicate RPATH
s
...
Homebrew/homebrew-core#77623 revealed two bugs. One in `ruby-macho`,
which turns out to be unable to delete duplicated `RPATH`s. This was
fixed with `ruby-macho` 2.5.1.
The second, which this commit fixes, is in our handling of duplicate
`RPATH`s. Since we iterate over each `RPATH`, attempting to relocate the
first duplicate fails since it will no longer exist after having
relocated the original.
2021-05-17 00:14:46 +01:00
Carlo Cabrera
28c0caae4d
extend/os/mac/keg_relocate: remove RPATH
s 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
Carlo Cabrera
dd199901e7
Merge pull request #11370 from carlocab/relocate-metavars
2021-05-13 07:02:25 +01:00
Carlo Cabrera
c7de544fe8
extend/os/mac/keg_relocate: fix post-bottling dylib ID relocation
...
Running `brew bottle` changes dylib IDs, install names, and rpaths into
placeholders for the bottle, creates a bottle tarball, and then changes
the placeholders back to their correct values.
With my refactoring in #11358 , the behaviour of this relocation changed:
dylib IDs would no longer be changed back from placeholders into their
correct values after the creation of the bottle tarball.
2021-05-12 21:37:33 +01:00
Carlo Cabrera
4b6f7aaa5b
extend/os/mac/keg_relocate: remove HOMEBREW_RELOCATE_METAVARS
...
It's not being used, and it breaks formulae when it is.
Plus do some extra refactoring.
2021-05-12 04:08:41 +01:00
Carlo Cabrera
a1c4243dd7
extend/os/mac/keg_relocate: refactor relocate_dynamic_linkage
...
Following feedback from #11331 .
2021-05-10 17:42:35 +01:00
Bo Anderson
ae49b06600
keg_relocate: replace Perl shebangs
2021-05-10 06:13:54 +01:00
Carlo Cabrera
dec7b97342
keg_relocate: style improvements
...
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-05-06 12:01:51 +01:00
Carlo Cabrera
8f1cd1288d
extend/os/mac/keg_relocate: relocate rpaths on macOS
2021-05-05 23:43:43 +01:00
Mike McQuaid
04abc51d1f
Cleanup use of CxxStdlib
...
- remove usage on macOS as we don't care about it there
- don't error out on incompatibility but still store stdlib on Linux
- remove (now) unused methods
2021-04-02 13:55:29 +01:00
Seeker
b9854bd4cf
rubocops: add unless_multiple_conditions
2021-01-08 10:33:54 -08:00
Rylan Polster
dda0dc72a7
format note comments
2020-11-16 02:02:52 +01:00
EricFromCanada
3768b7a6e9
apidoc: update comment wording, punctuation, formatting
2020-11-06 00:21:02 -05:00
Markus Reiter
24ae318a3d
Move type annotations into files.
2020-10-10 14:59:39 +02:00
Mike McQuaid
3663e9d5d1
os/mac/keg_relocate: handle libexec/lib.
...
We can fix up libraries in `lib` not `libexec/lib` so add an extra check
for that case.
Inspired by https://github.com/Homebrew/homebrew-core/pull/53790#issuecomment-637622329
2020-06-02 16:35:36 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files.
2019-04-20 13:27:36 +09:00
Shaun Jackman
59ee097f8d
fix_dynamic_linkage: Check HOMEBREW_RELOCATE_METAVARS
...
Only remove RPATH when HOMEBREW_RELOCATE_METAVARS is set.
See PR https://github.com/Homebrew/brew/pull/5413
2019-03-19 08:29:45 -07:00
William Woodruff
02216eedaf
mac/keg_relocate: Don't relocate loader_paths
2019-03-11 20:59:11 -04:00
William Woodruff
82dd5011e2
mac/keg_relocate: Delete loader_paths
...
Fix the call to expand_rpath.
2019-03-10 21:29:59 -04:00
William Woodruff
54aca0d14f
os/mac: Flush RPATHs from Mach-Os when possible
2019-03-10 21:07:04 -04:00
William Woodruff
2e2dea6131
mac/keg_relocate: Style nit
2019-03-10 21:07:04 -04:00
William Woodruff
d2dc4e5599
mac/keg_relocate: Drop unnecessary parens
2019-03-10 21:07:04 -04:00
William Woodruff
c4363e8c58
mac/keg_relocate: Remove short-circuit, cleanup
2019-03-10 21:07:04 -04:00
William Woodruff
a6bcbdb20d
mac/keg_relocate: Prefer String#/, add ENV check
2019-03-10 21:07:04 -04:00
William Woodruff
27d6cfb12e
[WIP] mac/keg_relocate: Emulate dylinker behavior
...
Instead of assuming that #{lib} is the correct RPATH expansion,
test all RPATHS and substitute the first one that works.
2019-03-10 21:07:03 -04:00
William Woodruff
54e6cbb343
mac/keg_relocate: Rewrite rpaths in install names
2019-03-10 21:07:03 -04:00
Mike McQuaid
737b84b54b
brew style --fix
fixes.
2018-11-02 17:29:23 +00:00
Markus Reiter
e9b9ea49a1
Update to RuboCop 0.59.1.
2018-09-17 03:45:59 +02:00
Mike McQuaid
9fca172d03
Fix HOMEBREW_RUBY_WARNINGS="-w"
...
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
ilovezfs
e8da9613fb
Revert "mach: Avoid reopening the file for relocation"
2017-09-27 02:08:23 -07:00
ilovezfs
0831f31e44
Revert "keg_relocate: use correct number of arguments in call to change_install_name"
2017-09-27 02:07:22 -07:00
Steven Peters
fc5b3778cb
keg_relocate: fix call to change_install_name
...
During the changes to macho file relocation refactoring
in #3101 , #3138 , and #3139 ,
the number of arguments to the mach::change_install_name
function changed from 3 to 2, but
there was still an instance of the function being called
with the wrong number of arguments.
2017-09-26 17:30:28 -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
Markus Reiter
2d6ae61314
Re-revert "Fix operator spacing."
2017-06-02 19:22:05 +02:00
Markus Reiter
5828eefd01
Remove to_s
from some Pathname
s.
2017-05-08 13:37:28 +02:00
Mike McQuaid
d84655efb9
Merge pull request #2442 from tdsmith/fix-symlink-relocation
...
Virtualenv relocation fixes
2017-04-05 09:32:52 +01:00
Mike McQuaid
715132642f
Revert "keg_relocate: Don't relocate dylib IDs containing metavariables."
2017-04-04 13:29:27 +01:00
Tim D. Smith
2f4eaf26a0
Use extend/OS mechanism for grep args
2017-04-02 09:04:49 -07:00
William Woodruff
0f89f6520e
keg_relocate: Don't relocate dylib IDs containing metavariables.
2017-02-19 19:51:27 -05:00
William Woodruff
6b63abb850
keg_relocate: Check HOMEBREW_TEMP's realpath when excluding name changes.
...
Since /tmp (the default HOMEBREW_TEMP) is a symlink to /private/tmp,
some build systems (like Parrot's) will attempt to use the realpath
instead of the literal /tmp we supply it with. This breaks the relocation
code, which only tested the literal HOMEBREW_TEMP and not its realpath.
2017-01-07 15:06:46 -05:00
Josh Hagins
fab2cffe5d
keg_relocate: wrap relocation locations in struct
2016-10-24 16:21:08 -04:00
William Woodruff
846a5b79b6
Remove old cctools references now that only ruby-macho is used.
2016-09-22 14:36:24 -04:00
Martin Afanasjew
832a08abcd
extend/os/mac/keg_relocate: fix weird omission
2016-07-09 17:06:29 +02:00
Mike McQuaid
f1c4141885
keg_relocate: port to generic OS. ( #453 )
2016-07-09 13:52:05 +01:00