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

Cannot build the project on macOS 11.0 Big Sur #89

Open
0xtmphey opened this issue Oct 19, 2020 · 8 comments
Open

Cannot build the project on macOS 11.0 Big Sur #89

0xtmphey opened this issue Oct 19, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@0xtmphey
Copy link

Hello folks!

I'm trying to build the project on my machine with steps described in readme but with no success:

bash-5.0$ stack build
Building all executables for `waspc' once. After a successful build of all of them, only specified executables will be rebuilt.
waspc> configure (lib + exe)
Configuring waspc-0.1.0.0...
waspc> build (lib + exe)
Preprocessing library for waspc-0.1.0.0..
Building library for waspc-0.1.0.0..
Preprocessing executable 'wasp' for waspc-0.1.0.0..
Building executable 'wasp' for waspc-0.1.0.0..
[ 2 of 11] Compiling Common
<command line>: can't load framework: Cocoa (not found)

--  While building package waspc-0.1.0.0 (scroll up to its section to see the error) using:
      /Users/tim/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.4 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.0.1.0 build lib:waspc exe:wasp --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

I guess this may be because Apple got rid of system Cocoa.framework which affects a lot of software. There are no release notes describing the change but I've seen that before.

@matijaSos
Copy link
Contributor

Hey Tim,
thanks a lot for reaching out! What version of Stack are you using? I am on High Sierra (10.13.3) with Stack 2.1.3. What you are saying about Cocoa makes a lot of sense - I tried to google around but did not find much info on it. Do you have any idea how to approach this, e.g. is it possible install Cocoa?

Also, have you tried building any other Stack projects lately? I am wondering if this is an issue for other Stack projects as well.

@0xtmphey
Copy link
Author

This is my stack version:
Version 2.5.1, Git revision d6ab861544918185236cf826cb2028abb266d6d5 x86_64 hpack-0.33.0

I've tried creating a new project with stack and run it, worked just fine. I guess the problem can be in repo's code or one of its dependencies which can use Cocoa directly or indirectly.

Also, I'm not sure if Cococa.framework can be installed, I tried once but it didn't work out. Maybe I did something wrong tho

@matijaSos
Copy link
Contributor

Yes, that's what I figured. From the error message seems like the Lib (which is majority of the code) built successfully, but when building executable (which is Wasp cli) it failed.

I guess you have XCode already installed? With it comes a lot of dev dependencies, but I guess they dropped Cocoa from it as you mentioned?

@0xtmphey
Copy link
Author

Yep, seems so @matijaSos

If you could give me a hint (I'm still new to Haskell and its ecosystem) how to find what depends on Cocoa.framework, I could try to find and fix the problem

@0xtmphey
Copy link
Author

So, @matijaSos, most likely the problem is related to fsnotify which uses hfsevents which depends on Cocoa.framework for watching file changes.
I've faced the exactly same problem in a different programming language

@matijaSos
Copy link
Contributor

This looks right, great find @tmphey. I see that hfsevents depends on OS X FSEvents API which is part of CoreServices. I guess that is included in Cocoa?

Also, have you tried downloading and running the prebuilt binary as explained here? Although I would expect it not to work as well if this is the cause since it is built dynamically.

@0xtmphey
Copy link
Author

Actually the binary works. I'm able to create a new project, build & run without an issue

@matijaSos
Copy link
Contributor

That's great! Although it would still be great to figure out how to fix this problem so you and others using Big Sur can contribute as well. We will investigate this further and any ideas you might have are of course welcome.

@matijaSos matijaSos added the bug Something isn't working label Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants