This repository was archived by the owner on Sep 17, 2024. It is now read-only.
fix: Issue fixed for building binary with recompileFromSource#173
Merged
JonasBa merged 1 commit intogetsentry:mainfrom Jul 5, 2023
whaagmans:main
Merged
fix: Issue fixed for building binary with recompileFromSource#173JonasBa merged 1 commit intogetsentry:mainfrom whaagmans:main
JonasBa merged 1 commit intogetsentry:mainfrom
whaagmans:main
Conversation
This was referenced Jul 4, 2023
Member
|
Hmm, I wonder if this is actually the root cause - I changed this recently from separate execSync commands and people still had issues. That said, the PR looks good and we'll ship a 1.0.8 asap (today), but I sense there is a problem someplace else. |
Author
|
@JonasBa Let me know if new issues with this problem arise after this solution. Love to help it be fixed permanently. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a fix for #171 and #141.
The command in recompileFromSource passed to cp.spawnSync uses the && operator to chain multiple npm scripts together. However, && is a shell operator for command chaining and conditional execution.
cp.spawnSync expects a single command as the first argument, making it incompatible with the && operator usage. && is interpreted by the shell, not as part of a single command.
To resolve this, there are two options:
Separate npm scripts into individual commands: Execute each npm script separately using cp.spawnSync. This ensures each script is treated as an independent command, eliminating the need for shell operators like &&.
Execute a shell command: Invoke a shell (e.g., sh) and pass the entire chain of npm scripts with && as the argument to cp.spawnSync. However, this introduces a dependency on the shell environment and may lead to platform or shell inconsistencies.
For simplicity and cleanliness, I recommend option 1. It separates npm scripts into individual commands, aligning with cp.spawnSync requirements and improving code manageability.
Please review and let me know if you have any questions or if further adjustments are needed.