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

conda build fails with recent XCode versions #683

Closed
javierggt opened this issue Jul 15, 2021 · 12 comments
Closed

conda build fails with recent XCode versions #683

javierggt opened this issue Jul 15, 2021 · 12 comments

Comments

@javierggt
Copy link
Contributor

javierggt commented Jul 15, 2021

Description
Our current conda build fails with recent XCode versions. The following table comes from issue #636:

+---------+--------+
| version |    OK? |
+---------+--------+
|    10.3 | not OK |
|    11.2 |     OK |
|    11.3 |     OK |
|    11.4 |     OK |
|    11.5 |     OK |
|    11.7 |     OK |
|    12.  |     OK |
|    12.2 | not OK |
|    12.3 | not OK |
|    12.4 | not OK |
+---------+--------+

To Reproduce

  • install XCode > 2.1
  • install conda 4.8.3 (our current version)
  • follow the build process:

For reference

macOS 12.6 runner info

Expected behavior
Packages should build

@javierggt
Copy link
Contributor Author

As of today, it seems that all versions of XCode that worked have been removed from Github runners, which means that packages that need to be compiled will fail to build.

@taldcroft
Copy link
Member

This sounds alarming. Presumably it is not only sot / Ska that would be impacted by this? Is there widespread breakage elsewhere or what are we doing differently from other packages e.g. astropy that build conda packages on Mac?

@javierggt
Copy link
Contributor Author

I do not know. I googled and did not find much. All the comments about this error say to use an older XCode, which is out of the question. I found a page where they pointed out that indeed conda-forge (I believe) uses an old version of XCode.

@javierggt
Copy link
Contributor Author

and for the record, the versions of XCode that I see currently in the macos-latest workers are:

  • /Applications/Xcode_13.1.0.app
  • /Applications/Xcode_13.1.app
  • /Applications/Xcode_13.2.1.app
  • /Applications/Xcode_13.2.app
  • /Applications/Xcode_13.3.1.app
  • /Applications/Xcode_13.3.app
  • /Applications/Xcode_13.4.0.app
  • /Applications/Xcode_13.4.1.app
  • /Applications/Xcode_13.4.app
  • /Applications/Xcode_14.0.0.app
  • /Applications/Xcode_14.0.1.app
  • /Applications/Xcode_14.0.app
  • /Applications/Xcode_14.1.0.app
  • /Applications/Xcode_14.1.app

@javierggt
Copy link
Contributor Author

there has to be another issue I am missing, because things build in recent OSX, right?

@javierggt
Copy link
Contributor Author

I believe one way we are doing different from astropy is that they maintain a feedstock, so the process is completely different.

@javierggt
Copy link
Contributor Author

javierggt commented Nov 3, 2022

Maybe this: https://stackoverflow.com/questions/72467528/ld-unsupported-tapi-file-type-tapi-tbd-in-yaml-file-library-developer-comm

The issue might be in the package build formulas, which require a specific compiler version, which might pull in older llvm versions.

@taldcroft
Copy link
Member

taldcroft commented Nov 4, 2022

I'm not going to be of much use in the hairy details, I only can note that on my Mac I have Xcode 12.4 and was able to successfully build Ska.Numpy, cxotime, and xija in the local git repos. This is different from what you reported in your success matrix, except that I just did a local build in each case (as opposed to "follow the build process") so I'm not sure if that makes a difference.

rm -rf build
python setup.py build

@javierggt
Copy link
Contributor Author

I only can note that on my Mac I have Xcode 12.4 and was able to successfully build...

That is because you did not use conda to build it. I can reproduce it in my machine, see steps below.

The problem is that conda installs its own compiler, and the latest compiler in the defaults channel does not work (the link in my last comment). The compiler (clang and llvm) version in defaults is 12.0.0 and in conda-forge is 14.0.4. Everything works if one uses conda-forge.

Now you might ask: why are packages downloaded from "defaults"? Well, we never added the packages required to build to our own conda channel, so they have always used the defaults channel.

  • conda create -n conda-build
  • add our conda channel and "defaults" channel to the environment's condarc
  • ./ska_builder.py xija --tag 4.29.0

Then I see this in the output:

The following NEW packages will be INSTALLED:
...                                                    
    clang_osx-64:               12.0.0-h7ad7729_2 

and finally the error:

ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'x86_64-apple-darwin13.4.0-clang' failed with exit status 1

If I replace "defaults" by "conda-forge", I see this:

The following NEW packages will be INSTALLED:
...                                       
    clang_osx-64:               14.0.4-h3a95cd4_2         conda-forge 

and the build succeeds.

@javierggt
Copy link
Contributor Author

a separate issue is why, if I set the conda channels in the environment, it does not honor that. In any case, we have a way now.

@javierggt
Copy link
Contributor Author

I have a version of the workflow working. I added the conda-forge channel, but then I had to manually remove the defaults channel (I believe that is related to this issue in setup-miniconda).

@jeanconn
Copy link
Contributor

I think this doesn't need an open issue at this point.

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

No branches or pull requests

3 participants