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

fpc not installing on macOS 10.12 #5732

Closed
oscu0 opened this issue Oct 9, 2016 · 37 comments
Closed

fpc not installing on macOS 10.12 #5732

oscu0 opened this issue Oct 9, 2016 · 37 comments
Labels
10.12 Sierra is specifically affected upstream issue An upstream issue report is needed

Comments

@oscu0
Copy link

oscu0 commented Oct 9, 2016

Bug reports:

FreePascal (formula is "fpc") does not compile on macOS 10.12, reporting 10.12 as an invalid build target parameter.

Gist-log: https://gist.github.com/4de22f53767976bcbdde4a328c500df5
2016-10-09 17 06 19

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

Reproducible, see #5488. I believe it's an upstream issue. They need to acknowledge 10.12 as a valid target.

@zmwangx zmwangx changed the title FreePascal not installing on macOS 10.12 fpc not installing on macOS 10.12 Oct 9, 2016
@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

Edited title so that people don't go brew info freepascal.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

I think we should put a MaximumMacOSRequirement on fpc at the moment, and wait for an upstream release.

@AntonShiryaev I would appreciate it if you can contact the upstream about the 10.12 situation. Please drop a link here if you open an issue on a public issue tracker or post to a mailing list with an archive.

@zmwangx zmwangx added upstream issue An upstream issue report is needed 10.10 Yosemite is specifically affected 10.12 Sierra is specifically affected and removed 10.10 Yosemite is specifically affected labels Oct 9, 2016
@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

I just checked and fpc installed from the official image works flawlessly on 10.12. No update to the actual code is necessary.

Do you mean fpc by upstream? Because that's almost certainly abandonware.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

fpc installed from the official image works flawlessly on 10.12

The dmg was built on an earlier macOS release. The build products could certainly work on 10.12; it's compiling on 10.12 that's a problem.

But I'll see if it's easy to patch. Give me some time.

Because that's almost certainly abandonware.

Last (major) release in November 2015; why are you convinced it's abandonware?

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

I see.
Actually, I now believe I was wrong about the project's abandonment. I re-checked, and the latest snapshot release is dated 20.09.16. I'm trying to register at their bug tracker and will post a link here once I report the bug.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

Okay, I looked into it, it's the bootstrap binary that's causing the trouble. Unless there's another way to build it that doesn't involve the bootstrap (I bet there is), I doubt we can rescue it without upstream involvement.

I'm trying to register at their bug tracker and will post a link here once I report the bug.

Cool, thanks.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

Reported here. But even if somebody notices and fixes this, they might not release an update anytime soon, going by their track record with 3.1.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

