-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add emscan-deps tool #21987
Open
sbc100
wants to merge
2
commits into
emscripten-core:main
Choose a base branch
from
sbc100:scan_deps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+164
−1
Open
Add emscan-deps tool #21987
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
# Copyright 2020 The Emscripten Authors. All rights reserved. | ||
# Emscripten is available under two separate licenses, the MIT license and the | ||
# University of Illinois/NCSA Open Source License. Both these licenses can be | ||
# found in the LICENSE file. | ||
# | ||
# Entry point for running python scripts on UNIX systems. | ||
# | ||
# Automatically generated by `create_entry_points.py`; DO NOT EDIT. | ||
# | ||
# To make modifications to this file, edit `tools/run_python.sh` and then run | ||
# `tools/maint/create_entry_points.py` | ||
|
||
# $PYTHON -E will not ignore _PYTHON_SYSCONFIGDATA_NAME an internal | ||
# of cpython used in cross compilation via setup.py. | ||
unset _PYTHON_SYSCONFIGDATA_NAME | ||
|
||
if [ -z "$PYTHON" ]; then | ||
PYTHON=$EMSDK_PYTHON | ||
fi | ||
|
||
if [ -z "$PYTHON" ]; then | ||
PYTHON=$(command -v python3 2> /dev/null) | ||
fi | ||
|
||
if [ -z "$PYTHON" ]; then | ||
PYTHON=$(command -v python 2> /dev/null) | ||
fi | ||
|
||
if [ -z "$PYTHON" ]; then | ||
echo 'unable to find python in $PATH' | ||
exit 1 | ||
fi | ||
|
||
exec "$PYTHON" -E "$0.py" "$@" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
:: Entry point for running python scripts on windows systems. | ||
:: | ||
:: Automatically generated by `create_entry_points.py`; DO NOT EDIT. | ||
:: | ||
:: To make modifications to this file, edit `tools/run_python.bat` and then run | ||
:: `tools/maint/create_entry_points.py` | ||
|
||
:: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, | ||
:: or there will be a parsing error. | ||
|
||
:: All env. vars specified in this file are to be local only to this script. | ||
@setlocal | ||
:: -E will not ignore _PYTHON_SYSCONFIGDATA_NAME an internal | ||
:: of cpython used in cross compilation via setup.py. | ||
@set _PYTHON_SYSCONFIGDATA_NAME= | ||
@set EM_PY=%EMSDK_PYTHON% | ||
@if "%EM_PY%"=="" ( | ||
set EM_PY=python | ||
) | ||
|
||
:: Work around Windows bug https://github.com/microsoft/terminal/issues/15212 : If this | ||
:: script is invoked via enclosing the invocation in quotes via PATH lookup, then %~f0 and | ||
:: %~dp0 expansions will not work. | ||
:: So first try if %~dp0 might work, and if not, manually look up this script from PATH. | ||
@if exist "%~f0" ( | ||
set MYDIR=%~dp0 | ||
goto FOUND_MYDIR | ||
) | ||
@for %%I in (%~n0.bat) do ( | ||
@if exist %%~$PATH:I ( | ||
set MYDIR=%%~dp$PATH:I | ||
) else ( | ||
echo Fatal Error! Due to a Windows bug, we are unable to locate the path to %~n0.bat. | ||
echo To help this issue, try removing unnecessary quotes in the invocation of emcc, | ||
echo or add Emscripten directory to PATH. | ||
echo See github.com/microsoft/terminal/issues/15212 and | ||
echo github.com/emscripten-core/emscripten/issues/19207 for more details. | ||
) | ||
) | ||
:FOUND_MYDIR | ||
|
||
:: Python Windows bug https://bugs.python.org/issue34780: If this script was invoked via a | ||
:: shared stdin handle from the parent process, and that parent process stdin handle is in | ||
:: a certain state, running python.exe might hang here. To work around this, if | ||
:: EM_WORKAROUND_PYTHON_BUG_34780 is defined, invoke python with '< NUL' stdin to avoid | ||
:: sharing the parent's stdin handle to it, avoiding the hang. | ||
|
||
:: On Windows 7, the compiler batch scripts are observed to exit with a non-zero errorlevel, | ||
:: even when the python executable above did succeed and quit with errorlevel 0 above. | ||
:: On Windows 8 and newer, this issue has not been observed. It is possible that this | ||
:: issue is related to the above python bug, but this has not been conclusively confirmed, | ||
:: so using a separate env. var EM_WORKAROUND_WIN7_BAD_ERRORLEVEL_BUG to enable the known | ||
:: workaround this issue, which is to explicitly quit the calling process with the previous | ||
:: errorlevel from the above command. | ||
|
||
:: Also must use goto to jump to the command dispatch, since we cannot invoke emcc from | ||
:: inside a if() block, because if a cmdline param would contain a char '(' or ')', that | ||
:: would throw off the parsing of the cmdline arg. | ||
@if "%EM_WORKAROUND_PYTHON_BUG_34780%"=="" ( | ||
@if "%EM_WORKAROUND_WIN7_BAD_ERRORLEVEL_BUG%"=="" ( | ||
goto NORMAL | ||
) else ( | ||
goto NORMAL_EXIT | ||
) | ||
) else ( | ||
@if "%EM_WORKAROUND_WIN7_BAD_ERRORLEVEL_BUG%"=="" ( | ||
goto MUTE_STDIN | ||
) else ( | ||
goto MUTE_STDIN_EXIT | ||
) | ||
) | ||
|
||
:NORMAL_EXIT | ||
@"%EM_PY%" -E "%MYDIR%%~n0.py" %* | ||
@exit %ERRORLEVEL% | ||
|
||
:MUTE_STDIN | ||
@"%EM_PY%" -E "%MYDIR%%~n0.py" %* < NUL | ||
@exit /b %ERRORLEVEL% | ||
|
||
:MUTE_STDIN_EXIT | ||
@"%EM_PY%" -E "%MYDIR%%~n0.py" %* < NUL | ||
@exit %ERRORLEVEL% | ||
|
||
:NORMAL | ||
@"%EM_PY%" -E "%MYDIR%%~n0.py" %* |
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,17 @@ | ||||||
#!/usr/bin/env python3 | ||||||
# Copyright 2019 The Emscripten Authors. All rights reserved. | ||||||
# Emscripten is available under two separate licenses, the MIT license and the | ||||||
# University of Illinois/NCSA Open Source License. Both these licenses can be | ||||||
# found in the LICENSE file. | ||||||
|
||||||
"""emscan-deps - clang-scan-deps helper script | ||||||
|
||||||
This script acts as a frontend replacement for clang-scan-deps | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
""" | ||||||
|
||||||
import sys | ||||||
from tools import shared, cache | ||||||
|
||||||
args = sys.argv[1:] | ||||||
args.append('--sysroot=' + cache.get_sysroot(absolute=True)) | ||||||
shared.exec_process([shared.CLANG_SCAN_DEPS] + args) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.5...3.28) | ||
|
||
project(cxx20test) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
add_executable(cxx20test main.cpp) |
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||
// Copyright 2011 The Emscripten Authors. All rights reserved. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
// Emscripten is available under two separate licenses, the MIT license and the | ||||||
// University of Illinois/NCSA Open Source License. Both these licenses can be | ||||||
// found in the LICENSE file. | ||||||
|
||||||
#include <stdio.h> | ||||||
|
||||||
class Test {}; // This will fail in C mode | ||||||
|
||||||
int main() { | ||||||
printf("hello, world!\n"); | ||||||
return 0; | ||||||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello, world! |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.