-
Notifications
You must be signed in to change notification settings - Fork 7
reproduce bug qt6...metatypes.json: illegal value (windows nmake) #120
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
Closed
Closed
Changes from all commits
Commits
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: json_bug_repro | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-2019 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: nmake_build | ||
shell: cmd | ||
run: | | ||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | ||
"C:\Program Files\Git\bin\bash.exe" ./json_bug_repro/ci/win_ci.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
project(Reproducejsonbug VERSION 0.1 LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
find_package(Qt6 REQUIRED COMPONENTS Quick Bluetooth) | ||
|
||
qt_standard_project_setup(REQUIRES 6.5) | ||
|
||
|
||
qt_add_executable(appReproducejsonbug | ||
main.cpp | ||
) | ||
|
||
qt_add_qml_module(appReproducejsonbug | ||
URI Reproducejsonbug | ||
VERSION 1.0 | ||
QML_FILES qml/Main.qml | ||
) | ||
|
||
set_target_properties(appReproducejsonbug PROPERTIES | ||
WIN32_EXECUTABLE TRUE | ||
) | ||
|
||
target_link_libraries(appReproducejsonbug | ||
PRIVATE Qt6::Quick | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
IFS=$'\n\t' | ||
|
||
THISDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
source ${THISDIR}/utils.bash # will compute UTILS_WE_ARE_RUNNING_IN_CI | ||
|
||
if [[ -n ${UTILS_WE_ARE_RUNNING_IN_CI-} ]]; | ||
# The '-' hyphen above tests without angering the 'set -u' about unbound variables | ||
then | ||
echo "C.I. environment was detected." | ||
|
||
# Try various ways to print OS version info. | ||
# This lets us keep a record of this in our CI logs, | ||
# in case the CI docker images change. | ||
uname -a || true | ||
lsb_release -a || true | ||
gcc --version || true # oddly, gcc often prints great OS information | ||
cat /etc/issue || true | ||
|
||
# What environment variables did the C.I. system set? Print them: | ||
env | ||
|
||
if [[ "$OSTYPE" != "cygwin" && "$OSTYPE" != "msys" ]]; then | ||
${THISDIR}/../verify_authors.sh | ||
|
||
${THISDIR}/linux_apt_get_qt_deps.sh | ||
${THISDIR}/get_qt_libs.sh | ||
elif [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then | ||
${THISDIR}/provision_win.sh | ||
fi | ||
|
||
else | ||
echo "Assuming we are NOT in cloud C.I. environment." | ||
fi | ||
|
||
|
||
THIS_FILENAME=$(basename "$0") | ||
echo 'We assume this was run with '\''set -e'\'' (look at upper lines of this script).' | ||
echo 'Assuming so, then getting here means:' | ||
echo "${THIS_FILENAME} SUCCESS" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
source "${DIR}/rootdirhelper.bash" | ||
|
||
DL_FOLDER=$CUR_GUICODE_ROOT/dl_third_party | ||
if [[ -n ${MYAPP_TEMPLATE_DL_FOLDER_OVERRIDE-} ]]; then | ||
DL_FOLDER=${MYAPP_TEMPLATE_DL_FOLDER_OVERRIDE} | ||
fi | ||
|
||
pip3 install -r ${DIR}/requirements.txt # https://github.com/miurahr/aqtinstall | ||
|
||
python3 -m aqt install-qt --outputdir $DL_FOLDER/Qt_desktop \ | ||
windows desktop 6.5.3 win64_msvc2019_64 \ | ||
--modules \ | ||
qtconnectivity \ | ||
qtimageformats \ | ||
qt5compat |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aqtinstall==3.1.12 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
if [ "${BASH_SOURCE[0]}" -ef "$0" ] | ||
then | ||
echo "Hey, you should source this script, not execute it!" | ||
exit 1 | ||
fi | ||
|
||
NESTED_GUI_ROOT="" # Populate this if you move the qt-qml-project beneath git root | ||
CUR_GIT_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
export CUR_GUICODE_ROOT="${CUR_GIT_ROOT}/${NESTED_GUI_ROOT}/" | ||
|
||
DL_FOLDER=$CUR_GUICODE_ROOT/dl_third_party | ||
if [[ -n ${MYAPP_TEMPLATE_DL_FOLDER_OVERRIDE-} ]]; then | ||
DL_FOLDER=${MYAPP_TEMPLATE_DL_FOLDER_OVERRIDE} | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
if [ "${BASH_SOURCE[0]}" -ef "$0" ] | ||
then | ||
echo "Hey, you should source this script, not execute it!" | ||
exit 1 | ||
fi | ||
|
||
if [[ -n ${TERM-} && ${TERM-} != "dumb" && ${TERM-} != "emacs" ]]; then | ||
# https://stackoverflow.com/a/20983251/10278 | ||
u_red=`tput setaf 1` | ||
u_green=`tput setaf 2` | ||
u_resetcolor=`tput sgr0` # keep reset LAST. The above do change the output. | ||
else | ||
u_red='' | ||
u_green='' | ||
u_resetcolor='' | ||
fi | ||
|
||
# https://web.archive.org/web/20191121235402/https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html | ||
if [[ -n ${GITHUB_ACTIONS-} || -n ${BITBUCKET_REPO_OWNER-} || -n ${BITBUCKET_REPO_FULL_NAME-} ]]; | ||
# The '-' hyphens above test without angering the 'set -u' about unbound variables | ||
then | ||
export UTILS_WE_ARE_RUNNING_IN_CI=1 | ||
echo "Assuming C.I. environment." | ||
echo "Found at least one of GITHUB_ACTIONS, BITBUCKET_REPO_OWNER, BITBUCKET_REPO_FULL_NAME in env." | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/bash | ||
|
||
set -Eeuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
IFS=$'\n\t' | ||
|
||
THISDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
CUR_GIT_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
if [[ "$OSTYPE" != "cygwin" && "$OSTYPE" != "msys" ]]; then | ||
echo "This script is for use on Microsoft Windows" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z ${VCToolsInstallDir-} ]]; then | ||
echo "WHOOPS. vcvars64 (or vcvarsall) was not called yet." | ||
echo "You MUST start a VISUAL STUDIO command prompt. (Then start git-bash from within it.)" | ||
echo "Read the above and try again." | ||
exit 1 | ||
fi | ||
|
||
|
||
"${THISDIR}"/qtapps/ci.sh | ||
|
||
source "${THISDIR}"/qtapps/rootdirhelper.bash | ||
|
||
MSVCPATHFORBUILDING=$(cygpath -u "${VCToolsInstallDir}/bin/HOSTx64/x64") | ||
export PATH="${MSVCPATHFORBUILDING}:$PATH" # make sure MSVC link.exe is found (not bash/unix 'link' tool) | ||
|
||
WINDLPATH=$(cygpath -u $DL_FOLDER) | ||
|
||
# Variables used by CMakeLists | ||
export Qt6_DIR="${WINDLPATH}/Qt_desktop/6.5.3/msvc2019_64/lib/cmake/Qt6/" | ||
|
||
# Put qmake on the PATH: | ||
export PATH="${WINDLPATH}/Qt_desktop/6.5.3/msvc2019_64/bin:$PATH" | ||
|
||
|
||
|
||
mkdir -p cbuild | ||
pushd cbuild | ||
|
||
cmake "-G" "NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON $THISDIR/.. | ||
|
||
# See: https://forum.qt.io/topic/146961/building-qt6-5-with-nmake-error | ||
# Workaround for bug in Qt6CoreMacros.cmake: | ||
#buggy_genfile=meta_types/qt6appreproducejsonbug_debug_metatypes.json | ||
#if [ ! -s "$buggy_genfile" ]; then | ||
# echo "{}" >> "$buggy_genfile" | ||
#fi | ||
|
||
nmake | ||
|
||
|
||
popd # pushd cbuild | ||
|
||
|
||
|
||
THIS_FILENAME=$(basename "$0") | ||
echo 'We assume this was run with '\''set -e'\'' (look at upper lines of this script).' | ||
echo 'Assuming so, then getting here means:' | ||
echo "${THIS_FILENAME} SUCCESS" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <QGuiApplication> | ||
#include <QQmlApplicationEngine> | ||
#include <QQuickView> | ||
#include <QQmlContext> | ||
#include <QQmlEngine> | ||
|
||
#include <QObject> | ||
|
||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QGuiApplication app(argc, argv); | ||
|
||
QQmlApplicationEngine engine; | ||
engine.loadFromModule("Reproducejsonbug", "Main"); | ||
|
||
app.exec(); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import QtQuick | ||
|
||
Window { | ||
width: 1200 | ||
height: 600 | ||
visible: true | ||
} |
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.
if for any reason you have to use 6.5.3 and work around this bug, then uncomment the workaround shown here on lines 46,47,48,49