Apple contributes to OBS to support screen capture using ScreenCaptureKit
github.com
github.com
https://github.com/obsproject/obs-studio/pull/5875/commits/8...
provides an excellent example of why commit messages matter. This is more than 1000 lines diff to the build system (and thus potentially very dangerous because of possible supply chain attacks) which has the commit message of
"CI: Update build scripts and Github actions workflow"
Never say what you ware doing (it's obvious this commit is updating build scripts). Say why you are doing it, especially when your commit feels unrelated or at most very tangentially related to the objective of your PR.
DEFINITELY say what you are doing. And then say why.
This blog post is a good description of the most prevalent convention in how to write good and useful messages (e.g. this is what the Linux Kernel does and given the history of git there's some flow down): https://cbea.ms/git-commit/
The key thing that means you should start with what is having a short one-line summary of what you're doing so you can look at a simple log and see which commit you're interested in.
The commit message is lazy, but breaking these into separate commits because of some "also" rule of thumb is just blindly following a rule for the sake of it.
Agreed, cargo-culting is always bad!
But, without knowing how OBS development team works, sometimes it does make sense to split commits like this, mainly if you have a larger repository where different people are responsible for different areas in the codebase.
For example, build-scripts sometimes gets managed by other people than the ones writing some core algorithms, who are also different from the people writing public APIs to be consumed by users. In those cases, it makes reviews a lot easier when you can split out to review different commits to different people, instead of having everyone navigate the same commit.
But again, not familiar with the internals nor the development cycle that OBS keeps, so maybe this doesn't make sense in this case.
This commit is based off a branch that was adding support for Apple Silicon.
So the entire PR is not going to look clean until that branch is merged first.
> ...you can't revert just one without reverting the others
That's often true in a split out patchset anyway, so I don't think that on its own it stands as a justification for doing things one way or the other.
Ruthless interactive rebase is one way to fix that last point, but if you take the final result and squash that into a single changeset, there's a point to be made about that as well.
Of course, when merged, it often makes sense to squash some commits together, just like you say - long-term, many of the feature development details are not important.
It's not an either-or proposition.
The commit should summarize what IT does, not what YOU did. In ten years, nobody will care who you are or what you did, but they will care what the code does and why.
As a linguistic note, commit messages (at least, English commit messages) almost always use an infinitive verb and therefore may be considered to have no tense at all, though to argue that infinitives have no tense you do need to draw a distinction between tense and aspect.
You're confusing a bare infinitive with an imperative. Infinitives are often, but not always, marked with to. Commit messages are not commands and are not capable of licensing imperative forms.
Here are some examples of bare infinitives in English, with the infinitive form italicized:
1. This organization will help you apply for a loan.
2a. Q: What does he do?
2b. A: Check over the paperwork to be sure everything's right.
A commit message is doing exactly the same thing as occurs in example 2b.
See also:
https://google.github.io/eng-practices/review/developer/cl-d...
https://microsoft.github.io/code-with-engineering-playbook/c...
My favored github PR template has 3 sections:
- What does this PR do?
- Why is that valuable?
- Link to bug tracker.* Description: (What this does, and why)
* Ref: (Ticket/task link)
* To test: (Specific instructions to make sure things are working as expected)
* To deploy: (What specific servers/services to restart, and operations to perform)
my personal observation: because writing down „what“ is hard. Writing down „why“ is even harder.
I don't see how adding an additional capture framework backend would require meaningful changes to the build system.
With some likelihood, in this case, Apple probably won't have the resources to rework their PR and thus the PR will stay un-merged until somebody of the project has time to merge/reimplement the relevant parts.
Which of course is a total shame and I wonder why Apple didn't have "mergeability" in mind when they decided to create their PR. They must have known that "rework the build system" can't be part of a PR adding a capture backend if they wanted any chance of this being merged.
[0] https://github.com/obsproject/obs-studio/pull/5155/commits
Aren't Apple the richest corporation in the World, how would they not have resources; am I missing a joke? Maybe you meant 'will choose not to'?
Before three was Dallas, there was The Rise And Fall Of Reginald Perrin, in the main arc a dark parody of 70s corporate England. If you could find a better audio-visual exposition of the transatlantic difference at the end of the nineteen seventies, you will struggle to find a funnier one.
http://www.leonardrossiter.com/reginaldperrin/CJisms.html
https://www.google.co.uk/search?q=reggie+perrin+i+didn%27t+g...
This happens with every transition in Apple history. It takes pulling the rug out completely before many devs will do it
Look at the Python transition, the carbon to cocoa transition, even the original Rosetta transition.
https://github.com/obsproject/obs-studio/pull/5875#issuecomm...
And it looks like they're just going to set the PR to a draft until after 5155 is merged, so it will get cleaned up and be easier to review then:
https://github.com/obsproject/obs-studio/pull/5875#issuecomm...
HN is usually better about sussing out the real story.
1. The reviewer
2. Someone scanning commit logs for patches of interest
3. Archaeologists
Archaeologists are people a year, five years, 10 years down the road who are trying to figure out how the code got to be the way that it is, so they can feel confident changing it. (See also "Chesterton's Fence"[1].) Those people should not have to dig out the conversation from some random PR to figure out what's going on.
Not knowing to look to an associated PR thread for a commit would be the equivalent of modern day archaeologists not knowing what "carbon dating" was.
Trying to understand the changes and their full implications is nearly impossible. 100 loc is a better top end imho.
https://www.goodreads.com/quotes/214064-if-you-owe-the-bank-...
When people start doing multiple things in a single commit with 1000's of changes, it does become mentally exhausting to review. Unfortunately, it requires either being extremely diligent when making the commits or being familiar with git rebase -i.
Of course, sometimes it's just thousands of lines of new code and impossible to review :).
this is why we have line printers, custom reading tables with balanced soft lighting (print proofing lamps) and more recently, rostrum cameras operated by foot switch.
review with fanfold might be a habit only acquired by formative experience, but once you physically manage the printout, and are comfortably seated with several hundred well spaced lines that aren't directly emitting typically exhausting spikey spectrum light forcing your brain to perform extremely complex colour management to balance your vision, which is the primary factor in concentration depletion in every attempt at testing we've tried over the years, and you mix in modern handwriting recognition and a pico projector display of feedback comments if necessary, I have only witnessed very high productivity. Anyone who is subject to audits will know the satisfaction of dumping fanfold boxes on the auditors desk. Or should.
The subject describes what is being affected (think easily greppable keywords)
Then, then body should go into detail about the contents and rationale for the changes.
Use specific terms like “add” or “remove” and avoid subjective descriptions like “prepare” “clean” and “fix”
For example this patch says:
> Clean up consistency of tabs/spaces in include_directories.
Well, what does clean up tabs/spaces actually mean? Saying “remove tabs in favor of spaces” is much clearer.
Also HN: no, not like that!
Don’t say what you were doing, say what the commit does. A good commit message completes the sentence “when merged this will …”.
Adding a more detailed description on the second line including why things were done is also not bad, but I have a strong opinion that design notes do not belong in the commit log but in code comments or markdown files that are in the repo, so that they can be found more easily and updated.
https://user-images.githubusercontent.com/65677710/151421432...
--
(This and 2 other videos are linked in PR conversation tab: https://github.com/obsproject/obs-studio/pull/5875)
It’s better than bitching about bad support without doing anything. But at the most fundamental of levels it’s really the company working for their customers, through a third party’s project.
I’m perfectly happy to celebrate win-win outcomes.
You are aware that there are more than two options?
“Hooray, you did the thing you’re supposed to do. Good job you”.
Even when restricting that to “open source projects that (cl)aim to run on latest MacOS”, I think that’s not something a vendor is “supposed to do”.
So, if Apple only “is supposed to” support some projects, what objective criteria should it use to pick them?
I think it’s completely fine if Apple wouldn’t support any open source. I also think it’s completely fine if developers would choose not to write software for their OS because of that.
So in practice, not very often
Of course they will commit to open source projects if it suits their needs (if they use those projects). But people have different opinion on what Apple's needs are.
Judging by the Engineering account being used to submit this patch, this is likely to be an example of the latter.
What does exist is specially "blessed" FAANG teams who are cleared to contribute to specific open-source projects that are critical to the business. Amazon has a team who contributes to the linux kernel for hypervisor support, for example.
Well done to who ever it was.
It usually comes in two flavors - individual contribution as you doing something on your own time and equipment and official contributions when the company itself contributes to a project.
This looks to be the latter rather than the former so it would make sense it would come from an Apple account.
My understanding is that Apple's policy is highly unusual in that "individual contribution as you doing something on your own time and equipment" are pretty much not allowed at all.
I am not sure exactly but I suspect this is employee-specific and may be only for those working on sensitive projects.
I worked at Apple years ago and it was never in my contract or mentioned to me. And there are plenty of more recent developers e.g. Holden Karau who were contributing to open source projects in their spare time whilst working at Apple.
I know of developers who made quite a bit of $$$ being first out the door with applications utilizing SDKs that they wrote. MS is perfectly happy with their own developers showing off shiny new features.
Interesting but not surprising I guess.
On the day of employee orientation, they specifically talk about moonlighting and HOW to do it.
"Do not use any hardware we provide for you, and do not use any software you installed from the corporate network, buy your own copy of development tools and licenses, you can use the free Azure credits we give you but not the ones linked to your employee login, make sure you use the credits on your personal account."
They do require you not write software that directly competes with existing Microsoft software, for obvious reasons, but other than that it is fair game.
But this doesn't even cover the whole of it. At multiple times, Microsoft has actively encouraged their employees to write software as a side hustle! They've launched internal competitions "We have a cool new SDK, write some software and put it on the MS Store! Best rated software wins some prize!"
The entire "developers first" culture there extends to how they treat their own employees.
Heck MS has a long tradition of employees leaving to start a new company and MS buying that company up a few years later. I suspect that during the 90s/early 2000s it was seen as a good way to innovate, similar to incubator labs within companies now days.
"When Steve came back, one of his company-wide edicts was that the names of individuals must be removed from about boxes."
He also went further than that by illegally colluding with competitors to lower wages for employees. [0] [1]. What a great man.
[0] https://www.businessinsider.com/emails-eric-schmidt-sergey-b...
[1] https://9to5google.com/2012/01/27/court-filings-show-steve-j...
It could also be that someone would rather not be out in public, which is also understandable.
It's open-source software for video recording and live streaming.
So they are mindful of people with old Macs. This is good!
https://github.com/Developer-Ecosystem-Engineering?tab=overv...
https://github.com/obsproject/obs-browser/pull/310
Strangely, a lot of contributions to numpy.
I just so wish to see this sleek and fast app replacing old cranky Xcode on macOS by adding missing features.
I've internalized that there's a difference between the PR description, commit messages, and code comments. For me there's different intended audiences for all three, and their contents should thus be shaped accordingly. This PR basically combines all three into one and uses that as the commit message, and I'm not sure of what to make of it. Is this good practice?
Personally I find the contents of the "#### Summary of Changes" list to be super-neat and helpful. But should these not be more helpful as comments inside the code? On the other hand, it does explain what the code is doing at this snapshot in time: which makes it more precise than comments in the code -- since future changes might eventually make those comments incorrect.
What's your take?
If changes are made to the code, the comments should be updated accordingly. Getting from code to a PR text is a non-obvious and difficult process and when parts of the code are updated, the trail is easily lost.
Seems like a money YouTuber, I've never watched him myself.
EDIT: ...and another one... https://youtu.be/HBXUy5fZNYU?t=890
The branch on GitHub should change its reference until the build system is merged into the main branch.
0: https://github.com/carlosonunez/obs-installer-for-apple-sili...
Natively.
There's an open PR[0], #5155, to get OBS native on Apple Silicon. That's also what your weird fork uses.
Apple's PR is on top of that work: you'll see that there are 10 or so initial commits. Thus #5155 will need to be merged first, before Apple's.
#5155 is a huge PR and has been open for 5 months. Its release will also necessitate OBS get an M1 testing solution figured out. Here's a quote[2] from an OBS team member two days ago:
> [This PR is] top of our priority list once we release 27.2. We're keenly aware of how badly people want a native Apple Silicon build, and I can assure you that we will definitely be publishing official test builds of OBS with M1 support as soon as we are able.
I would nevertheless expect for all of this to take quite a while.
[0] https://github.com/obsproject/obs-studio/pull/5155
[1] https://github.com/obsproject/obs-studio/pull/5155#issuecomm...
Some time later, I tried OBS on Windows, and it just worked, first time, no fiddling required. And I realised the problem was on the Mac side, not Obs.
I know, its just one anecdote.
Blackhole does its job, except your volume buttons stop working when you're on a multi-output device. Quite a pain.
I couldn't duplicate the OBS issues on older Macs that didn't have the T2 chip.
While nice it seems to be a trend where Apple seems to contribute to open source projects now to improve its own performance only on their own devices (blender comes to mind). Maybe Im being a bit cynical.
Still a positive I guess.
Many OSS contributions are "scratching your own itch", no?
You can provide a nice higher-level API (like ScreenCaptureKit) to access such "privileged" capabilities from normal apps, so that arbitrary open-source software (like OBS) can hook into it.
It seems like Apple already made ScreenCaptureKit for their platforms, and wanted to help OBS by hooking it up to ScreenCaptureKit to take advantage of that work.
The alternative, which is to do all the private/privileged stuff directly in OBS, means that Apple would have to give the general ability for arbitrary software to do what ScreenCaptureKit is doing, which may be a security issue (spyware that snoops on what's being displayed on screen comes to mind.) Making something like ScreenCaptureKit as the supported interface to do this kind of thing, can ensure the app triggers the proper permissions dialog/etc so that screen recording doesn't happen without user knowledge.
If Apple, Intel, AMD, NVIDIA, Arm, Qualcomm, etc. would all contribute to open source to make everything work on all their devices with good perf, then that would be very good for all users.
Expecting AMD to make open source contributions to improve software on Apple's hardware or Arm GPUs is "naive", not cynical.
It would be like expecting Tesla to go to VW and help them improve their combustion engines for free.
The point of open source (not just a free binary blob) is that you can fix the parts that matter to you.
In the case of companies, they typically work on the parts that matter to them. This has been true since the free software movement started to reach into businesses, with companies like Cygnus (of course) but also Sun, SGI, IBM etc all working just on their own platforms.
I also got a Linux preinstalled conputer, so I’m hoping (selfishly perhaps) that open source projects have great first rate open source OS support. It seems like open source is always resource strapped.
But you are right it’s not like IBM, SGI, Sun weren’t proprietary..
Make no mistake: for all of these companies, this funding was in support of their commercial activities. They have no desire, say, to write a shell so if one is popular they'll go that way. One thing we taught then in the 90s was that stepping off the mainline simply added to your support cost; this lesson is why so many proprietary companies do contribute back.
Apple's case is interesting: they think more deeply than many about this. Thus they are enthusiastic about standards when they are weak in the domain: e.g. Apple was explicit up to the Jobs level that they embraced open standards like JPEG and MP3 when trying to dig the Mac out of a deep hole; once they had a solid foothold they felt comfortable trying out proprietary formats. They went USB-C (and handed over a majority of the work on its design to the USB consortium, or so a couple of friends who worked on the standard claimed to me) because it helps adoption of the Mac and iPad; but aren't afraid to make a MagSafe connector.
It's all about strength and weakness to Apple, an approach which frankly more companies should adopt (looking at you MediaTek, AllWinner and your competitors).
Are they supposed to contribute the Windows 11 screen cap?
WebKit, LLVM, Swift… these are pretty fundamental open source projects, in addition to a bunch of other stuff.
You can’t please everyone all the time, and society is too addicted to outrage these days.
>One of the first uses of LLVM was an OpenGL code compiler for OS X
The LLVM project originally intended to use GCC's front end.
Apple chose to develop Clang, a new compiler front end that supports C, Objective-C and C++.
https://en.wikipedia.org/wiki/Clang#Background
Here's video of Apple's Chris Lattner giving a tech talk on the Google campus introducing Clang and LLVM 2.0 in 2007:
- #if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_15
+ #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500 // __MAC_10_15
ah, yes, clean code> plugins/mac-capture/mac-display-capture.m:621 - The __MAC_10_15 define may not exist on devices running < 10.15, resulting in this section not being appropriately avoided during compilation. Swapping to 101500 should work for all versions of macOS.
#if QT_VERSION > QT_VERSION_CHECK(5, 15, 0)
...
#endif
and works also for Qt 5.1 or Qt 4 or 3 (i think that's when this macro was introduced, pretty much at the same time than os x 10.1 ?)Not even just “potential” in QT’s case, a quick search turned up https://forum.qt.io/topic/31071/moc-and-qt_version_check-bug and https://forum.qt.io/topic/37882/qt-4-8-qt_version_check-and-... as cases where folks have been bit by some tooling in a Qt4 environment not understanding the macro properly.
I'm happy for you if you never typed 10150 or 01150 instead of 101500 or whatever but that's definitely not my case and I need any tool that the programming language provides to help me with that ; version macros are unambiguous and I don't remember fucking one up.
how is it the exact same ? Where is the generic MACOS_VERSION(sane, version, numbers) where MACOS_VERSION(11, 3, 0) also compiles on the macos 10.7 SDK ?
https://www.steveonstuff.com/2022/01/27/no-such-thing-as-cle...
The article says we need to use more precise words. In this case, the macro can create a bug, so is using the macro "cleaner"?