-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Remove duplicate build preset declarations #248
Conversation
Why did you inline the settings into the presets? For example, you added settings to |
@benlangmuir I guess I don't fully understand the question. So instead I'll explain what I did and then hopefully that makes sense. If you look at To resolve this I moved the definition made on line 56 down to line 179. It was 99% a cut-and-paste. The only thing that was not cut-and-paste was merging the I then repeated that same process for |
@benlangmuir I guess now I see what your saying. The definition of So why not just delete the definition of That now seems like a better strategy with less churn. I'll update accordingly. |
EDIT: didn't see your second comment, which is exactly what I was trying to say here 😺 |
Yeah it does. We are on the same page now. I'll update that. |
As noted by suggestions by @benlangmuir the presets are actually duplicated. Therefore, they can safely be removed and not "merged". Python 3's [configparser](https://docs.python.org/3/library/configparser.html) does not parse in the same way that Python 2's did. Specifically, Python 3's does not allow duplicate sections (or in Swift parlance presets). Python 3 does provide a "strict" property that can be sent to the constructor to return to the behavior of Python 2 (e.g., `config = ConfigParser.SafeConfigParser(substitutions, allow_no_value=True, strict=False)`). However, this provides it's own set of complications in that the Python 2 version of the constructor does not. Therefore, instead of having a conditional in the runtime to detect which version of Python and build the correct initializer this patch normalizes the presets configuration file such that there are no more duplicates. This should work in both Python 2 and 3. Also worth noting: this patch is insufficient by itself to make the build scripts work with Python 3. This patch is written with the "Incremental Development" theory in mind and in preparation for other patches currently in progress.
I've rebased this on the latest master (ab29adf) and have incorporated @benlangmuir's suggestion. |
@RLovelett Did you test any of the affected presets? |
I've run a build with EDIT: |
This LGTM. |
Remove duplicate build preset declarations
clarify config of pthread_workqueue vs. internal_workqueue
clarify config of pthread_workqueue vs. internal_workqueue Signed-off-by: Daniel A. Steffen <[email protected]>
…ed-tests [WASM] Disable unsupported test suite on WASM
Update R.swift hash to build against 4.2
Python 3's configparser does not parse in the same way that Python 2's did. Specifically, Python 3's does not allow duplicate sections (or in Swift parlance presets).
Python 3 does provide a "strict" property that can be sent to the constructor to return to the behavior of Python 2 (e.g.,
config = ConfigParser.SafeConfigParser(substitutions, allow_no_value=True, strict=False)
). However, this provides it's own set of complications in that the Python 2 version of the constructor does not.Therefore, instead of having a conditional in the runtime to detect which version of Python and build the correct initializer this patch normalizes the presets configuration file such that there are no more duplicates. This should work in both Python 2 and 3.
Also worth noting: this patch is insufficient by itself to make the build scripts work with Python 3. This patch is written with the "Incremental Development" theory in mind and in preparation for other patches currently in progress, (i.e., #90).