profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/dmaclach/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
dmaclach dmaclach @google I work on Apple Developer Tooling at Google. Objective-C, Swift, build systems, protocol buffers, etc.

bazelbuild/tulsi 425

An Xcode Project Generator For Bazel

dmaclach/ld64 40

Instructions on how to build the ld64 linker on macOS

dmaclach/brisk 1

A macOS app for submitting radars

dmaclach/libPhoneNumber-iOS 1

iOS port from libphonenumber (Google's phone number handling library)

dmaclach/articles 0

Weekly articles for NSHipster.com

dmaclach/bazel 0

Correct, reproducible, and fast builds for everyone.

dmaclach/bazel-skylib 0

Common useful functions for writing custom build rules with Skylark

dmaclach/class-dump 0

Generate Objective-C headers from Mach-O files.

dmaclach/CocoaLumberjack 0

A fast & simple, yet powerful & flexible logging framework for Mac and iOS

dmaclach/CodeMirror 0

In-browser code editor

Pull request review commentprotocolbuffers/protobuf

Add two new generation options around objc prefix usage.

 bool ObjectiveCGenerator::GenerateAll(         generation_options.expected_prefixes_suppressions.push_back(             std::string(split_piece));       }+    } else if (options[i].first == "prefixes_must_be_registered") {+      // If objc prefix file option value must be registered to be used. This+      // option has no meaning if an "expected_prefixes_path" isn't set. The+      // available options are:+      //   "no": They don't have to be registered.

May just want to mention in both cases what the default state is just to be clear.

thomasvl

comment created time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent
CommitCommentEvent

pull request commenterikdoe/ocmock

Switch to inclusive language for methods excluded from forwarding.

methodsNotToForward would get my vote.

benstiglitz

comment created time in 12 days

pull request commenterikdoe/ocmock

Switch to inclusive language for methods excluded from forwarding.

Thanks for jumping on this Ben! Might I suggest denyList instead of blockList just because "block" is an overloaded term in Objective-C?

benstiglitz

comment created time in 12 days

pull request commentbazelbuild/bazel-skylib

Update partial.bzl to generate better markdown

Updated

dmaclach

comment created time in 2 months

push eventdmaclach/bazel-skylib

dmaclach

commit sha 3d02fbb37f0ccced8e696f020d652bacad68ba12

Update partial.bzl For https://github.com/bazelbuild/bazel-skylib/pull/308 I edited the markdown directly. I should've updated the bzl file and generated the documentation.

view details

push time in 2 months

PR opened bazelbuild/bazel-skylib

Update partial.bzl to generate better markdown

For https://github.com/bazelbuild/bazel-skylib/pull/308 I edited the markdown directly. I should've updated the bzl file and generated the documentation.

+64 -82

0 comment

2 changed files

pr created time in 2 months

push eventdmaclach/bazel-skylib

dmaclach

commit sha 948069e037565158184ea351b81760298a6a0207

Update partial.bzl For https://github.com/bazelbuild/bazel-skylib/pull/308 I edited the markdown directly. I should've updated the bzl file and generated the documentation.

view details

push time in 2 months

push eventdmaclach/bazel-skylib

dmaclach

commit sha a67815cb83597714994e7a58f1744fee9ff45a06

Update partial.bzl For https://github.com/bazelbuild/bazel-skylib/pull/308 I edited the markdown directly. I should've updated the bzl file and generated the documentation.

view details

push time in 2 months

push eventdmaclach/bazel-skylib

dmaclach

commit sha 4eb28c458c610ceb5eace809a7049799808726dc

Add support for repr/str to new_sets (#42)

view details

Taras Tsugrii

commit sha b09d5d41b255924df04218b67d01b5f44c33e1dd

Add type checking functions. Even though it's not great to use type checks, they are frequently useful for checking input types of macros. Because there is no standard way of checking types, at least 2 types of checks are used: - `type(foo) == type([])` - `type(foo) == "list"` The first option is not very readable and the second option seem to be relying on an Bazel implementation detail. Encapsulating type checks into this library enables consistent and easy to understand type checking without explicitly relying on implementation details.

view details

Laurent Le Brun

commit sha 9430df29e4c648b95bf39a57e4336b44a0a0582a

Merge pull request #43 from ttsugriy/type_defs Add type checking functions.

view details

Thomas Van Lenten

commit sha a5431b7babb0a646151ffcca7fef47399026448f

Update check to use buildifier's exit status instead. buildifer 0.12.0 release sets the exit status for diff.

view details

Thomas Van Lenten

commit sha e5203c0f5d51cb263f6edc23b8b1722dcde0bd4e

Reformat .bzl files with buildifier and add format check. Buildifier 0.12.0 includes initial support for reformatting .bzl files. - Reformat all the bzl files. - Expand the travis check to check the .bzl files also.

view details

Thomas Van Lenten

commit sha 3b6bba355c9313823eacc94a67342dd865385865

Fix up skylint issues.

view details

Thomas Van Lenten

commit sha 3fea8cb680f4a53a129f7ebace1a5a4d1e035914

Add missing dep

view details

oquenchil

commit sha 6301f974f02350fe973d8631cf1bb87ab8d2a2bd

Makes package public by default When creating a skylark_library A anywhere downstream, if a bzl file in A loads() any of the bzl libraries in this package, then the bzl files in this package will have to be in deps as a skylark_library. The current public filegroup cannot be used as a dependency of skylark_libraries.

view details

Thomas Van Lenten

commit sha 7490380c6bbf9a5a060df78dc2222e7de6ffae5c

No need to list visibility that matches the default.

view details

Thomas Van Lenten

commit sha c0b0c4400e635827a908cde9fa19937c55b01237

Fix executable bit on selects.bzl

view details

Thomas Van Lenten

commit sha ca5f717ebaf0372b9dc1ea98b97c240f96c4fa09

Update the module list.

view details

Thomas Van Lenten

commit sha b5f4086001aa239cb5fc8e34adc1f65e827709e0

Remove usage and suggests for lib.bzl. As more things are added, lib.bzl is an anti-pattern as the cost of loading it actually just keeps increasing and most things will never use everything out of it. The pattern the should be used is to directly import the modules one uses.

view details

Laurent Le Brun

commit sha 0914f49694347ab479a8a3d863d18284825cd311

Merge pull request #56 from thomasvl/avoid_lib Remove usage and suggests for lib.bzl.

view details

Thomas Van Lenten

commit sha e9fc4750d427196754bebb0e2e1e38d68893490a

Move to Xcode 9.4 for testing.

view details

Thomas Van Lenten

commit sha 1099dd2d0a80649700e3dff0cfc759cfe0f86c6e

deprecate lib.bzl. (#58) - tag the :lib target as such. - print() a warning when lib.bzl is loaded.

view details

c-parsons

commit sha 6e2d7e4a75b8ec0c307cf2ff2ca3d837633413ca

Rename a number of instances of 'skylark' to 'starlark' or 'bzl' Most notably, this renames/moves a few important identifiers: //:skylark_library.bzl -> //:bzl_library.bzl skylark_library -> bzl_library SkylarkLibraryInfo -> StarlarkLibraryInfo

view details

Julio Merino

commit sha 8cecf885c8bf4c51e82fd6b50b9dd68d2c98f757

Remove spurious newlines from fail/print messages (#60) The fail() and print() primitives take strings without newlines in them because the formatted output will already contain newlines. Therefore, remove them, which have been annoying me to no end when using rules_go with a HEAD-built Bazel binary. While doing this, also switch to using .format() consistently for all strings, merge two related debug messages into the same print() call, and fix grammar.

view details

TechSY730

commit sha d17ca08d2800f90e377f8776e885fb57fbec1b13

Make _precondition_only_sets_or_lists in sets.bzl not assume type() returns a string. (#62) Such an assumption makes this check brittle in the face of potential future changes to type().

view details

TechSY730

commit sha 7a9648fed627e55d873d0c9e56213c89cd6cfe1e

Update to google style (#63) * Update skylark_library.bzl to conform to Google's code style.

view details

Thomas Van Lenten

commit sha 6ad5e286cbdbd5c3059ac7f70f5f7faa89bd6669

Cache the types to avoid fetching it every time. (#64) Along the lines of the caching done in #62

view details

push time in 2 months

push eventdmaclach/bazel-skylib

push time in 2 months

push eventdmaclach/bazel-skylib

dmaclach

commit sha f2c2d2527f50d9af288b3da0f9bcd782daff0b67

Update partial.bzl For https://github.com/bazelbuild/bazel-skylib/pull/308 I edited the markdown directly. I should've updated the bzl file and generated the documentation.

view details

push time in 2 months

PR opened bazelbuild/bazel-skylib

Update partial_doc.md

Clean up the docs to make them look significantly better.

No semantics changes, just styling.

+21 -4

0 comment

1 changed file

pr created time in 2 months

push eventdmaclach/bazel-skylib

dmaclach

commit sha 345efa34595b764f18536d59122ae56c93293167

Update partial_doc.md Clean up the docs to make them look significantly better. No semantics changes, just styling.

view details

push time in 2 months

push eventdmaclach/ocmock

Dave MacLachlan

commit sha 84fcb4d370644332e12c2d3c4a38796d9c1e3fd3

Fix up crash when calling object_getClass on non object. This fixes up a crash that was found in Chrome when running on an iOS 15 device. It did not show up on the simulator. https://chromium-review.googlesource.com/c/chromium/src/+/3011651 Calling `object_getClass` on something that isn't an object is at best undefined behavior.

view details

push time in 2 months

PR opened erikdoe/ocmock

Fix up crash when calling object_getClass on non object.

This fixes up a crash that was found in Chrome when running on an iOS 15 device. It did not show up on the simulator.

https://chromium-review.googlesource.com/c/chromium/src/+/3011651

Calling object_getClass on something that isn't an object is at best undefined behavior.

+33 -3

0 comment

3 changed files

pr created time in 2 months

create barnchdmaclach/ocmock

branch : ios15_2

created branch time in 2 months

PullRequestReviewEvent

push eventdmaclach/ocmock

Dave MacLachlan

commit sha 0b3faf2a2b818c6a326ac50e9691c8fc909804d5

Fix up potential race conditions with class mocks. Partial fix for #501. Wraps up a bunch of locations with synchronization blocks to attempt to make sure that the class is coherent before it starts receiving messages.

view details

push time in 3 months

PR opened erikdoe/ocmock

Fix up potential race conditions with class mocks.

Partial fix for #501. Wraps up a bunch of locations with synchronization blocks to attempt to make sure that the class is coherent before it starts receiving messages.

+49 -42

0 comment

1 changed file

pr created time in 3 months

create barnchdmaclach/ocmock

branch : ios15

created branch time in 3 months

issue openederikdoe/ocmock

ocmock tests have problems with Xcode 13.0b2 on iOS15

If I open b9c7fb949d7afc7087165b9c57fb5d7ddbe2ce4d in Xcode 13 and execute the tests on an iOS15 simulator multiple times, I eventually get a crash in something like:

Test Case '-[OCMockObjectTests testRaisesExceptionWhenMethodWithWrongVoidPointerArgumentIsCalled]' started.
2021-07-08 14:35:17.501008-0700 xctest[68194:138191625] +[NSMutableData ocmock_replaced_allocWithZone:]: unrecognized selector sent to class 0x7fff86364520
Test Case '-[OCMockObjectTests testRaisesExceptionWhenMethodWithWrongVoidPointerArgumentIsCalled]' passed (0.001 seconds).
Test Case '-[OCMockObjectTests testRaisesExceptionWhenSequenceIsWrongAndOrderMatters]' started.
2021-07-08 14:35:17.502242-0700 xctest[68194:138191625] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSMutableData ocmock_replaced_allocWithZone:]: unrecognized selector sent to class 0x7fff86364520'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff203fae07 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff2019ebe7 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff2040994a __CFExceptionProem + 0
	3   CoreFoundation                      0x00007fff203ff2cb ___forwarding___ + 1412
	4   CoreFoundation                      0x00007fff204013f8 _CF_forwarding_prep_0 + 120
	5   CoreFoundation                      0x00007fff2040168c __invoking___ + 140
	6   CoreFoundation                      0x00007fff203fea96 -[NSInvocation invoke] + 305
	7   OCMockLibTests                      0x0000000111739ab3 -[OCClassMockObject forwardInvocationForClassObject:] + 275
	8   CoreFoundation                      0x00007fff203ff066 ___forwarding___ + 799
	9   CoreFoundation                      0x00007fff204013f8 _CF_forwarding_prep_0 + 120
	10  libobjc.A.dylib                     0x00007fff2019dd71 objc_opt_new + 76
	11  Foundation                          0x00007fff207acc11 -[NSKeyedArchiver init] + 21
	12  Foundation                          0x00007fff207ac9b4 -[NSKeyedArchiver initRequiringSecureCoding:] + 30
	13  Foundation                          0x00007fff207aca1b +[NSKeyedArchiver archivedDataWithRootObject:requiringSecureCoding:error:] + 70
	14  DTXConnectionServices               0x000000010f7a5bae DTXPrimitiveDictionaryReferencingSerialized + 63742
	15  DTXConnectionServices               0x000000010f7a6456 DTXPrimitiveDictionaryReferencingSerialized + 65958
	16  DTXConnectionServices               0x000000010f7a5fa8 DTXPrimitiveDictionaryReferencingSerialized + 64760
	17  DTXConnectionServices               0x000000010f7916bb DTXConnectionServices + 14011
	18  CoreFoundation                      0x00007fff203ff066 ___forwarding___ + 799
	19  CoreFoundation                      0x00007fff204013f8 _CF_forwarding_prep_0 + 120
	20  XCTest                              0x000000010f4b46f9 -[XCTRunnerIDESession logDebugMessage:] + 79
	21  XCTest                              0x000000010f487a71 -[XCTDefaultDebugLogHandler _queue_flushDebugMessageBufferWithBlock:] + 274
	22  XCTest                              0x000000010f487c7f __45-[XCTDefaultDebugLogHandler logDebugMessage:]_block_invoke + 185
	23  libdispatch.dylib                   0x00007fff20110b50 _dispatch_call_block_and_release + 12
	24  libdispatch.dylib                   0x00007fff20111d57 _dispatch_client_callout + 8
	25  libdispatch.dylib                   0x00007fff20118377 _dispatch_lane_serial_drain + 710
	26  libdispatch.dylib                   0x00007fff20118f1d _dispatch_lane_invoke + 400
	27  libdispatch.dylib                   0x00007fff20123a12 _dispatch_workloop_worker_thread + 772
	28  libsystem_pthread.dylib             0x00007fff6b0234c0 _pthread_wqthread + 314
	29  libsystem_pthread.dylib             0x00007fff6b022493 start_wqthread + 15
)
Test Case '-[OCMockObjectTests testRaisesExceptionWhenSequenceIsWrongAndOrderMatters]' passed (0.001 seconds).
libc++abi: Test Case '-[OCMockObjectTests testRaisesExceptionWhenStubbedMockArgIsNotUsed]' started.
terminating with uncaught exception of type NSException

It appears that Apple now uses a separate thread to deal with debug logs Thread 6 Queue : com.apple.dt.xctest.default-debug-log-handler (serial) which assumes that the NSNumber and NSMutableData classes aren't going to be messed with.

This exposes a bunch of potential race conditions we have:

- (void)forwardInvocationForClassObject:(NSInvocation *)anInvocation
{
    // in here "self" is a reference to the real class, not the mock
    OCClassMockObject *mock = OCMGetAssociatedMockForClass((Class)self, YES);
    >>> 1
    if(mock == nil)
    {
        [NSException raise:NSInternalInconsistencyException format:@"No mock for class %@", NSStringFromClass((Class)self)];
    }
    if([mock handleInvocation:anInvocation] == NO)
    {
        [anInvocation setSelector:OCMAliasForOriginalSelector([anInvocation selector])];
   >>> 2
        [anInvocation invoke];
    }
}
- (void)stopMockingClassMethods
{
    OCMSetAssociatedMockForClass(nil, mockedClass);
    object_setClass(mockedClass, originalMetaClass);
    originalMetaClass = nil;
    /* created meta class will be disposed later because partial mocks create another subclass depending on it */
}

If stopMockingClassMethods executes before point >>>1, mock will be nil and the exception will fire. If stopMockingClassMethods executes between >>>1 and >>>2 and the mock is dealloc'd, the invocation to mock will fail. if stopMockingClassMethods executes between >>>1 and >>>2, the class will have been changed and the selector will not be recognized (this is likely what happened in the crash log scenario above).

Also, if a class method gets called while the mock is being set up in prepareClassForClassMethodMocking, we also run into problems.

created time in 3 months

push eventdmaclach/ocmock

Dave MacLachlan

commit sha 6e81bf4a9aa555172eaa54b3663df4a33bb66ebe

Enforce that you cannot partial mock a proxy. Test that you can class mock a proxy.

view details

Dave MacLachlan

commit sha d981dd6bf1926e9350b7a62e288d490fc7d31f50

`byref` sometimes just returns 'R' as encoding. Ran into some interesting cases where `byref` was not returning the expected values and `OCMTypeWithoutQualifiers` was running into issues and was actually returning the next type in a string.

view details

Kirk Beitz

commit sha af1dd8fa4e2c95d29744652e8be822f038d9dfc0

Xcode recommends "Don't Code SIgn" for CODE_SIGN_IDENTITY this patch is the result of accepting the upgrade suggestion for the warning when upgrading to Xcode 12.3 . it seems correct.

view details

Kirk Beitz

commit sha 013976c1d76e3320fab87f6b7517aef115899eae

fix for #456: clang-analyzer false positives

view details

Dave MacLachlan

commit sha 39a8d79acf8ef0d9cac3ef3d016a0e9dac16d03e

Allow mocks to be created inside OCM Macro calls This allows a mock to be created inside an OCM Macro call while still preserving the case where we don't support mocking init.

view details

Dave MacLachlan

commit sha db68654c1e5a9ce966ded5765c98227c2ff46b74

Fix up usage of NSGetSizeAndAlignment NSGetSizeAndAlignment is horribly documented IMHO. The alignp argument is the alignment of the type, not the aligned size of the type. On a 64 bit system this just "happens" to work for many types that aren't structs.

view details

matrush

commit sha 0bbb5c350ff90ea3ac2421931fdae21e1271d29b

Remove unnecessary shadow varaible mock from testBlockConstraintRetainedByStub

view details

matrush

commit sha 43d267e9f6ca5f91a99dbf5d980fb3fe17661c63

Check expected file path as a suffix in OCMockObjectMacroTests

view details

Erik Doernenburg

commit sha ce3bbece163defe91ca6d13c9f1c7d4cc812a3b9

Merge branch 'matrush-fixShadowVariable'

view details

Erik Doernenburg

commit sha 2d0981736341368fa4a6927a21558198d5f68e24

Updated to slightly newer version of Hamcrest.

view details

Erik Doernenburg

commit sha 69fa958aad5e255b935b53c4dcc50aba4feffbbc

Merge branch 'fixObjectMacroTests' of https://github.com/matrush/ocmock into matrush-fixObjectMacroTests

view details

Erik Doernenburg

commit sha 66fe00e6d51a8962fcf8170a90730204c1caad6f

Merge branch 'matrush-fixObjectMacroTests'

view details

Erik Doernenburg

commit sha 121b553b8acdb7b8395657e90571ec97519f2c1d

Merge branch 'Xcode-12.3-accept-suggestions' of https://github.com/twitterkb/ocmock into twitterkb-Xcode-12.3-accept-suggestions

view details

Erik Doernenburg

commit sha baa4aab3b11dd444bb2e0029114c796335866b7d

Merge branch 'twitterkb-Xcode-12.3-accept-suggestions'

view details

Erik Doernenburg

commit sha 6d58ef855ae7bb8db9103e2828b7ced44b403953

Cleaned up whitespace.

view details

Erik Doernenburg

commit sha dbde4bddee3dde7ff8b1728d71268bec3d656230

Removed signing check because we're not signing any more.

view details

Erik Doernenburg

commit sha bb871aba35abe79bb979010d21b1bc5a99bbb596

Ran check and ignored recommended changes to deployment targets.

view details

Erik Doernenburg

commit sha 5d7a5af1f978d88fe15864e180bc38f2da61eed7

Merge branch 'argsize' of https://github.com/dmaclach/ocmock into dmaclach-argsize

view details

Erik Doernenburg

commit sha fac7b7d15c7038c0f768e6fed0e66a32e9fac615

Added unit test for an otherwise uncovered branch. See #487 for details.

view details

Erik Doernenburg

commit sha 336314ca1227db2548398ef42c62a7edbada7a87

Merge branch 'dmaclach-argsize'

view details

push time in 3 months

Pull request review commentprotocolbuffers/protobuf

Allow suppression of objc prefix checks.

 bool ValidateObjCClassPrefix(     return true;   } +  // When the prefix is non empty, check it against the expected entries.+  if (!prefix.empty() && have_expected_prefix_file) {+    // For a non empty prefix, look for any other package that uses the prefix.+    std::string other_package_for_prefix;+    for (std::map<std::string, std::string>::const_iterator i =

ouch.. got you. Totally missed that. Thanks.

thomasvl

comment created time in 3 months

Pull request review commentprotocolbuffers/protobuf

Allow suppression of objc prefix checks.

 bool ValidateObjCClassPrefix(     return true;   } +  // When the prefix is non empty, check it against the expected entries.+  if (!prefix.empty() && have_expected_prefix_file) {+    // For a non empty prefix, look for any other package that uses the prefix.+    std::string other_package_for_prefix;+    for (std::map<std::string, std::string>::const_iterator i =+             expected_package_prefixes.begin();+         i != expected_package_prefixes.end(); ++i) {+      if (i->second == prefix) {+        other_package_for_prefix = i->first;+        break;+      }+    }++    // Check: Warning - If the file does not have a package, check whether the+    // prefix was declared is being used by another package or not. This is+    // a special case for empty packages.+    if (package.empty()) {+      // The file does not have a package and ...+      if (other_package_for_prefix.empty()) {+        // ... no other package has declared that prefix.+        std::cerr+             << "protoc:0: warning: File '" << file->name() << "' has no "+             << "package. Consider adding a new package to the proto and adding '"+             << "new.package = " << prefix << "' to the expected prefixes file ("+             << expected_prefixes_path << ")." << std::endl;+        std::cerr.flush();

ack

thomasvl

comment created time in 3 months

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentprotocolbuffers/protobuf

Allow suppression of objc prefix checks.

 bool ValidateObjCClassPrefix(     return true;   } +  // When the prefix is non empty, check it against the expected entries.+  if (!prefix.empty() && have_expected_prefix_file) {+    // For a non empty prefix, look for any other package that uses the prefix.+    std::string other_package_for_prefix;+    for (std::map<std::string, std::string>::const_iterator i =+             expected_package_prefixes.begin();+         i != expected_package_prefixes.end(); ++i) {+      if (i->second == prefix) {+        other_package_for_prefix = i->first;+        break;+      }+    }++    // Check: Warning - If the file does not have a package, check whether the+    // prefix was declared is being used by another package or not. This is+    // a special case for empty packages.+    if (package.empty()) {+      // The file does not have a package and ...+      if (other_package_for_prefix.empty()) {+        // ... no other package has declared that prefix.+        std::cerr+             << "protoc:0: warning: File '" << file->name() << "' has no "+             << "package. Consider adding a new package to the proto and adding '"+             << "new.package = " << prefix << "' to the expected prefixes file ("+             << expected_prefixes_path << ")." << std::endl;+        std::cerr.flush();

pull this outside the if/else since both branches do it?

thomasvl

comment created time in 3 months