From 96584899dc71a6b4ff577239f52f5950e87befa1 Mon Sep 17 00:00:00 2001 From: David Dobrinskiy Date: Mon, 20 Feb 2023 13:54:17 +0400 Subject: [PATCH 1/7] test the actual package functionality --- projects/github.com/mamba-org/mamba/package.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/github.com/mamba-org/mamba/package.yml b/projects/github.com/mamba-org/mamba/package.yml index f2573e2070..beb61ac3d6 100644 --- a/projects/github.com/mamba-org/mamba/package.yml +++ b/projects/github.com/mamba-org/mamba/package.yml @@ -47,7 +47,11 @@ build: test: | mamba --version - conda --version + mamba init # init and source at test env + source .bashrc # ^ + mamba install isodate --yes + which python | grep 'github.com/mamba-org/mamba/v{{version}}/bin/python' + python -c "import isodate" provides: - condabin/conda From e527278dafd4794b063bfe63e0fdf3dac0758c23 Mon Sep 17 00:00:00 2001 From: David Dobrinskiy Date: Mon, 20 Feb 2023 14:46:56 +0400 Subject: [PATCH 2/7] fix all shebangs? --- projects/github.com/mamba-org/mamba/package.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/github.com/mamba-org/mamba/package.yml b/projects/github.com/mamba-org/mamba/package.yml index beb61ac3d6..6535f171ab 100644 --- a/projects/github.com/mamba-org/mamba/package.yml +++ b/projects/github.com/mamba-org/mamba/package.yml @@ -26,7 +26,8 @@ build: chmod +x mamba.sh ./mamba.sh $ARGS - fix-shebangs.ts {{prefix}}/bin/* + # fix-shebangs.ts {{prefix}}/bin/* + fix-shebangs.ts {{prefix}}/* #FIXME: add caveats # Please run the following to setup your shell: From 5d28371336e9562c30a4687faa2b4ee2398c61af Mon Sep 17 00:00:00 2001 From: David Dobrinskiy Date: Mon, 20 Feb 2023 15:10:57 +0400 Subject: [PATCH 3/7] fix all shebangs? --- projects/github.com/mamba-org/mamba/package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/github.com/mamba-org/mamba/package.yml b/projects/github.com/mamba-org/mamba/package.yml index 6535f171ab..8ab56343b0 100644 --- a/projects/github.com/mamba-org/mamba/package.yml +++ b/projects/github.com/mamba-org/mamba/package.yml @@ -27,7 +27,7 @@ build: ./mamba.sh $ARGS # fix-shebangs.ts {{prefix}}/bin/* - fix-shebangs.ts {{prefix}}/* + fix-shebangs.ts {{prefix}}/** #FIXME: add caveats # Please run the following to setup your shell: @@ -51,7 +51,7 @@ test: | mamba init # init and source at test env source .bashrc # ^ mamba install isodate --yes - which python | grep 'github.com/mamba-org/mamba/v{{version}}/bin/python' + which python | grep '{{prefix}}/bin/python' python -c "import isodate" provides: From 7d7050189eecfc52210c6b683a4487330e7a295a Mon Sep 17 00:00:00 2001 From: David Dobrinskiy Date: Mon, 20 Feb 2023 16:29:54 +0400 Subject: [PATCH 4/7] try sed replace hardcoded paths to env-dependent --- .../github.com/mamba-org/mamba/package.yml | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/projects/github.com/mamba-org/mamba/package.yml b/projects/github.com/mamba-org/mamba/package.yml index 8ab56343b0..27ef8b0cf5 100644 --- a/projects/github.com/mamba-org/mamba/package.yml +++ b/projects/github.com/mamba-org/mamba/package.yml @@ -26,8 +26,10 @@ build: chmod +x mamba.sh ./mamba.sh $ARGS - # fix-shebangs.ts {{prefix}}/bin/* - fix-shebangs.ts {{prefix}}/** + fix-shebangs.ts {{prefix}}/bin/* + + sh_tea_prefix='$(tea --prefix)' + sed -i.bak -e "s|$TEA_PREFIX/|$sh_tea_prefix/|g" {{prefix}}/bin/curl-config #FIXME: add caveats # Please run the following to setup your shell: @@ -46,13 +48,24 @@ build: - -u # update if already installed - -p {{prefix}} # prefix - where to install -test: | - mamba --version - mamba init # init and source at test env - source .bashrc # ^ - mamba install isodate --yes - which python | grep '{{prefix}}/bin/python' - python -c "import isodate" +test: + script: | + mamba --version # check that mamba is present + mamba init # init and source at test env + source .bashrc # ^ + + # check that we run mamba-provided python + which python | grep '{{prefix}}/bin/python' + + # now install a small package and try running it + mamba install isodate --yes + python -c "import isodate" + + + # should return nothing + # test that relocatable paths from build env were all fixed + export out="$(grep -r '/opt/github.com/mamba-org/mamba' {{prefix}})" + test "$out" = '' provides: - condabin/conda From 0647a3879189e1f33132f211da43912cd366cdec Mon Sep 17 00:00:00 2001 From: David Dobrinskiy Date: Mon, 20 Feb 2023 16:48:35 +0400 Subject: [PATCH 5/7] reorder tests steps to view list of files with non-relocatable opt/ links --- projects/github.com/mamba-org/mamba/package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/github.com/mamba-org/mamba/package.yml b/projects/github.com/mamba-org/mamba/package.yml index 27ef8b0cf5..2cc4c24453 100644 --- a/projects/github.com/mamba-org/mamba/package.yml +++ b/projects/github.com/mamba-org/mamba/package.yml @@ -57,16 +57,16 @@ test: # check that we run mamba-provided python which python | grep '{{prefix}}/bin/python' - # now install a small package and try running it - mamba install isodate --yes - python -c "import isodate" - # should return nothing # test that relocatable paths from build env were all fixed export out="$(grep -r '/opt/github.com/mamba-org/mamba' {{prefix}})" test "$out" = '' + # now install a small package and try running it + mamba install isodate --yes + python -c "import isodate" + provides: - condabin/conda - bin/mamba From 87327e7829f8ed91af46d4ce523a7d67f7705349 Mon Sep 17 00:00:00 2001 From: David Dobrinskiy Date: Mon, 20 Feb 2023 17:34:36 +0400 Subject: [PATCH 6/7] Revert "reorder tests steps to view list of files with non-relocatable opt/ links" This reverts commit 0647a3879189e1f33132f211da43912cd366cdec. --- projects/github.com/mamba-org/mamba/package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/github.com/mamba-org/mamba/package.yml b/projects/github.com/mamba-org/mamba/package.yml index 2cc4c24453..27ef8b0cf5 100644 --- a/projects/github.com/mamba-org/mamba/package.yml +++ b/projects/github.com/mamba-org/mamba/package.yml @@ -57,16 +57,16 @@ test: # check that we run mamba-provided python which python | grep '{{prefix}}/bin/python' + # now install a small package and try running it + mamba install isodate --yes + python -c "import isodate" + # should return nothing # test that relocatable paths from build env were all fixed export out="$(grep -r '/opt/github.com/mamba-org/mamba' {{prefix}})" test "$out" = '' - # now install a small package and try running it - mamba install isodate --yes - python -c "import isodate" - provides: - condabin/conda - bin/mamba From 3c675a87bde075051ef7192e075545003e91a588 Mon Sep 17 00:00:00 2001 From: David Dobrinskiy Date: Sun, 26 Feb 2023 13:58:58 +0400 Subject: [PATCH 7/7] add FIXME comment --- projects/github.com/mamba-org/mamba/package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/github.com/mamba-org/mamba/package.yml b/projects/github.com/mamba-org/mamba/package.yml index 27ef8b0cf5..5da36bd52d 100644 --- a/projects/github.com/mamba-org/mamba/package.yml +++ b/projects/github.com/mamba-org/mamba/package.yml @@ -30,6 +30,7 @@ build: sh_tea_prefix='$(tea --prefix)' sed -i.bak -e "s|$TEA_PREFIX/|$sh_tea_prefix/|g" {{prefix}}/bin/curl-config + #FIXME: once this pkg builds properly, add `rm mamba.sh` to reduce artifact size? #FIXME: add caveats # Please run the following to setup your shell: