-
Notifications
You must be signed in to change notification settings - Fork 52
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
enable AtomicReference everywhere #65
Conversation
update: i was able to build and run the tests and verified they all pass :) |
My gut feeling is that we should resolve this by unconditionally defining ENABLE_DOUBLEWIDE_ATOMICS rather than removing the checks, to make supporting other platforms that don't have support easier in the future. Otherwise someone is going to port Swift to some constrained environment and they'll have to reintroduce all the checks. |
i don't have a strong opinion on this, i would just prefer some version of this to be merged and tagged as soon as possible to unblock myself. @lorentey which approach do you prefer? |
i might just be brainfarting here, but how do you unconditionally define |
according to https://forums.swift.org/t/how-to-use-compiler-directives-to-define-a-build-flag/63191/4 there is no way to accomplish this in swift today. @stephentyrone do you know of an alternative approach we can take here? |
Unconditionally enabling double-wide atomics is the right move. It'll need to be tied to a release that bumps the minimum toolchain version to a Swift version whose runtime also requires 16-byte atomics, but other than that this should be smooth. |
(I wouldn't like to leave the conditionals in place, unless we currently still support a platform that doesn't have wide atomics.) |
great! this is what the PR implements right now. anything you would like changed, or is this good to merge? |
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.
Looks good. We'll also need to bump the required toolchain version in the package manifest.
Utilities/run-full-tests.sh
Outdated
if [ "$(uname)" = "Linux" ]; then | ||
try "spm.release.dword.build" $swift build -c release $spm_flags -Xcc -mcx16 -Xswiftc -DENABLE_DOUBLEWIDE_ATOMICS --build-path "$build_dir/spm.release.dword" | ||
try "spm.release.dword.build" $swift build -c release $spm_flags --build-path "$build_dir/spm.release.dword" | ||
fi |
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.
Nit: we should just remove this entire if
altogether -- this configuration is now the default, so it is rolled into the default Linux case.
Utilities/run-full-tests.sh
Outdated
if [ "$(uname)" != "Darwin" ]; then | ||
try "spm.release.dword.test" $swift test -c release $spm_flags -Xcc -mcx16 -Xswiftc -DENABLE_DOUBLEWIDE_ATOMICS --build-path "$build_dir/spm.release.dword" | ||
try "spm.release.dword.test" $swift test -c release $spm_flags --build-path "$build_dir/spm.release.dword" | ||
fi |
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.
Same here -- let's remove this if
.
@swift-ci test |
@swift-ci test |
YESS |
fixes #64 , and updates documentation to remove references to custom build flags.
i was not able to build the tests in their entirety, the 40k gybbedbut i tried to make individual subsets ofBasics.swift
overwhelms my local toolchain.Basics.swift
compile a little faster (~15%) by adding type annotations.side note:
compilation time seems to grow linearly with the number of types gyb generates tests for.
the smaller time for the first n is probably because
Int
benefits from being the default inferred integer literal type.