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

Link warnings for Homebrew release on compilation #2920

Closed
EpicEric opened this issue Oct 17, 2018 · 18 comments
Closed

Link warnings for Homebrew release on compilation #2920

EpicEric opened this issue Oct 17, 2018 · 18 comments

Comments

@EpicEric
Copy link
Contributor

On the Homebrew release of ponyc, I get the following warnings when compiling any program:

$ ponyc -o build basicc
Building builtin -> /usr/local/Cellar/ponyc/0.25.0/packages/builtin
Building basicc -> /Users/Eric/git/compilador/basicc
Building files -> /usr/local/Cellar/ponyc/0.25.0/packages/files
Building time -> /usr/local/Cellar/ponyc/0.25.0/packages/time
Building collections -> /usr/local/Cellar/ponyc/0.25.0/packages/collections
Building ponytest -> /usr/local/Cellar/ponyc/0.25.0/packages/ponytest
Building buffered -> /usr/local/Cellar/ponyc/0.25.0/packages/buffered
Building term -> /usr/local/Cellar/ponyc/0.25.0/packages/term
Building promises -> /usr/local/Cellar/ponyc/0.25.0/packages/promises
Building strings -> /usr/local/Cellar/ponyc/0.25.0/packages/strings
Building signals -> /usr/local/Cellar/ponyc/0.25.0/packages/signals
Building random -> /usr/local/Cellar/ponyc/0.25.0/packages/random
Building capsicum -> /usr/local/Cellar/ponyc/0.25.0/packages/capsicum
Generating
 Reachability
 Selector painting
 Data prototypes
 Data types
 Function prototypes
 Functions
 Descriptors