You might be able to convince @ilovezfs to port the El Cap bottle to Sierra (I ran brew test on it and it worked without problem; I would be more confident if there's a test suite). Not my favorite practice though.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

Considering the fact that fpc's bug tracker reports version 3.1.1 as being released 2015-11-26, and the version downloadable from brew and their official website is 3.0, I doubt there's much point to relying on upstream for fixes.

I would have contacted @ilovezfs, but they have not provided an email address, so unless they see this issue, I doubt they can be of assistance as well.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

No, @ilovezfs is a fellow Homebrew maintainer.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

Yes, I got that. What I meant is that there is little chance of an upstream fix for the issue I opened here reaching anyone.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

Let me make it clear:

port the El Cap bottle to Sierra

That's something we can easily do on our side. Just need a decision.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

That's really not something I'm qualified to decide.
Like I said, there is something odd going on with the project: here the reported latest version is 3.1.1, and here it's 3.0.0, so a hypothetical fix might not reach anyone. Thus, I'm personally in favour of porting it.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

That's really not something I'm qualified to decide.

That's our decision.

there is something odd going on with the project

Yeah I'm looking for a 3.1.1 download but can't find it.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

Anyway, (at least the first) problem isn't so much the 3.1.1 release, but rather the 2.6.4 bootstrap binary which doesn't work on 10.12. I'll look into whether we can bypass that after lunch.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

Source code and some builds of 3.1.1 can be downloaded here, but I'm not sure if that's the release or also has all changes made since 2015-11-26. The build dates are recent, though.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

The issue has been updated and a workaround has been provided. I'm not sure whether it can be integrated into Homebrew, though.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

I can't comment on that resolved issue. If you could, please let them know the bootstrap binary doesn't work on 10.12 due to certain libraries moved from /usr/lib to within the SDK:

$ /Volumes/Brew/HomebrewTemp/fpc-20161009-65188-134xd4r/fpc-3.0.0/bootstrap/ppcuniversal -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/Volumes/Brew/HomebrewTemp/fpc-20161009-65188-134xd4r/fpc-3.0.0/rtl/units/x86_64-darwin -Fix86_64 -FE. -FUx86_64/units/x86_64-darwin -dRELEASE    -dx86_64 -dGDB -dBROWSERLOG -Fux86 -Sew pp.pas
ld: file not found: /usr/lib/crt1.10.6.o

Someone else documented the issue in http://www.pilotlogic.com/sitejoom/index.php/forum/macos-development/3669-cannot-build-fpc-or-ide-on-macos-sierra.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

I repeated your comment more or less verbatim. The fact that someone is responding to the issues at all is somewhat reassuring.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

Interestingly, after you commented, I can comment too now.

Update. I see, the status changed to "feedback".

@ilovezfs
Copy link
Contributor

ilovezfs commented Oct 9, 2016

@AntonShiryaev #5741

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

@zmwangx FreePascal bug tracker has a new commentary the maintainer. I've checked and the library that's missing is indeed present in /usr/lib on my machine, although it may have had FreePascal installed on it at some point in the past.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

@ilovezfs Actually I have /usr/lib/crt1.10.6.o too, and setting ENV["MACOSX_DEPLOYMENT_TARGET"] = "10.9" is enough. Have you installed CLT on your VM?

(Looks like when I last checked I misread, ran ls /usr/lib/cert*, and concluded that the lib was missing.)

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

Yes, I do. I'm pretty sure I wouldn't be able to even run Homebrew otherwise. I think you need to respond to FreePascal's bug tracker about this, since the maintainer misunderstood the underlying issue.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

Yes, I do.

Well I'm asking @ilovezfs because it was him who got the ld: file not found error on his testing VM...

I'm pretty sure this is a misunderstanding, and we can set ENV["MACOSX_DEPLOYMENT_TARGET"] = "10.9" and be done with it. @AntonShiryaev You can use this patch

diff --git a/Formula/fpc.rb b/Formula/fpc.rb
index 6f0791f..326d885 100644
--- a/Formula/fpc.rb
+++ b/Formula/fpc.rb
@@ -22,6 +22,7 @@ class Fpc < Formula
     resource("bootstrap").stage { fpc_bootstrap.install Dir["*"] }

     fpc_compiler = fpc_bootstrap/"ppcuniversal"
+    ENV["MACOSX_DEPLOYMENT_TARGET"] = "10.9"
     system "make", "build", "PP=#{fpc_compiler}"
     system "make", "install", "PP=#{fpc_compiler}", "PREFIX=#{prefix}"

and verify it works.

By the way, I can't comment on the issue because it has been marked as resolved again.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

I'm afraid I'm not entirely certain how to apply your patch, could you please elaborate?
I'll reopen it.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

I've reopened the issue.

@zmwangx
Copy link
Contributor

zmwangx commented Oct 9, 2016

curl -L https://github.com/Homebrew/homebrew-core/pull/5745.diff | git -C "$(brew --repo homebrew/core)" apply
HOMEBREW_NO_AUTOUPDATE=1 brew install -s fpc
git -C "$(brew --repo homebrew/core)" checkout .

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

I pasted the whole workaround into a shell script and ran it, and it appears to be compiling. I'll report how it goes.

@oscu0
Copy link
Author

oscu0 commented Oct 9, 2016

It worked!
2016-10-09 23 49 37

I guess there is no need for porting the bottle, then. I'll comment on that issue.

@ilovezfs
Copy link
Contributor

ilovezfs commented Oct 9, 2016

There is no Homebrew DSL for requiring the CLT. Things need to be able to build with Xcode alone ;)

@cielavenir
Copy link
Contributor

cielavenir commented Oct 12, 2016

Hi, I installed fpc using your-like method: http://qiita.com/cielavenir/items/069101b97cf22b889bb5#fpc

By the way, I do have /usr/lib/crt1.10.6.o. Actually the original version on my MacBookAir was 10.8 (4 times upgrade!), so I don't know what package installed the file... Xcode CommandLine? or other?

@cielavenir
Copy link
Contributor

(Googling does find xcode-select --install fixes the crt1.10.6.o error...)

@zmwangx
Copy link
Contributor

zmwangx commented Oct 12, 2016

There is no Homebrew DSL for requiring the CLT. Things need to be able to build with Xcode alone ;)

Upstream says building and using fpc requires CLT. However unreasonable that may sound, it's a legit requirement, just like requiring GCC (or worse, a specific, non-latest version of GCC) on macOS.

We should either throw without CLT, or if there's enough demand or a consensus, add a DSL for requiring CLT. That's 10–100 times more lightweight than the Xcode requirement.

@MikeMcQuaid
Copy link
Member

Upstream says building and using fpc requires CLT.

Can you/they elaborate a bit more on why? We had a DSL previously but a CLT requirement is almost always a sign of an upstream buildsystem bug.

@ilovezfs
Copy link
Contributor

ilovezfs commented Oct 13, 2016

They just need to look for the relevant files in #{sdk}/usr/lib instead of /usr/lib. The requirement is goofy. It was fixable by simply using our el cap bottle as bootstrapper instead of their outdated one. Since Jenkins has CLT installed, we opted for this lighter weight solution but you can see #5741 for a complete fix that renders the CLT unnecessary.

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
10.12 Sierra is specifically affected upstream issue An upstream issue report is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants