FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Properly enable source maps in all modes by varungandhi-src · Pull Request #179 · sourcegraph/scip-python · GitHub

fix: Properly enable source maps in all modes - #179

Merged
varungandhi-src merged 1 commit into
scipfrom
vg/source-maps
Aug 4, 2025
Merged

fix: Properly enable source maps in all modes#179
varungandhi-src merged 1 commit into
scipfrom
vg/source-maps

Conversation

Copy link
Copy Markdown
Contributor

We need to pass --enable-source-maps when launching node,
because Node will not use source maps (even if present) by default.

Additionally, let's avoid the divergence in settings across development
and production.

varungandhi-src merged commit ed2ad3b into scip Aug 4, 2025
2 checks passed
varungandhi-src deleted the vg/source-maps branch August 4, 2025 12:35

efritz commented Aug 7, 2025

Copy link
Copy Markdown

@varungandhi-src This broke our integration:

$ yarn global add @sourcegraph/scip-python
$ NODE_OPTIONS="--max_old_space_size=8192" scip-python index

/usr/bin/env: ‘node --enable-source-maps’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

Shouldn't this be /usr/bin/env -S <...>? What's the intended way to invoke this?

Copy link
Copy Markdown
Contributor Author

Hmm, I thought I tested that locally. Double-checking; will cut a new release with a fix.

varungandhi-src added a commit that referenced this pull request Aug 8, 2025
`env` on different systems behaves differently. On macOS,
`env ABC XYZ` will invoke ABC with argument XYZ.
On some Linux variants, you need `env -S ABC XYZ` for that.
On Alpine, the `-S` flag is not supported, and there is seemingly
no way of passing arguments.

So this patch undoes the accidental breakage in #179
and uses the `getSourceMapsSupport` API.

Technically, both `process.setSourceMapsEnabled` and
`module.setSourceMapsSupport` are experimental functions,
so to be safe, we do a dynamic existence check before calling
them for portability across Node versions.

Copy link
Copy Markdown
Contributor Author

@efritz this should be fixed in the 0.6.2 release. I checked using Docker. Let me know if you're still hitting issues.

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 join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL