Skip to content
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

fix: Version parsing for mamba 1 #936

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

jjerphan
Copy link
Contributor

@jjerphan jjerphan commented Jan 27, 2025

Description

Fix mamba-org/mamba#3772.

#914 only parses the version correctly for mamba 2 but mamba<2 displayed the version differently:

mamba 1.5.11
conda 24.11.1

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan jjerphan changed the title fix: Version parsing fix: Version parsing for mamba 1 Jan 27, 2025
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jan 27, 2025
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan jjerphan marked this pull request as ready for review January 27, 2025 18:31
@jjerphan jjerphan requested a review from a team as a code owner January 27, 2025 18:31
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan
Copy link
Contributor Author

jjerphan commented Feb 3, 2025

The output to stderr on the failing test on macOS contains error messages related to signing (see in the logs) despite the seemingly correct execution and installation:

2025-02-03T10:08:24.8661870Z Feb  3 09:51:56  installer[10909] <Debug>: Product archive /private/var/folders/s2/l6lg2jp90ns78dx8mzkn6w_c0000gn/T/pytest-of-runner/pytest-1/test_example_miniforge_1_5_12_0/installer/Miniforge3-25.0.0-1-MacOSX-arm64.pkg trustLevel=100
2025-02-03T10:08:24.8666410Z Feb  3 09:51:56  installer[10909] <Debug>: External component packages (4) trustLevel=100 (trust evaluation failed: Error Domain=PKInstallErrorDomain Code=101 "The package “Miniforge3-25.0.0-1-MacOSX-arm64.pkg” is not signed." UserInfo={NSURL=#pathupdate.pkg -- file:///var/folders/s2/l6lg2jp90ns78dx8mzkn6w_c0000gn/T/pytest-of-runner/pytest-1/test_example_miniforge_1_5_12_0/installer/Miniforge3-25.0.0-1-MacOSX-arm64.pkg#Distribution, PKInstallPackageIdentifier=io.continuum.pkg.pathupdate, NSLocalizedDescription=The package “Miniforge3-25.0.0-1-MacOSX-arm64.pkg” is not signed.})
2025-02-03T10:08:24.8673000Z Feb  3 09:51:56  installer[10909] <Debug>: -[IFDInstallController(Private) _buildInstallPlanReturningError:]: location = file://localhost
2025-02-03T10:08:24.8677210Z Feb  3 09:51:56  installer[10909] <Debug>: -[IFDInstallController(Private) _buildInstallPlanReturningError:]: file://localhost/private/var/folders/s2/l6lg2jp90ns78dx8mzkn6w_c0000gn/T/pytest-of-runner/pytest-1/test_example_miniforge_1_5_12_0/installer/Miniforge3-25.0.0-1-MacOSX-arm64.pkg#prepare_installation.pkg
2025-02-03T10:08:24.8680480Z Feb  3 09:51:56  installer[10909] <Debug>: -[IFDInstallController(Private) _buildInstallPlanReturningError:]: file://localhost/private/var/folders/s2/l6lg2jp90ns78dx8mzkn6w_c0000gn/T/pytest-of-runner/pytest-1/test_example_miniforge_1_5_12_0/installer/Miniforge3-25.0.0-1-MacOSX-arm64.pkg#run_installation.pkg
2025-02-03T10:08:24.8686730Z Feb  3 09:51:56  installer[10909] <Debug>: -[IFDInstallController(Private) _buildInstallPlanReturningError:]: file://localhost/private/var/folders/s2/l6lg2jp90ns78dx8mzkn6w_c0000gn/T/pytest-of-runner/pytest-1/test_example_miniforge_1_5_12_0/installer/Miniforge3-25.0.0-1-MacOSX-arm64.pkg#user_post_install.pkg
2025-02-03T10:08:24.8688650Z Feb  3 09:51:56  installer[10909] <Info>: Set authorization level to none for session
2025-02-03T10:08:24.8689190Z Feb  3 09:51:56  installer[10909] <Info>: Authorization is being checked, waiting until authorization arrives.
2025-02-03T10:08:24.8689750Z Feb  3 09:51:56  installer[10909] <Info>: Packages have been authorized for installation.
2025-02-03T10:08:24.8694820Z Feb  3 09:51:56  installer[10909] <Debug>: Will use PK session
2025-02-03T10:08:24.8697490Z Feb  3 09:51:56  installer[10909] <Debug>: Using authorization level of none for IFPKInstallElement
2025-02-03T10:08:24.8698070Z Feb  3 09:51:56  installer[10909] <Info>: PackageKit: Bypassing the enforcement checker since the destination is read/write
2025-02-03T10:08:24.8698490Z Feb  3 09:51:56  installer[10909] <Info>: Starting installation:
2025-02-03T10:08:24.8698800Z Feb  3 09:51:56  installer[10909] <Notice>: Configuring volume "Macintosh HD"
2025-02-03T10:08:24.8699150Z Feb  3 09:51:56  installer[10909] <Info>: Preparing disk for local booted install.
2025-02-03T10:08:24.8699560Z Feb  3 09:51:56  installer[10909] <Notice>: Free space on "Macintosh HD": 111.07 GB (111066660864 bytes).
2025-02-03T10:08:24.8700120Z Feb  3 09:51:56  installer[10909] <Notice>: Create temporary directory "/var/folders/s2/l6lg2jp90ns78dx8mzkn6w_c0000gn/T//Install.10909VDpFwV"
2025-02-03T10:08:24.8700640Z Feb  3 09:51:56  installer[10909] <Notice>: IFPKInstallElement (3 packages)
2025-02-03T10:08:24.8700970Z Feb  3 09:51:56  installer[10909] <Info>: Current Path: /usr/sbin/installer
2025-02-03T10:08:24.8701440Z Feb  3 09:51:56  installer[10909] <Info>: Current Path: /Users/runner/miniconda3/envs/constructor-dev/bin/python3.12
2025-02-03T10:08:24.8703170Z Feb  3 09:51:56  installer[10909] <Info>: Current Path: /bin/bash
2025-02-03T10:08:24.8704460Z Feb  3 09:51:56  installer[10909] <Info>: Current Path: /Users/runner/runners/2.322.0/bin/Runner.Worker
2025-02-03T10:08:24.8705070Z Feb  3 09:51:56  installer[10909] <Info>: Current Path: /Users/runner/runners/2.322.0/bin/Runner.Listener
2025-02-03T10:08:24.8705550Z Feb  3 09:51:56  installer[10909] <Info>: Current Path: /usr/local/opt/runner/provisioner/provisioner
2025-02-03T10:08:24.8705940Z Feb  3 09:51:56  installer[10909] <Info>: Current Path: /bin/bash
2025-02-03T10:08:24.8706410Z Feb  3 09:51:56  installer[10909] <Notice>: PackageKit: Enqueuing install with framework-specified quality of service (utility)
2025-02-03T10:08:24.8710240Z Feb  3 09:52:11  installer[10909] <Debug>: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “Miniforge3-25.0.0-1-MacOSX-arm64.pkg”." UserInfo={NSFilePath=./postinstall, NSURL=file:///var/folders/s2/l6lg2jp90ns78dx8mzkn6w_c0000gn/T/pytest-of-runner/pytest-1/test_example_miniforge_1_5_12_0/installer/Miniforge3-25.0.0-1-MacOSX-arm64.pkg#user_post_install.pkg, PKInstallPackageIdentifier=io.continuum.pkg.user_post_install, NSLocalizedDescription=An error occurred while running scripts from the package “Miniforge3-25.0.0-1-MacOSX-arm64.pkg”.}
2025-02-03T10:08:24.8714730Z Feb  3 09:52:12  installer[10909] <Info>: PackageKit: Bypassing the enforcement checker since the destination is read/write
2025-02-03T10:08:24.8715540Z Feb  3 09:52:12  installer[10909] <Error>: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
2025-02-03T10:08:24.8747240Z 

I am trying to understand the origin of the error.

Is there something specific to do?

@jjerphan jjerphan requested a review from marcoesters February 3, 2025 10:31
@marcoesters
Copy link
Contributor

The signing error is expected since the installers are not signed. As you correctly noticed, the installation continues afterwards. Unfortunately, there are no error messages in the output. If you run this locally, you should be able to look at /var/log/install.log and maybe get more information.

My initial guess is that CONSTRUCTOR_TEST_MAMBA_VERSION is not passed into the installation process and the post-install script fails. Instead of monkeypatching it, you could add it to construct.yaml.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan
Copy link
Contributor Author

jjerphan commented Feb 4, 2025

Instead of monkeypatching it, you could add it to construct.yaml.

Is there another way to proceed than by c6cfe81?

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@marcoesters
Copy link
Contributor

Instead of monkeypatching it, you could add it to construct.yaml.

Is there another way to proceed than by c6cfe81?

Here is an example: https://github.com/conda/constructor/blob/main/examples/scripts/construct.yaml#L9-L13

You could do the same with the mamba version:

script_env_variables:
    CONSTRUCTOR_TEST_MAMBA_VERSION: {{ mamba_version }}

@marcoesters
Copy link
Contributor

I think the problem you are currently running into is that I don't see that Miniforge is uninstalled after test execution. The pkg installers can unfortunately only be installed into select locations, so the mamba2 example will attempt to install into the same location as the mamba1 version, which is not allowed.

So, you either remove the installation directory after the test or you parametrize the location via default_location_pkg.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan
Copy link
Contributor Author

Gentle follow-up, @marcoesters: does this solution work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

Installation error: integer expression expected
3 participants