-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Quote --sourcemap-output argument during ios build #31587
Conversation
Hi @andersonvom! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Base commit: f4fdf4b |
@charlesbdudley has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
HI @andersonvom do you mind rebasing on top of latest so that we can get these circle ci tests passing? |
Scheme names may contain whitespace characters is used as path of the path for various files during build time. This means any path that includes the scheme name in it needs to be surrounded by quotes. You can see the generated command below for a project with a scheme called `Some Scheme`: node ./node_modules/react-native/cli.js bundle \ --entry-file index.js \ --platform ios \ --dev false \ --reset-cache \ --bundle-output './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle' \ --assets-dest './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app' \ --sourcemap-output ./ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle.map `--bundle-output` and `--assets-dest` are properly quoted, but `--sourcemap-output` is not. This changes `$EXTRA_ARGS` to an array of strings so that we can propertly quote `$PACKAGER_SOURCEMAP_FILE` when passing it to the `--sourcemap-output` argument. When running the bundle command, this array is unwrapped and all its elements passed as individual arguments. It also applies the same unwrapping to `$EXTRA_PACKAGER_ARGS` so that users can also pass an array of options when arguments containing spaces are needed. It's important to note that these changes ARE backwards compatible: if `$EXTRA_PACKAGER_ARGS` is defined as a simple string, instead of an array of strings, the command won't break, as it will still expand correctly.
Base commit: f4fdf4b |
@charlesbdudley absolutely. we're back to all green! :D |
@charlesbdudley has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
8 similar comments
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
4 similar comments
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
This pull request was successfully merged by @andersonvom in f3fe7a0. When will my fix make it into a release? | Upcoming Releases |
@andersonvom This seems to be causing issues since bash doesn't support passing arrays in the environment. I'm using originally:
Which expands to
That's invalid since the extra packager arg is interpreted as a single parameter and the rn cli errors because of invalid parameter. I tried using an array, but this doesn't seem supported by bash and no extra arguments is passed.
I suggest removing the change that affects EXTRA_PACKAGER_ARGS |
Just to confirm what @janicduplessis said, this is also breaking my use of |
This reverts commit f3fe7a0.
This pull request has been reverted by cdce733. |
Summary
Scheme names may contain whitespace characters is used as path of the
path for various files during build time. This means any path that
includes the scheme name in it needs to be surrounded by quotes.
You can see the generated command below for a project with a scheme
called
Some Scheme
:--bundle-output
and--assets-dest
are properly quoted, but--sourcemap-output
is not.This changes
$EXTRA_ARGS
to an array of strings so that we canpropertly quote
$PACKAGER_SOURCEMAP_FILE
when passing it to the--sourcemap-output
argument. When running the bundle command, thisarray is unwrapped and all its elements passed as individual arguments.
It also applies the same unwrapping to
$EXTRA_PACKAGER_ARGS
so thatusers can also pass an array of options when arguments containing spaces
are needed.
It's important to note that these changes ARE backwards compatible: if
$EXTRA_PACKAGER_ARGS
is defined as a simple string, instead of anarray of strings, the command won't break, as it will still expand
correctly.
Changelog
[iOS] [Fixed] - Source map path for schemes containing whitespaces
Test Plan
With the new change, the generated command becomes: