From 06cc8cdf3579b3c5994927c253532ed3578529cf Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 20:38:47 +0000 Subject: [PATCH 1/9] Fix sed checks for CLI versioning --- src/ci/set-versions.sh | 2 +- src/ci/unset-versions.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ci/set-versions.sh b/src/ci/set-versions.sh index 174b77f8ea..4c90d18a29 100755 --- a/src/ci/set-versions.sh +++ b/src/ci/set-versions.sh @@ -14,4 +14,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_ SET_REQS="src/cli/requirements.txt" sed -i "s/0.0.0/${VERSION}/" ${SET_VERSIONS} -sed -i "s/onefuzztypes~=0.0.0/onefuzztypes==${VERSION}/" ${SET_REQS} +sed -i "s/onefuzztypes~=0.0.0/onefuzztypes~=${VERSION}/" ${SET_REQS} diff --git a/src/ci/unset-versions.sh b/src/ci/unset-versions.sh index 9312e6b4d8..2e9078ddf8 100755 --- a/src/ci/unset-versions.sh +++ b/src/ci/unset-versions.sh @@ -12,4 +12,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_ SET_REQS="src/cli/requirements.txt" sed -i 's/__version__ = .*/__version__ = "0.0.0"/' ${SET_VERSIONS} -sed -i "s/onefuzztypes==.*/onefuzztypes~=0.0.0/" ${SET_REQS} +sed -i "s/onefuzztypes~=.*/onefuzztypes~=0.0.0/" ${SET_REQS} From 7bf97684a3a1ecd61ad0cc2112f0cb2d35b528e7 Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:24:29 +0000 Subject: [PATCH 2/9] Fix. --- src/ci/set-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/set-versions.sh b/src/ci/set-versions.sh index 4c90d18a29..174b77f8ea 100755 --- a/src/ci/set-versions.sh +++ b/src/ci/set-versions.sh @@ -14,4 +14,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_ SET_REQS="src/cli/requirements.txt" sed -i "s/0.0.0/${VERSION}/" ${SET_VERSIONS} -sed -i "s/onefuzztypes~=0.0.0/onefuzztypes~=${VERSION}/" ${SET_REQS} +sed -i "s/onefuzztypes~=0.0.0/onefuzztypes==${VERSION}/" ${SET_REQS} From 1b5e57ef39586c1da9cab814dc22a508cc1559b7 Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:30:47 +0000 Subject: [PATCH 3/9] Fix. --- src/ci/set-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/set-versions.sh b/src/ci/set-versions.sh index 174b77f8ea..4c90d18a29 100755 --- a/src/ci/set-versions.sh +++ b/src/ci/set-versions.sh @@ -14,4 +14,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_ SET_REQS="src/cli/requirements.txt" sed -i "s/0.0.0/${VERSION}/" ${SET_VERSIONS} -sed -i "s/onefuzztypes~=0.0.0/onefuzztypes==${VERSION}/" ${SET_REQS} +sed -i "s/onefuzztypes~=0.0.0/onefuzztypes~=${VERSION}/" ${SET_REQS} From 35d2f1dc8ee3dd8b1bab5167392d62c507022ac5 Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:38:42 +0000 Subject: [PATCH 4/9] Changing build_cli --- src/ci/build_cli.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ci/build_cli.ps1 b/src/ci/build_cli.ps1 index 6a255e977a..2ea949ad11 100644 --- a/src/ci/build_cli.ps1 +++ b/src/ci/build_cli.ps1 @@ -27,14 +27,14 @@ try { Write-Host $version # Replace onefuzztypes requirement to whl file - (Get-Content -path "requirements.txt") -replace "onefuzztypes==$version", "./onefuzztypes-$_version-py3-none-any.whl" | Out-File -FilePath "requirements.txt" -Encoding "ascii" + (Get-Content -path "requirements.txt") -replace "onefuzztypes~=$version", "./onefuzztypes-$_version-py3-none-any.whl" | Out-File -FilePath "requirements.txt" -Encoding "ascii" pip install -r .\requirements.txt -r .\requirements-dev.txt # Build exe pyinstaller onefuzz/__main__.py --onefile --name "onefuzz" --additional-hooks-dir extra/pyinstaller --hidden-import='pkg_resources.py2_warn' --hidden-import='opentelemetry.baggage' --hidden-import='opentelemetry.baggage.propagation' --hidden-import='opentelemetry.context.contextvars_context' --copy-metadata opentelemetry-sdk --copy-metadata opentelemetry-api --exclude-module tkinter --exclude-module PySide2 --exclude-module PIL.ImageDraw --exclude-module Pillow --clean # Cleanup - (Get-Content -path "requirements.txt") -replace "./onefuzztypes-$_version-py3-none-any.whl", "onefuzztypes==$version" | Out-File -FilePath "requirements.txt" -Encoding "ascii" + (Get-Content -path "requirements.txt") -replace "./onefuzztypes-$_version-py3-none-any.whl", "onefuzztypes~=$version" | Out-File -FilePath "requirements.txt" -Encoding "ascii" Remove-Item "*.whl" Set-Location "$app_dir" bash .\unset-versions.sh From adc3917e7976d71d8fdbecb3e5b888217124cd24 Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:52:08 +0000 Subject: [PATCH 5/9] Trying greater than --- src/ci/set-versions.sh | 2 +- src/ci/unset-versions.sh | 2 +- src/cli/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ci/set-versions.sh b/src/ci/set-versions.sh index 4c90d18a29..1b3a18ab1d 100755 --- a/src/ci/set-versions.sh +++ b/src/ci/set-versions.sh @@ -14,4 +14,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_ SET_REQS="src/cli/requirements.txt" sed -i "s/0.0.0/${VERSION}/" ${SET_VERSIONS} -sed -i "s/onefuzztypes~=0.0.0/onefuzztypes~=${VERSION}/" ${SET_REQS} +sed -i "s/onefuzztypes>=0.0.*/onefuzztypes>=${VERSION}/" ${SET_REQS} diff --git a/src/ci/unset-versions.sh b/src/ci/unset-versions.sh index 2e9078ddf8..d1337e11a2 100755 --- a/src/ci/unset-versions.sh +++ b/src/ci/unset-versions.sh @@ -12,4 +12,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_ SET_REQS="src/cli/requirements.txt" sed -i 's/__version__ = .*/__version__ = "0.0.0"/' ${SET_VERSIONS} -sed -i "s/onefuzztypes~=.*/onefuzztypes~=0.0.0/" ${SET_REQS} +sed -i "s/onefuzztypes>=.*/onefuzztypes>=0.0.0/" ${SET_REQS} diff --git a/src/cli/requirements.txt b/src/cli/requirements.txt index 475f86acc4..8bdff38a47 100644 --- a/src/cli/requirements.txt +++ b/src/cli/requirements.txt @@ -21,4 +21,4 @@ opentelemetry-instrumentation-requests==0.37b0 # install rsa version >=4.7 to fix CVE-2020-25658 rsa>=4.7 # onefuzztypes version is set during build -onefuzztypes~=0.0.0 +onefuzztypes>=0.0.0 From 0162ae6a24c2b36cabf6582c3e7abe8b37571e4c Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:56:40 +0000 Subject: [PATCH 6/9] Tring once more. --- src/ci/set-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/set-versions.sh b/src/ci/set-versions.sh index 1b3a18ab1d..a274f6d51d 100755 --- a/src/ci/set-versions.sh +++ b/src/ci/set-versions.sh @@ -14,4 +14,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_ SET_REQS="src/cli/requirements.txt" sed -i "s/0.0.0/${VERSION}/" ${SET_VERSIONS} -sed -i "s/onefuzztypes>=0.0.*/onefuzztypes>=${VERSION}/" ${SET_REQS} +sed -i "s/onefuzztypes>=0.0.0/onefuzztypes>=${VERSION}/" ${SET_REQS} From a25e3070b782a18521346614bfa297447d99257b Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 22:00:37 +0000 Subject: [PATCH 7/9] Trying major minor --- src/ci/set-versions.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ci/set-versions.sh b/src/ci/set-versions.sh index a274f6d51d..f0732e4b5e 100755 --- a/src/ci/set-versions.sh +++ b/src/ci/set-versions.sh @@ -10,6 +10,9 @@ GET_VERSION=${SCRIPT_DIR}/get-version.sh VERSION=${1:-$(${GET_VERSION})} cd ${SCRIPT_DIR}/../../ +arrVer=(${VERSION//./ }) +echo "${arrVer[0]}.${arrVer[1]}" + SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version__.py" SET_REQS="src/cli/requirements.txt" From 72852dcfb1c9c8b0feeae967007be4d35c4aa23d Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 22:06:05 +0000 Subject: [PATCH 8/9] trying to replace major minor --- src/ci/set-versions.sh | 5 +++-- src/cli/requirements.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ci/set-versions.sh b/src/ci/set-versions.sh index f0732e4b5e..2271a752f4 100755 --- a/src/ci/set-versions.sh +++ b/src/ci/set-versions.sh @@ -11,10 +11,11 @@ VERSION=${1:-$(${GET_VERSION})} cd ${SCRIPT_DIR}/../../ arrVer=(${VERSION//./ }) -echo "${arrVer[0]}.${arrVer[1]}" +MAJOR=${arrVer[0]} +MINOR=${arrVer[1]} SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version__.py" SET_REQS="src/cli/requirements.txt" sed -i "s/0.0.0/${VERSION}/" ${SET_VERSIONS} -sed -i "s/onefuzztypes>=0.0.0/onefuzztypes>=${VERSION}/" ${SET_REQS} +sed -i "s/onefuzztypes==0.0.0/onefuzztypes==${MAJOR}.${MINOR}.*/" ${SET_REQS} diff --git a/src/cli/requirements.txt b/src/cli/requirements.txt index 8bdff38a47..d9977fe03e 100644 --- a/src/cli/requirements.txt +++ b/src/cli/requirements.txt @@ -21,4 +21,4 @@ opentelemetry-instrumentation-requests==0.37b0 # install rsa version >=4.7 to fix CVE-2020-25658 rsa>=4.7 # onefuzztypes version is set during build -onefuzztypes>=0.0.0 +onefuzztypes==0.0.0 From 3a1d463549e24d8c69fe587327f04d6c467d79be Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Wed, 6 Sep 2023 22:09:17 +0000 Subject: [PATCH 9/9] Using major minor --- src/ci/build_cli.ps1 | 4 ++-- src/ci/unset-versions.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ci/build_cli.ps1 b/src/ci/build_cli.ps1 index 2ea949ad11..6a255e977a 100644 --- a/src/ci/build_cli.ps1 +++ b/src/ci/build_cli.ps1 @@ -27,14 +27,14 @@ try { Write-Host $version # Replace onefuzztypes requirement to whl file - (Get-Content -path "requirements.txt") -replace "onefuzztypes~=$version", "./onefuzztypes-$_version-py3-none-any.whl" | Out-File -FilePath "requirements.txt" -Encoding "ascii" + (Get-Content -path "requirements.txt") -replace "onefuzztypes==$version", "./onefuzztypes-$_version-py3-none-any.whl" | Out-File -FilePath "requirements.txt" -Encoding "ascii" pip install -r .\requirements.txt -r .\requirements-dev.txt # Build exe pyinstaller onefuzz/__main__.py --onefile --name "onefuzz" --additional-hooks-dir extra/pyinstaller --hidden-import='pkg_resources.py2_warn' --hidden-import='opentelemetry.baggage' --hidden-import='opentelemetry.baggage.propagation' --hidden-import='opentelemetry.context.contextvars_context' --copy-metadata opentelemetry-sdk --copy-metadata opentelemetry-api --exclude-module tkinter --exclude-module PySide2 --exclude-module PIL.ImageDraw --exclude-module Pillow --clean # Cleanup - (Get-Content -path "requirements.txt") -replace "./onefuzztypes-$_version-py3-none-any.whl", "onefuzztypes~=$version" | Out-File -FilePath "requirements.txt" -Encoding "ascii" + (Get-Content -path "requirements.txt") -replace "./onefuzztypes-$_version-py3-none-any.whl", "onefuzztypes==$version" | Out-File -FilePath "requirements.txt" -Encoding "ascii" Remove-Item "*.whl" Set-Location "$app_dir" bash .\unset-versions.sh diff --git a/src/ci/unset-versions.sh b/src/ci/unset-versions.sh index d1337e11a2..95cbfac3d5 100755 --- a/src/ci/unset-versions.sh +++ b/src/ci/unset-versions.sh @@ -12,4 +12,4 @@ SET_VERSIONS="src/pytypes/onefuzztypes/__version__.py src/cli/onefuzz/__version_ SET_REQS="src/cli/requirements.txt" sed -i 's/__version__ = .*/__version__ = "0.0.0"/' ${SET_VERSIONS} -sed -i "s/onefuzztypes>=.*/onefuzztypes>=0.0.0/" ${SET_REQS} +sed -i "s/onefuzztypes==.*/onefuzztypes==0.0.0/" ${SET_REQS}