-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS X support #51
base: main
Are you sure you want to change the base?
OS X support #51
Conversation
this is already declared by OS X system headers and causes compilation errors
Yes. We recently removed all usage of it. So it's fine. We'll have to do a major version bump though. Flagging this for later review even though @csfrancis is the authoritative person here. Also you have a CI failure that seems legit. |
The other thing I discussed with @sirupsen is the use of Is there any reason why Semian uses |
@byroot Pushed up f7372fb which fixes that failure. Turns out that test was implicitly relying on timeouts (as it tried to acquire the resource immediately after sending |
The argument I have for not requiring a ticket count I tried to explain to Charlie last night is that the equation for a ticket count's effectiveness effectively looks like this: |
I've put it on my list to test this PR in production. I'll attempt to do that next week. Nothing really jumps out, thanks @charliesome :) |
@@ -23,7 +23,7 @@ | |||
have_func 'rb_thread_blocking_region' | |||
have_func 'rb_thread_call_without_gvl' | |||
|
|||
$CFLAGS = "-D_GNU_SOURCE -Werror -Wall " | |||
$CFLAGS = "-D_GNU_SOURCE -Wall " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you have to get rid of -Werror
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHA1
is deprecated in the OS X system OpenSSL headers and causes a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets switch to something else then rather than disabling the warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fw42 Charlie already suggested following up with ftok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to ftok
will likely require changes in the external Semian API. This might not be a big deal since this branch will already require a major version bump, but using ftok
properly will not be as simple as just replacing the SHA1
call.
We could pass -Wno-deprecated-declarations
to disable this specific warning, but I'm not sure how that will affect compilers that don't support that option.
I tested this branch with shopify in dev and test. Seems all green. We can try it out on production servers once the last concerns are settled. |
Since this pull request will already require a major version bump, I'd like to discuss another breaking change that we could make while we're at it. IMO we should use Using I think the ideal solution here is to add a parameter to |
SHA1 is deprecated on OS X and causes a build warning
This (unless I'm missing something) is I'm afraid impossible for us since we're running our processes in multiple docker containers. We do share the IPC namespace between containers, but not the filesytem. |
Yeah, @byroot has a valid point for our deployment. I really don't want to do a shared mount between all the containers just for this :/ |
|
Perhaps we could do something like store a mapping of all active |
I think you are going to far guys. We're talking about hashing human identifiers. Even MD5 would do. The risk of accidental collisions is extremely low. |
Ugh, I missed that. That's a shame. I guess SHA1 is good enough in that case then |
I'd question again why we even need this. Why can't we just disable this in test and dev? @charliesome |
@sirupsen because then you can't run your integration tests on OSX. :sad_panda: |
Yeah, but those don't Unless you mean the Semian test suite. |
Oh. Well, if we end up having an in-memory semaphore, then yes. |
any updates on this by chance? this came up to test certain semian details in development mode in osx |
@sirupsen @charliesome This looks like an interesting PR but is about a year and a half old... any reason it's still open? looks like it's targeted for only Linux in prod, so it could be closed with 'make sure your dev environment is linux; we don't expect support for BSD/OSX'? |
@bf4 we're still interested in this work upstream, someone just needs to own it :) |
This pull request adds OS X support to Semian.
The biggest potentially controversial change here is that I've removed the ticket acquisition timeout entirely. This is because OS X doesn't have
semtimedop
. I asked @sirupsen about this and he backgrounded me on the original motivation for this timeout and why it isn't strictly necessary anymore.Because we no longer block on semaphore operations, I was also able to remove the GVL release code.
cc @sirupsen @csfrancis @byroot