Toots for cocoaphony@mastodon.social account

Written by Rob Napier on 2025-02-03 at 13:11

For me at least this will likely to be the most important Swift announcement in years. https://www.swift.org/blog/the-next-chapter-in-swift-build-technologies/

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-02-03 at 00:44

I don't think this is quite a final solution. It seems to work and there's a certain "weak linking" aspect to it. But it's hard to see when it will be a problem. I have another test support framework where this doesn't happen. I have some feelings about why (I think maybe being in a monorepo vs across multiple repos matters; but it might just be the number of dependency layers), but not enough to convince me I'm missing a simpler answer. I haven't been able to easily repro it in a smaller repo.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-02-03 at 00:40

Continuing this exploration.

I key thing I believe to watch out for is any Frameworks showing up in an xctest bundle. This is very likely to cause a collision. I'm considering writing a tool to watch for this case.

The root is a testing support framework that itself relies on shipping frameworks. The solution so far is to remove the dependencies from the test support framework, and add an #if canImport wrapper on the test support code so it only works when linked with something else.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-31 at 22:27

I am pretty sure I’ve figured it out. The test target for hosted Xcode tests is a plugin. If you have a test target that depends on things that your app also depends on, the test target will get its own copy of the frameworks. That will lead to collisions that will mostly work, but can lead to duplicate statics for example.

Currently I’m exploring how to remove that dependency. It breaks the test’s build of course. I’m exploring wrapping the shared code in a “if canImport” which might work.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-31 at 02:56

My current suspicion is it’s related to how I’m importing things. A imports B. The app imports both A and B. The tests import A.

The B the app sees is different than the B the tests see.

I might be able to figure out the right Package config, but just moving B into A also seems to fix it, and that’s not bad in this case.

I’m not sure how much it would take to make an example project. The fact that there are two repositories might matter. I’ll see.

But I wish I knew what PackageProduct meant.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-30 at 23:18

I'm a bit confused why some most frameworks in SPM build as X.framework, but a few build as X__PackageProduct.framework.

I have one of those, and it seems to be linking twice in my unit tests, leading to two copies of a static variable.

I'm certain I have two copies of a static variable, but I'm not yet certain it's related to the "PackageProduct."

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-26 at 02:26

Moving to #Connecticut has generally improved my civic pride. The political arguments here have been the kind of disagreements you expect in a sane system. And then I see my 2nd district rep, Joe Courtney, posting congratulations about the "peaceful transfer of power" and "I look forward to working with the new administration" and I want to throw up. I admit, it's better than "Mark Robinson is a serious contender for Governor." But still, how can you have such a safe seat and still no spine?

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-24 at 15:34

While writing unit tests for complex existing code, must…resist…refactoring at the same time… Tests first. Then refactor.

Must…resist.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-20 at 20:46

Assembly is slightly tricky because it's a bit hard to mix honey, ice, and seltzer. But here's how I do it.

2/2

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-20 at 20:45

New drink I'm working on. I've been exploring apple cider vinegar, which I find helps reduce heartburn for me (I don't get how vinegar could help heartburn, but it does seem to).

It took me a while to find the right bitters. But lavender bitters go very well with honey.

1/2

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-19 at 21:37

Getting ready for a bit of a snowstorm. They say it's likely to be the biggest since we moved here. So, I think I should definitely settle in and assemble this Raspberry Pi I just picked up to do some Home Assistant dev work. That is a totally normal cozy snowstorm evening.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-19 at 04:03

I really shouldn’t do work work on the weekends, but deleting useless mocking code is just so satisfying that I’d probably do it all weekend for free if I could get my PRs reviewed. Deleted 500 lines of mocking code today. Replaced it with a few lines of “oh, testing? Write to /dev/null; reset at the end of the test.” Same test value.

Please stop “mocking” things.

Eventually I’ll write the blog series and give the talks explaining it all, but it really feels good just to do it now.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-10 at 21:40

So far, I have never complied. I have a existing linked accounts that I can use to get money out of Wise. And I'm filling out the paper forms for Fidelity. But it's getting harder and harder. It used to be you had to hunt for the "manually link accounts" button, but they're steadily taking that away. (Fidelity let me try to manually link the account, and at very end said "hah! you actually have to give us your password.")

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-10 at 21:34

It really makes me mad when a financial company says that, "for security," they require you to hand over your banking credentials into some thirdparty site who promises that they will in fact scrape all of your data using that password.

That is not "security."

Wise (formerly Transferwise) will absolutely not allow me to link a bank account without handing over its password and every piece of data that password can fetch.

Fidelity will, but requires elaborate hoop-jumping and a paper form.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-08 at 19:44

I've generally been in favor of the "put protocol conformance in extensions" approach that @dimsumthinking advocates.

But chasing down "Main actor-isolated property '...' cannot be used to satisfy nonisolated protocol requirement" warnings, when you can't figure out what protocol is being referenced and it isn't done in this file? yeah… got me questioning myself on that.

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-06 at 20:53

@mattiem I know you like a good concurrency puzzle; maybe this one will amuse you, bridging Combine with cancellation.

(@johnsundell, you may also be interested since you wrote on this without cancellation.)

=> More informations about this toot | View the thread

Written by Rob Napier on 2025-01-06 at 19:35

@robertryan I've been exploring your AsyncAwaitFuture for some production code. I've been puzzling over whether this can be made into an init on Future, so that the "awaitness" isn't in the type. I need it for a protocol conformance, but in general it feels this shouldn't be in the type.

It's not coming to me, though.

https://stackoverflow.com/a/78899940/97337

=> More informations about this toot | View the thread

Written by Rob Napier on 2024-12-17 at 22:38

When developing cli tools with ArgumentParser, I generally create a two scripts in the source directory like this (for a tool called "fin"):

$ cat fin

swift run -c release fin $*

$ cat install

swift build -c release && rm -f ~/bin/fin && cp .build/release/fin ~/bin

fin --generate-completion-script zsh > ~/.oh-my-zsh/completions/_fin

This way while developing, I can run ./fin to get the dev version, and I can get shell completion.

Is there a more built-in way to do that w/o custom scripts?

=> More informations about this toot | View the thread

Written by Rob Napier on 2024-12-16 at 02:58

While I think you're 100% justified to block anyone you like for whatever reason or no reason, I also like the idea there are people you might want to hear from if they would just think about their reply for more than 40 seconds. If after thinking about it for a day they have something they think is worth saying, that's great.

I write a lot of posts I let "marinate" for an hour or two, then delete without posting because they weren't worth it. More probably should.

https://fed.brid.gy/r/https://bsky.app/profile/did:plc:wcmdstkjsrghcsa6e76kocbs/post/3ldeqrtqfxk24

=> More informations about this toot | View the thread

Written by Rob Napier on 2024-12-15 at 19:37

Though I'm not sure if I can fall back to the REST API or not. I want historical data (dailyStatistics in the Swift API), and I'm not seeing that available on the REST side. It looks like you might be able to take specific snapshots by passing currentAsOf, but I don't see anywhere they publish high/low temperatures for a given day.

(I'm computing degree-days for an energy-tracking tool I'm working on.)

=> More informations about this toot | View the thread

=> This profile without reblog | Go to cocoaphony@mastodon.social account

Proxy Information
Original URL
gemini://mastogem.picasoft.net/profile/109430/reblog
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
348.549637 milliseconds
Gemini-to-HTML Time
4.80621 milliseconds

This content has been proxied by September (3851b).