Date   

Re: Strange Xcode behavior

Owen Hartnett
 

It’s an obj-C project overall, but it has one Swift file, and that is where it fails.  I’ve tried manually adding include files as you’ve suggested, but it then complains about double declarations of other terms.

I was able to reproduce on another system, and then I preened the include search paths and fixed it.  I retried on the server and still has the issue, so I must have done something on the fixed machine that I also need to do on the server.

So now it’s just a case of diff and comparisons.

Thanks for your help!

-Owen

On Aug 23, 2021, at 2:59 PM, Sak Wathanasin <sw@...> wrote:



On 23 Aug 2021, at 19:22, Owen Hartnett <owen@...> wrote:

Thanks for the reply.  Yes, I tried that.  It’s looking like some of the header paths in the build settings need to be adjusted.  Still plugging at it.

Is the problem with the Obj-C or the Swift files?

An explicit #import <sys/types.h> should pull in the definition of u_char, but that is usually in the import chain already. In my test project I didn’t have to explicitly include it. Something to do with search paths?

Sak



Re: Strange Xcode behavior

Sak Wathanasin
 



On 23 Aug 2021, at 19:22, Owen Hartnett <owen@...> wrote:

Thanks for the reply.  Yes, I tried that.  It’s looking like some of the header paths in the build settings need to be adjusted.  Still plugging at it.

Is the problem with the Obj-C or the Swift files?

An explicit #import <sys/types.h> should pull in the definition of u_char, but that is usually in the import chain already. In my test project I didn’t have to explicitly include it. Something to do with search paths?

Sak


Re: Strange Xcode behavior

Owen Hartnett
 

Thanks for the reply.  Yes, I tried that.  It’s looking like some of the header paths in the build settings need to be adjusted.  Still plugging at it.

-Owen

On Aug 23, 2021, at 1:43 PM, Sak Wathanasin <sw@...> wrote:



On 17 Aug 2021, at 15:02, Owen Hartnett <owen@...> wrote:

I’ve set up a remote build server, and a project that had been building fine is suddenly giving very strange errors.

Have you tried clearing out the “DerivedData” folder? Maybe it has stuff cached from older/newer SDKs.

Regards
Sak



Re: Strange Xcode behavior

Sak Wathanasin
 



On 17 Aug 2021, at 15:02, Owen Hartnett <owen@...> wrote:

I’ve set up a remote build server, and a project that had been building fine is suddenly giving very strange errors.

Have you tried clearing out the “DerivedData” folder? Maybe it has stuff cached from older/newer SDKs.

Regards
Sak


Strange Xcode behavior

Owen Hartnett
 

I’ve set up a remote build server, and a project that had been building fine is suddenly giving very strange errors.

This is an objective C project with one Swift file in it.  The project, when attempting to compile, shows an error:

<module-includes>:74:9: note: in file included from <module-includes>:74:
#import "net/if_dl.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/net/if_dl.h:93:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  sdl_len;        /* Total length of sockaddr */
        ^
<module-includes>:74:9: note: in file included from <module-includes>:74:
#import "net/if_dl.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/net/if_dl.h:94:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  sdl_family;     /* AF_LINK */
        ^

repeated 27 times, for each instance of u_char in the if_dl.h file. It fails when trying to compile the only Swift file.

If I copy the entire project folder to my laptop, it compiles fine without the above messages. Other team members also have no problems compiling it.  It is only on this one computer.  The source is checked out from git, there seems to be no differences in setup that I can tell.  I suppose I could drop a define for u_char in the settings, but I’d really like to find out why this is happening.  This if_dl.h file looks like a holdover from 2011.  The server is being used as a remote xcode server, and I’ve also been testing fastlane on it, but no code changes in the project itself.

-Owen


Re: NSAlert replacement on Big Sur

Leo
 

On Wed, Aug 11, 2021 at 07:00 AM, Alex Zavatone wrote:
You could fork it and add those changes if you wanted to (or had the time to) and feature it on your GitHub account.
 
Thanks that's good to know! I indeed had zero experience in GitHub collaboration.

I now forked it and it looks like I can find my way in dealing with the project further.

I'll post a link to updated project once done.


Leo


Re: NSAlert replacement on Big Sur

Alex Zavatone
 

Nice find.

You could fork it and add those changes if you wanted to (or had the time to) and feature it on your GitHub account.

Cheers,
Alex Zavatone

On Aug 11, 2021, at 2:08 AM, Leo <leo.r@...> wrote:

If you dislike the redesigned NSAlert on  Big Sur as much as I do (as well as countless other users and developers), then I recently found a github project for a much better replacement.

Here's a brief example:
<pac-alerts-bs-vs-new.png>
As you can see, it restores the human-oriented design and layout of pre-Big Sur systems.

The original project is here:

https://github.com/TroikaTronix/NSCustomAlert

It does require some changes to work properly:

Mainly, to make the window moveable, do the following in the -init method in NSCustomAlert.mm:
• Remove the NSWindowStyleMaskDocModalWindow mask
• add _panel.movableByWindowBackground = YES
 
Also, you'll need to change the font from Helvetica to systemFont... and adjust font sizes as needed. Once it's done it works perfectly.

Another small change:

In [self expandButtonSize:btn expandHorz:10.0f minWidth:75.0f] change 75 to 96 to make sure OK button is the same size as Cancel

I'm not sure that the developer still maintains the project. I left a feedback but he never responded.

I'm gradually replacing all alerts in my apps with this custom alert. I already had my own category of NSAlert so it was easy to add this class in a single place.


Note:

These two files from the entire project are sufficient to display the alert: NSCustomAlert.h and NSCustomAlert.mm. I'm not using any other files.  

The project doesn't support the "don't show again button" - but I never used it anyway.


Hope it's useful - if you have any questions let me know.

Leo


NSAlert replacement on Big Sur

Leo
 

If you dislike the redesigned NSAlert on  Big Sur as much as I do (as well as countless other users and developers), then I recently found a github project for a much better replacement.

Here's a brief example:

As you can see, it restores the human-oriented design and layout of pre-Big Sur systems.

The original project is here:

https://github.com/TroikaTronix/NSCustomAlert

It does require some changes to work properly:

Mainly, to make the window moveable, do the following in the -init method in NSCustomAlert.mm:
• Remove the NSWindowStyleMaskDocModalWindow mask
• add _panel.movableByWindowBackground = YES
 
Also, you'll need to change the font from Helvetica to systemFont... and adjust font sizes as needed. Once it's done it works perfectly.

Another small change:

In [self expandButtonSize:btn expandHorz:10.0f minWidth:75.0f] change 75 to 96 to make sure OK button is the same size as Cancel

I'm not sure that the developer still maintains the project. I left a feedback but he never responded.

I'm gradually replacing all alerts in my apps with this custom alert. I already had my own category of NSAlert so it was easy to add this class in a single place.


Note:

These two files from the entire project are sufficient to display the alert: NSCustomAlert.h and NSCustomAlert.mm. I'm not using any other files.  

The project doesn't support the "don't show again button" - but I never used it anyway.


Hope it's useful - if you have any questions let me know.

Leo


Re: What Happened and How Do I Fix It?

Rick Aurbach
 

I just backed off Xcode 13.0ß3 and moved back to ß2. I'm compiling again. BUT...

(1) I don't know why the local SPM packages should have been compiled with the APPLICATION_EXTENSION_API_ONLY flag. The flag is not set anywhere in the project.
(2) There have been a lot of problems with Xcode's implementation of SPM which are (at least partially) due to having absolutely no control over package compilation.
(3) Every time the Xcode team fixes something related to SPM, it seems like they either reveal or introduce new bugs. Based on the problems I've been having over the past year, I am having some serious issues with what aspects of the feature set are included in their test suites. (And please understand that I mean no disrespect. Xcode is an outstanding achievement. But I've reported a half-dozen or so common use-cases that don't work at all [and hence must not be included in their test suite.])

I wish I had an estimate of the amount of time I've wasted trying to use features which are purported to work regarding SPM. It's certainly at least 3 man-months. Probably more.

– frustrated in St. Louis


Re: What Happened and How Do I Fix It?

Rick Mann
 

I may have missed previous emails that specified this, but I'm using SPM dependencies exclusively, and running into issues that (mostly) have workarounds.

As of Xcode 13b3/iOS 15b3, more APIs have been marked as not available to application extensions, which broke one of the SPM dependencies we have.

In b2, Apple made some AVFoundation results no longer `Unmanaged`, which breaks our code (which must still compile under Xcode 12.5.1). It's not clear to me if code written with the iOS 15 SDK can operate on iOS 14

The "workaround" is to stick to 13b1.

Lastly, switching between 12.5.1 and 13 requires us to "reset package caches" (File menu) every time we switch.

On Jul 21, 2021, at 08:26 , Rick Aurbach via groups.io <rlaurb=me.com@groups.io> wrote:

Just one more thing...

It turns out that all of the errors that I'm referring to here occur while compiling local SPM packages. I'm beginning to think that this is:
(a) yet another bug with the Xcode implementation of SPM. (If so, it's the fourth [or so; hard to keep count] that I've uncovered.
(b) another reason to give up on SPM as a good idea whose implementation is fatally flawed.

Honestly, I've invested months on refactoring my entire development environment to use SPM for local packages, and I am about ready to chuck it. I will waste less time by undoing my reliance on SPM than I will trying to get things to work with Xcode.
--
Rick Mann
rmann@latencyzero.com


Re: What Happened and How Do I Fix It?

Jonathan Prescott
 

It’s “Require Only Application-Extension-Safe API”
Jonathan

On Jul 20, 2021, at 3:37 PM, Rick Aurbach via groups.io <rlaurb@...> wrote:

On Tue, Jul 20, 2021 at 02:25 PM, Ben Kennedy wrote:
APPLICATION_EXTENSION_API_ONLY
Not that I can find. Entering this string into the searchBar of Build Settings finds nothing.


Re: What Happened and How Do I Fix It?

Rick Aurbach
 

Just one more thing...

It turns out that all of the errors that I'm referring to here occur while compiling local SPM packages. I'm beginning to think that this is:
(a) yet another bug with the Xcode implementation of SPM. (If so, it's the fourth [or so; hard to keep count] that I've uncovered. 
(b) another reason to give up on SPM as a good idea whose implementation is fatally flawed.

Honestly, I've invested months on refactoring my entire development environment to use SPM for local packages, and I am about ready to chuck it. I will waste less time by undoing my reliance on SPM than I will trying to get things to work with Xcode.


Re: What Happened and How Do I Fix It?

Rick Aurbach
 

On Tue, Jul 20, 2021 at 02:25 PM, Ben Kennedy wrote:
APPLICATION_EXTENSION_API_ONLY
Not that I can find. Entering this string into the searchBar of Build Settings finds nothing.


Re: What Happened and How Do I Fix It?

Ben Kennedy
 

Is the build setting APPLICATION_EXTENSION_API_ONLY (“Require Only App-Extension-Safe API”) enabled anywhere?

b

On 20 Jul 2021, at 11:57 am, Rick Aurbach via groups.io <rlaurb=me.com@groups.io> wrote:

It all looks normal to me...(but what do I know?)
<Capto_Capture 2021-07-20_01-53-05_PM.png><Capto_Capture 2021-07-20_01-53-48_PM.png><Capto_Capture 2021-07-20_01-55-14_PM.png>


Re: What Happened and How Do I Fix It?

Rick Aurbach
 

Oh, yes... and from the project's "project.pbxproj" file (notice that product-type is 'application'),

/* Begin PBXNativeTarget section */
        69421F382653228F0031DC82 /* WineCorner */ = {
            isa = PBXNativeTarget;
            buildConfigurationList = 69421F50265322910031DC82 /* Build configuration list for PBXNativeTarget "WineCorner" */;
            buildPhases = (
                69421F352653228F0031DC82 /* Sources */,
                69421F362653228F0031DC82 /* Frameworks */,
                69421F372653228F0031DC82 /* Resources */,
            );
            buildRules = (
            );
            dependencies = (
            );
            name = WineCorner;
            packageProductDependencies = (
                69421F60265325E10031DC82 /* Extensions */,
                69421F62265325E10031DC82 /* iOSLib */,
                69D1858F267C0565008FE9D8 /* DropDownObjects */,
                69EF266326892A4B00FC8367 /* CoreDataStack */,
                691483AC269F8BE000C3976A /* DropDownObjectsCD */,
            );
            productName = WineCorner;
            productReference = 69421F392653228F0031DC82 /* WineCorner.app */;
            productType = "com.apple.product-type.application";
        };
/* End PBXNativeTarget section */


Re: What Happened and How Do I Fix It?

Rick Aurbach
 

It all looks normal to me...(but what do I know?)


Re: What Happened and How Do I Fix It?

Alex Zavatone
 

What do your app’s settings indicate?

On Jul 20, 2021, at 12:47 PM, Rick Aurbach via groups.io <rlaurb=me.com@groups.io> wrote:

<Capto_Capture 2021-07-20_12-37-54_PM.png>


What Happened and How Do I Fix It?

Rick Aurbach
 

Xcode 13.0ß3, project has a single target (set up as an app).

I moved some files from the main project to a local SPM package and when Xcode has some problems with that, I deleted the app's folder in DerivedData.

Restarted Xcode, let it resolve dependencies, index, etc. Then attempted to build.

I now get errors (see attached) which seem to indicate that Xcode thinks I'm suddenly developing an application extension instead of an application. Don't know why this happened or how to fix it. Any thoughts??



Re: Xcode 13: First brief UI notes

Rick Mann
 

On Jun 24, 2021, at 06:32 , Alex Zavatone via groups.io <zav=mac.com@groups.io> wrote:

Why Apple started using the disabled gray color for the command keys is monumentally stupid. Every time I look at a command key for a menu item in Xcode, my first reaction is “why is this disabled?"
💯

--
Rick Mann
rmann@latencyzero.com


Re: Xcode 13: First brief UI notes

Carl Hoefs
 

Sweet!

On Jun 24, 2021, at 12:42 PM, Alex Zavatone via groups.io <zav@...> wrote:

I long for the interface from 11 years ago.  Honestly, I would kill to have Snow Leopard’s UI back.  


1 - 20 of 1432