Reproduced in Xcode versions 15.0.1 and 15.1 beta 3.
If a Macro adds an enum case with an associated value, other cases are transformed at runtime. In the example below, the case foo is translated into the Macro-generated case bar(false).
There is lots of other strange behavior, such as:
Case declarations in the same file as the enum are not transformed. For example, in the code above, a function written in SimpleEnum.swift can produce SimpleEnum.foo, whereas functions in other files cannot (the declarations are transformed).
Manually-defined cases with associated values are not transformed. For example, a manually-defined case foobar(Bool) can be declared and used normally everywhere.
Additional enum cases without associated values get transformed to different cases. For example, if SimpleEnum has manual cases foo, foobar, and foobarfoo, and a Macro-generated bar(Bool), these transformations take place:
foo -> bar(false)
foobar -> bar(true)
foobarfoo -> foo
etc.
Not all associated value types in the Macro-generated case are treated the same. String associated values seems to work properly. Int yields incrementing transformations (e.g. foo -> bar(0), foobar -> bar(1), foobarfoo -> bar(2))
Radar: FB13417290
Compiler
RSS for tagDiscuss the various compiler and toolchain technologies used in development.
Posts under Compiler tag
118 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I am the author of the open-source Dynace. This is an OO extension to C. It has been in production use for around 20 years. It has been used on DOS, all Windows, Linux, macOS/Intel, VMS, PLAN9, COSMIC, SUNOS, etc. all without a problem. However it does not run on Apple M1, M2 machines.
I traced the problem to variadic function calls. I am creating a va_list in a ... function. I then pass the va_list to a second function. I wrote something to copy the the va_list (via va_copy) to see what I am getting. The first function works okay. But the second function does not. (I know you can't re-use a va_list.)
I have spend a couple of days on this and can't find a problem with my code. I tried creating a simple example but it worked. Apparently the problem is situational.
Anyway, I have no idea what is wrong or what to do next. I'd sure appreciate any help!
Thanks!
When building/archiving a mixed Obj-C/Swift app from an XCode Cloud Workflow, it seems that the GCC_PREPROCESSOR_DEFINITIONS (Preprocessor Macros) are not used. We use them for environment switching based on scheme and we'd like to send a test build to Testflight through XCode Cloud for internal testing.
If this is the case, is the only option to rewrite code to use Swift Active Compilation Conditions?
I have been using workspace to incorporate the Firebase Auth functionality in my application. I am using Xcode 15.0.1 and Firebase 10.18.0. I have included the screenshot for that as well. In which you can see that I have typed fs and g on two separate lines and it should show me the error but it's now. Also I have commented out the import of Firebase so it should also display me the error that Auth.auth() is unidentified function.
I have tried restarting my Xcode and mac as well.
I was going through this apple documention and it states, "By default, the generated header contains interfaces for Swift declarations marked with the public or open modifier", however, In my Xcode project, the public methods are not visible in the objective C code, and only the methods that are marked with @objc are visible. Is there some problem in my code or Is this a bug?
Hello,
I have create a dynamic library with gcc:
gcc -dynamiclib liblib1.c -o liblib1.dylib
I have create a binary which needs this dynamic library:
gcc -L./ -llib1 test.c -o test
I have looked at mach-o commands in test binary. I have seen the library is loaded with LC_LOAD_WEAK_DYLIB. How can i load the library with LC_LOAD_DYLIB instead of LC_LOAD_WEAK_DYLIB ?
And i have a second question: Is it possible to compile the binary with a static linking of the library ? I have tried with -static option, like i do on Linux but it does not work on macOS and i don't understand why...
Thanks
Hi, I am a student and I wanted to include <bits/stdc++.h> file in my code so that it will help me avoid including many files in my program to save time during competitive programming, but while including above file in my program, it gives error "file not found", since clang++ do not have it present by default, so I want to add it manually. Please help me fix the issue.
I already added bits folder at this location : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
following which I also created stdc++.h file but still error persists!!.
I also made bits folder with stdc++.h file at this location too : /Library/Developer/CommandLineTools/usr/include/c++/v1
but again couldn't fix the error!!
I also made respective changes in Homebrew folder (to fix it in g++ too, but again couldn't fix it!!)
Hii I want to know that is MacBook Air M1 base Varient enough for Coding iOS/app development
I'm 2023. I don't care how much time will take to make app or run the program I will also buy
External Ssd too. Pls suggest anyone who knows or 16gb is enough m1 MacBook Air cause I can afford
Only MacBook Air M1 or I have to buy MacBook Air m2 base varient
I have a project which has iOS 10.0 deployment target in which I import Network framework in some class and conditionally using it depending on the host app’s iOS version.
With Xcode 13 beta 4(13A5201i), I am able to compile and run the project successfully while debugging on iPhone device but it gives below error.
This was working fine with Xcode 12.5.1
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/lib/swift/Network.swiftmodule/armv7-apple-ios.swiftinterface:1254:19: 'NWConnection' is only available in iOS 12.0 or newer
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/lib/swift/Network.swiftmodule/armv7-apple-ios.swiftinterface:1254:1: Add @available attribute to enclosing extension
/Application/NWBrowserManager.swift:10:8: Failed to build module 'Network' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
Hi, I'm from the App Center SDKs team.
After updating Xcode from 12.4 to 12.5 our team faced build issues similar to this:
Multiple commands produce '/Users/user/Library/Developer/Xcode/DerivedData/AppCenter/Build/Products/Debug-iphonesimulator/AppCenter.framework':
1) Command: ProcessXCFramework /Users/user/appcenter-sdk-apple/AppCenter-SDK-Apple/XCFramework/AppCenter.xcframework /Users/user/Library/Developer/Xcode/DerivedData/AppCenter/Build/Products/Debug-iphonesimulator/AppCenter.framework ios simulator
2) Target 'AppCenter iOS Framework' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/AppCenter/Build/Products/Debug-iphonesimulator/AppCenter.framework'
Repro steps:
Build AppCenter iOS Framework target.
Build AppCenter target which creates an xcframework for iOS, macOS, and tvOS platforms.
Build AppCenter iOS Framework and/or AppCenter Analytics iOS Framework target.
Build SasquatchPuppet target (it uses AppCenter iOS Framework and AppCenter Analytics Framework targets).
After the issue happened only Product > Clean build folder can help.
We've tried to automate cleaning the build artifacts (BUILD_DIR) etc, but it doesn't help.
Also, we've tried to use separate Product Names for XCFramework and mere Frameworks, but it was not possible for us in the end because of the xcconfig variables visibility.
Similar issue:
https://developer.apple.com/forums/thread/679542
Project is based on python3.8 and 3.9, containing some C and C++ source
How can I do parallel computing on CPU and GPU of M1max
In deed, I buy Mac m1max for the strong GPU to do quantitative finance, for which the speed is extremely important. Unfortunately, cuda is not compatible with Mac.
Show me how to do it, thx.
Are Accelerate(for CPU) and Metal(for GPU) can speed up any source by building like this:
Step 1: download source from github
Step 2: create a file named "site.cfg"in this souce file, and add content: [accelerate] libraries=Metal, Acelerate, vecLib
Step 3: Terminal: NPY_LAPACK_Order=accelerate python3 setup.py build
Step 4: pip3 install . or python3 setup.py install ? (I am not sure which method to apply)
2、how is the compatibility of such method? I need speed up numpy, pandas and even a open souce project, such as https://github.com/microsoft/qlib
3、just show me the code
4、when compiling C++, C source, a lot of errors were reported, which gcc and g++ to choose? the default gcc installed by brew is 4.2.1, which cannot work. and I even tried to download gcc from the offical website of ARM, still cannot work. give me a hint.
thx so much
urgent
The project previously compiled using XCode 14.3, but I'm now having issues on XCode 15. It cannot find one of the header files that's used in one of my own lib that's associated to the project as a pod.
// custom class imported from my other lib
#import "fireBaseIntegration.h"
Error:
'fireBaseIntegration.h' file not found
Our Kotlin MPP code which compiled/linked fine using Xcode 15 Beta 2 no longer links using Xcode 15 Beta 3:
ld: unknown options: -ios_simulator_version_min -sdk_version
Is the option ios_simulator_version_min removed/renamed? (Intentionally?)
Should Apple or JetBrains fix this?
(also reported to JetBrains as KT-60238).
Hello All,
I am stuck in this error for a week. I tried reinstalling Xcode 14.1, adding '-f' in frameworks.sh but neither worked. Below is the error. I would really appreciate if you can help.
Also, build gets succeeded and also I can run the app on the simulator, but I cannot archive it.
Error
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/dhiralpanjwani/Library/Developer/Xcode/DerivedData/Lupus_Decision_Aid-haxtkzwojyytuwedvxiexocoohxi/Build/Intermediates.noindex/ArchiveIntermediates/Lupus\ Decision\ Aid/IntermediateBuildFilesPath/Lupus\ Decision\ Aid.build/Release-iphoneos/Lupus\ Decision\ Aid.build/Script-570BD887603D2E782013C015.sh (in target 'Lupus Decision Aid' from project 'Lupus Decision Aid')
cd /Users/dhiralpanjwani/Downloads/iOS/Lupus\ Decision\ Aid\ copy
/bin/sh -c /Users/dhiralpanjwani/Library/Developer/Xcode/DerivedData/Lupus_Decision_Aid-haxtkzwojyytuwedvxiexocoohxi/Build/Intermediates.noindex/ArchiveIntermediates/Lupus\\ Decision\\ Aid/IntermediateBuildFilesPath/Lupus\\ Decision\\ Aid.build/Release-iphoneos/Lupus\\ Decision\\ Aid.build/Script-570BD887603D2E782013C015.sh
mkdir -p /Users/dhiralpanjwani/Library/Developer/Xcode/DerivedData/Lupus_Decision_Aid-haxtkzwojyytuwedvxiexocoohxi/Build/Intermediates.noindex/ArchiveIntermediates/Lupus Decision Aid/BuildProductsPath/Release-iphoneos/Lupus Decision Aid.app/Frameworks
/Users/dhiralpanjwani/Downloads/iOS/Lupus Decision Aid copy/Pods/Target Support Files/Pods-Lupus Decision Aid/Pods-Lupus Decision Aid-frameworks.sh: line 43: source: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code
Does this exist? Apple seems to have a unique syntax it recognizes (vs GCC arm64 assembler) and getting assembly code cross compiled it for iOS in Xcode has been very frustrating and unfruitful. Is there any guidance on how to do this? The reason for assembly is to support "volk, vector optimized library".
I just started getting lots of "redefinition of" errors with headers that start with #pragma once. The C++ clang compiler is set to "C++17". Did something change with handling #pragma?
We have a 7-year old codebase that uses a mix of frameworks including Rx and Firebase through Cocoapods. The compilation works fine up to XCode 14.2 but for some unknown reason the compilation just stuck / hang on XCode 14.3.x and XCode 15. There are several warnings in the codebase but the compiler does not output any error. Which is why we don't know what the exact issue(s) is/are.
What's the change in XCode 14.3.x that could be causing this issue? If anyone has an idea on possible fix, willing to try it out.
You can still use some xcode that is no longer supported on the desktop through the terminal.
For example, my mocOS is 14.0, I installed xcode14 and xcode15 in /Applications, but xcode14 is no longer supported on the desktop.
/Applications/Xcode_14.0.app # not supported
/Applications/Xcode_15.0.app
Switch to xcode14 and use xcodebuild:
export DEVELOPER_DIR=/Applications/Xcode_14.0.app
xcodebuild -version # work well
I want to know if there is any problem with this approach?
What does the Xcode development team think of this approach?
Is there any relevant documentation that I can know about?
I'm trying to build C project with XCode 15.0, but always get error 'assert.h' file not found. I tried to clean and restart XCode, reinstall XCode and reboot, set different framework versions and project formats.
I found all entries of stdarg.h with Finder and made sure, that all directories, containing stdarg.h, contain also assert.h, but stdarg.h includes are resolved, assert.h - not. How could this be ? Many thanks for any help.
Ventura 13.6, M2, Command line tools version 2397
Has MACOSX_DEPLOYMENT_TARGET been deprecated? I do not seem to find any proper documentation of it at apple.com.
Background:
I'm building C-based application(s) and libraries (both Intel and AS) that are distributed compiled/linked to our users.
I would like to update my build machines from 10.15 (Intel) and 11 (AS), to macOS 12 (or even higher, if possible) but I would like to be sure that our users can run the executable and that they can link their code against our libraries (and our object code) also on older versions of macOS.
Ideally I would like to continue to support users on macOS 10.15 on Intel and 11 on AS, but macOS 11 on Intel would also be acceptable.
It seems MACOSX_DEPLOYMENT_TARGET (perhaps combined with SDKROOT) could allow this, but I have not been able to find anything except rumors, i.e. no proper documentation at any Apple site. Testing is not really an option since at least some problems would likely only occur at runtime (e.g. due to weak linking).
I am using the command line tools and GNU make (no Xcode project or some such, also no App Store).
Any pointers would be greatly appreciated!