Optimising
Writing build/basicc.o
Linking build/basicc
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(actor.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(event.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(kqueue.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(scheduler.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(serialise.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(posix_except.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(trace.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(start.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(stdfd.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(messageq.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(asio.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(cpu.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(cycle.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(gc.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(fun.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(hash.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(heap.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(lsda.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(mpmcq.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(mutemap.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(options.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(socket.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(pool.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(stack.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(threads.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(actormap.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(delta.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(objectmap.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(pagemap.o)) was built for newer OSX version (10.9) than being linked (10.8)
ld: warning: object file (/usr/local/Cellar/ponyc/0.25.0/lib/native/libponyrt.a(alloc.o)) was built for newer OSX version (10.9) than being linked (10.8)

Building ponyc from source removes the warnings. I'm running OSX Mojave 10.14.

@jdhorwitz
Copy link

Confirmed here on OSX Mojave 10.14 as well.

@mfelsche
Copy link
Contributor

I think we should update our homebrew formula according to this doc: https://docs.brew.sh/Formula-Cookbook

E.g. the bottle part is not required anymore as we are @ hombrew/core: https://www.rubydoc.info/github/Homebrew/brew/master/Formula#bottle-class_method

@SeanTAllen
Copy link
Member

Not sure what you mean about the bottle is not required. Without the bottle, then there is no pre-built binary. That means a much longer install time for the user. Without the bottle, homebrew is building from source, it's basically macports at that point.

@mfelsche
Copy link
Contributor

Ok, I was just comparing to other Formulas to try and find something that might have caused this weird linking issues and they were missing the bottle parts. Agreed i didnt understand the bottling in homebrew ( they have a nice metaphor game going).

I am still unclear, what might cause the error, butnit can only be related to homebrew or that formula.

@dipinhora
Copy link
Contributor

dipinhora commented Nov 7, 2018

I believe this is due to superenv. The following is a bit from the log in ~/Library/Logs/Homebrew/ponyc/01.make.cc after ran brew install --build-from-source ponyc:

clang called with: -MMD -MP -march=native -mtune=generic -Werror -Wconversion -Wno-sign-conversion -Wextra -Wall -mcx16 -O3 -DNDEBUG -std=gnu11 -fexceptions -DPONY_VERSION="0.25.0" -DLLVM_VERSION="3.9.1" -DPONY_COMPILER="clang" -DPONY_ARCH="native" -DBUILD_COMPILER="Apple LLVM version 10.0.0 (clang-1000.11.45.5)" -DPONY_BUILD_CONFIG="release" -DPONY_VERSION_STR="0.25.0 [release]\ncompiled with: llvm 3.9.1 -- Apple LLVM version 10.0.0 (clang-1000.11.45.5)" -D_FILE_OFFSET_BITS=64 -mmacosx-version-min=10.8 -DUSE_SCHEDULER_SCALING_PTHREADS -c -o build/release/obj-native/libponyrt/ds/stack.o src/libponyrt/ds/stack.c -I src/common/ -I src/libponyrt/ -I /usr/local/include
superenv removed:  -mtune=generic -Werror -Wconversion -Wextra -Wall -O3 -mmacosx-version-min=10.8 -I src/common/ -I src/libponyrt/ -I /usr/local/include
superenv added:    -pipe -w -Os -mmacosx-version-min=10.9 -Isrc/common/ -Isrc/libponyrt/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -isystem/usr/local/include -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -I/usr/local/opt/libressl/include -I/usr/local/opt/[email protected]/include
superenv executed: clang -pipe -w -Os -march=native -MMD -MP -Wno-sign-conversion -mcx16 -DNDEBUG -std=gnu11 -fexceptions -DPONY_VERSION="0.25.0" -DLLVM_VERSION="3.9.1" -DPONY_COMPILER="clang" -DPONY_ARCH="native" -DBUILD_COMPILER="Apple LLVM version 10.0.0 (clang-1000.11.45.5)" -DPONY_BUILD_CONFIG="release" -DPONY_VERSION_STR="0.25.0 [release]\ncompiled with: llvm 3.9.1 -- Apple LLVM version 10.0.0 (clang-1000.11.45.5)" -D_FILE_OFFSET_BITS=64 -mmacosx-version-min=10.9 -DUSE_SCHEDULER_SCALING_PTHREADS -c -o build/release/obj-native/libponyrt/ds/stack.o src/libponyrt/ds/stack.c -Isrc/common/ -Isrc/libponyrt/ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -isystem/usr/local/include -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -I/usr/local/opt/libressl/include -I/usr/local/opt/[email protected]/include

superenv removes -mmacosx-version-min=10.8 and replaces it with -mmacosx-version-min=10.9 (among some other things it changes).

We can either update the codebase to use 10.9 in Makefile-ponyc and src/libponyc/codegen/genexe.c to match what superenv is doing or we can disable superenv by adding env :std to the formula (according to https://stackoverflow.com/a/22260944) however that might have unintended consequences (see https://docs.brew.sh/Formula-Cookbook#superenv-notes).

@erip
Copy link

erip commented Jan 26, 2019

FYSA, this is still broken in 0.26 from homebrew.

@kiwiMec
Copy link
Contributor

kiwiMec commented Jan 29, 2019

Is this a Homebrew or Pony issue?

Incidentally, you can work around this if it's annoying your nice and clean build pipeline.

  1. Use the ponyc --verbose=3 you can see the offending ld command just before the errors appear.
  2. Copy the offending ld command.
  3. Update the command to use -macosx_version_min 10.9 instead of -macosx_version_min 10.8
  4. Execute ponyc --pass=obj to generate the object code without linking it.
  5. Execute the updated command from step 3.

Hey presto no annoying errors. Just a pain.

@SeanTAllen
Copy link
Member

Technically its a Pony issue in that we use -mmacosx-version-min=10.8 in our Makefile.ponyc and homebrew Xcode is 10.9.

@kiwiMec
Copy link
Contributor

kiwiMec commented Jan 29, 2019

Once the file has been updated with the change above what tests and processes need to be executed before submitting a pull request?

@kiwiMec
Copy link
Contributor

kiwiMec commented Jan 30, 2019

@SeanTAllen 10.8 is also hardcoded in genexe.c was this intentional? On line 289. If you change Makefile-ponyc and genexe.c the issue is resolved.

@SeanTAllen
Copy link
Member

Yes. Given how old 10.8 is at this point, changing to 10.9 seems reasonable.

@kiwiMec
Copy link
Contributor

kiwiMec commented Jan 30, 2019

Cool, I've built it and used it. Works for me. Do I need to run tests and update changelog before submitting a pull request?

@SeanTAllen
Copy link
Member

Nice!

You don't need to update the CHANGELOG. Tests will be run when you open the PR but I suggest running them locally first.

Check out the "how to pull request" portion of our contributing docs. It includes some nice info about squashing, good commit messages etc.

https://github.com/ponylang/ponyc/blob/master/CONTRIBUTING.md#pull-request

@kiwiMec
Copy link
Contributor

kiwiMec commented Jan 30, 2019

So before proceeding with the change, I decided to try the same process on another mac. Mostly because we were dealing with a minimum settings flag which on these macs should not make a difference.

Using brew installed ponyc resulted in the same error. However, when I repeated the download and build process on the second mac there were no errors! This whole thing smells like a build system or environment issue.

So I am wondering if a clean, build and release would fix the issue. Especially given that not all the object files in the runtime file are being complained about. Still doesn't explain why my initial clean and build on the first machine didn't work without the code change to genexe.c.

@kiwiMec
Copy link
Contributor

kiwiMec commented Jan 31, 2019

So I reverted to the original mac tried a brew install and it had the same issue still. However, when I tried a git clone from github there were no errors. Magic. So I suspect that as long as the next release is built cleanly the issue for Brew should go away.

Anyway, the issue was that there were object files in the Pony runtime compiled to a different minimum OSX version. So as it stands, if you have OSX version 10.9 or above the compiled objects, application or library, should have no substantial issues with this. If you run 10.8 you might.

Apple only supports the last 3 OS versions. You can see this on their updates page. Although they don't directly come out and state it. They are up to 10.14, which means 10.11 and below are not supported 2018-Jan; except in the case of an upgrade to a supported version.

https://support.apple.com/en-us/HT201222

@SeanTAllen

  • Shall I update to 10.11 and submit a pull request?
  • When will the next release be through brew so we can test my assumption that the issue should go away by itself?

@SeanTAllen
Copy link
Member

@kiwiMec yes, please PR.

next release isn't scheduled until around March 1st (unless a triggers release bug is fixed in the meantime).

@kiwiMec
Copy link
Contributor

kiwiMec commented Jan 31, 2019

Pull request created. I ran make test and compiled some other code which ran without error.

@SeanTAllen
Copy link
Member

Closing under the assumption this will be fixed on next release thanks to #2998.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants