From 83246bddb980c18a7889cf12ebcd520085a55c70 Mon Sep 17 00:00:00 2001 From: Marethyu <45374460+Pythyu@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:00:25 +0100 Subject: [PATCH] Clean useless python 2 home paths (#31486) Co-authored-by: Alex Lopez --- README.md | 4 +--- omnibus/config/software/datadog-agent.rb | 8 ++------ tasks/agent.py | 2 -- tasks/gotest.py | 2 -- tasks/libs/common/utils.py | 3 --- tasks/winbuildscripts/unittests.ps1 | 2 +- 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ab137bbe48339..8e93e1988c48e 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,7 @@ To build the Agent you need: **Note:** you may want to use a python virtual environment to avoid polluting your system-wide python environment with the agent build/dev dependencies. You can create a virtual environment using `virtualenv` and then use the `invoke agent.build` - parameters `--python-home-2=` and/or `--python-home-3=` - (depending on the python versions you are using) to use the virtual environment's + parameters `--python-home-3=` to use the virtual environment's interpreter and libraries. By default, this environment is only used for dev dependencies listed in `requirements.txt`. @@ -55,7 +54,6 @@ To start working on the Agent, you can build the `main` branch: virtualenvs): invoke agent.build \ - --python-home-2=$GOPATH/src/github.com/DataDog/datadog-agent/venv2 \ --python-home-3=$GOPATH/src/github.com/DataDog/datadog-agent/venv3 Running `invoke agent.build`: diff --git a/omnibus/config/software/datadog-agent.rb b/omnibus/config/software/datadog-agent.rb index bfd08c4dd9a20..cabf4557c735c 100644 --- a/omnibus/config/software/datadog-agent.rb +++ b/omnibus/config/software/datadog-agent.rb @@ -66,10 +66,6 @@ env["GOROOT"] = msgoroot env["PATH"] = "#{msgoroot}/bin:#{env['PATH']}" end - default_install_dir = "/opt/datadog-agent" - if Omnibus::Config.host_distribution == "ociru" - default_install_dir = "#{install_dir}" - end # we assume the go deps are already installed before running omnibus if windows_target? @@ -92,10 +88,10 @@ if linux_target? include_sds = "--include-sds" # we only support SDS on Linux targets for now end - command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{default_install_dir}/embedded --python-home-2=#{default_install_dir}/embedded --python-home-3=#{default_install_dir}/embedded --flavor #{flavor_arg}", env: env + command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg}", env: env if heroku_target? - command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --python-home-2=#{install_dir}/embedded --python-home-3=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env + command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env end end diff --git a/tasks/agent.py b/tasks/agent.py index 50d88463e274e..190c7b04c0916 100644 --- a/tasks/agent.py +++ b/tasks/agent.py @@ -127,7 +127,6 @@ def build( install_path=None, embedded_path=None, rtloader_root=None, - python_home_2=None, python_home_3=None, major_version='7', exclude_rtloader=False, @@ -164,7 +163,6 @@ def build( install_path=install_path, embedded_path=embedded_path, rtloader_root=rtloader_root, - python_home_2=python_home_2, python_home_3=python_home_3, major_version=major_version, ) diff --git a/tasks/gotest.py b/tasks/gotest.py index 3ef5ebc9de905..e9403679ea40a 100644 --- a/tasks/gotest.py +++ b/tasks/gotest.py @@ -255,7 +255,6 @@ def test( race=False, profile=False, rtloader_root=None, - python_home_2=None, python_home_3=None, cpus=None, major_version='7', @@ -303,7 +302,6 @@ def test( ldflags, gcflags, env = get_build_flags( ctx, rtloader_root=rtloader_root, - python_home_2=python_home_2, python_home_3=python_home_3, major_version=major_version, ) diff --git a/tasks/libs/common/utils.py b/tasks/libs/common/utils.py index 44758ae35b543..c6a024b60c0ae 100644 --- a/tasks/libs/common/utils.py +++ b/tasks/libs/common/utils.py @@ -203,7 +203,6 @@ def get_build_flags( run_path=None, embedded_path=None, rtloader_root=None, - python_home_2=None, python_home_3=None, major_version='7', headless_mode=False, @@ -243,8 +242,6 @@ def get_build_flags( ldflags += f"-X {REPO_PATH}/pkg/config/setup.defaultRunPath={run_path} " # setting python homes in the code - if python_home_2: - ldflags += f"-X {REPO_PATH}/pkg/collector/python.pythonHome2={python_home_2} " if python_home_3: ldflags += f"-X {REPO_PATH}/pkg/collector/python.pythonHome3={python_home_3} " diff --git a/tasks/winbuildscripts/unittests.ps1 b/tasks/winbuildscripts/unittests.ps1 index 5464db3dc228c..1b0f5e18ed438 100644 --- a/tasks/winbuildscripts/unittests.ps1 +++ b/tasks/winbuildscripts/unittests.ps1 @@ -54,7 +54,7 @@ if($err -ne 0){ Write-Host -ForegroundColor Red "Agent build failed $err" [Environment]::Exit($err) } -& inv -e test --junit-tar="$Env:JUNIT_TAR" --race --profile --rerun-fails=2 --coverage --cpus 8 --python-home-2=$Env:Python2_ROOT_DIR --python-home-3=$Env:Python3_ROOT_DIR --save-result-json C:\mnt\$test_output_file $Env:EXTRA_OPTS --build-stdlib $TEST_WASHER_FLAG +& inv -e test --junit-tar="$Env:JUNIT_TAR" --race --profile --rerun-fails=2 --coverage --cpus 8 --python-home-3=$Env:Python3_ROOT_DIR --save-result-json C:\mnt\$test_output_file $Env:EXTRA_OPTS --build-stdlib $TEST_WASHER_FLAG If ($LASTEXITCODE -ne "0") { exit $LASTEXITCODE }