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

pyMISP recent version not available #534

Open
ghost opened this issue Dec 23, 2022 · 4 comments
Open

pyMISP recent version not available #534

ghost opened this issue Dec 23, 2022 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 23, 2022

New nix user as well as new mach-nix user here.

Trying to use the latest version of pyMISP (2.4.166). When not specifying the version in requirements.txt, it pulls version 2.4.160.1 which throws warnings and has slightly different import syntax.

When attempting to specify the latest version, the build fails:

error: builder for '/nix/store/hmpdm6wn3688k5yh2flwgqdsdq8yqzdn-mach_nix_file.drv' failed with exit code 1;
       last 10 log lines:
       > Mach-nix version: master
       > Python: 3.9.9
       > Cause: Requirements conflict: pymisp (<SpecifierSet('==2.4.166')>,)
       > The requirements which caused the error:
       >   pymisp (<SpecifierSet('==2.4.166')>,)
       >
       > The given requirements might contain package versions which are not yet part of the dependency DB
       > currently used. The DB can be updated by specifying 'pypiDataRev' when importing mach-nix.
       > For examples see: https://github.com/DavHau/mach-nix/blob/master/examples.md
       >
       For full logs, run 'nix log /nix/store/hmpdm6wn3688k5yh2flwgqdsdq8yqzdn-mach_nix_file.drv'.
(use '--show-trace' to show detailed location information)

I'm not quite sure how to get this to pull the latest version utilizing mach-nix. Any help would be appreciated. Thank you.

@bjornfor
Copy link
Contributor

I'm not quite sure how to get this to pull the latest version utilizing mach-nix. Any help would be appreciated. Thank you.

Can you post your Nix expression (.nix file)?

@ghost
Copy link
Author

ghost commented Dec 23, 2022

I used mach-nix env ./env -r requirements.txt to generate the environment. It produced several files to be used. Is there one in particular you need the contents from or all?

@bjornfor
Copy link
Contributor

I don't have that layout (of ./env) in my head, and to get mach-nix I'd need to write a Nix expression anyway -- I don't have it installed globally on my system.

This is what I was looking for:

let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix";
    ref = "refs/tags/3.5.0";
    #ref = "refs/heads/master";
    #rev = "913e6c16f986746ba5507878ef7ff992804d1fa8";
  }) {
    # Get latest rev from https://github.com/DavHau/pypi-deps-db/commits/master
    pypiDataRev = "e9571cac25d2f509e44fec9dc94a3703a40126ff";
    # When updating pypiDataRev, replace the hash with a dummy, then copy what
    # Nix says when the build fails.
    #pypiDataSha256 = "0000000000000000000000000000000000000000000000000000";
    pypiDataSha256 = "1rbb0yx5kjn0j6lk0ml163227swji8abvq0krynqyi759ixirxd5";
  };
in
  mach-nix.mkPython {
    requirements = ''
      # Let mach-nix resolve the version.
      #pyMISP

      # Tell mach-nix exact version.
      pyMISP=2.4.166
    '';
  }

To know about the arguments that can be passed to mach-nix above, I used https://github.com/DavHau/mach-nix/blob/master/examples.md.

Unfortunately, with the lastest pypi-deps-db (and mach-nix) I'm still getting the Requirements conflict as you did (when forcing the latest pyMISP version).

Next step could be manually looking for pyMISP in https://github.com/DavHau/pypi-deps-db.

@ghost
Copy link
Author

ghost commented Dec 23, 2022

Ah I see. I unfortunately didn't set up mach-nix in the same fashion you did.

I used the available flake to install it and then used the env expression to generate the config.

This produced:
default.nix inputs.nix lock.toml python.nix requirements.txt shell.nix

In your case, for the Nix expression.. How is that then executed? That seems much simpler to ingest as opposed to the multitude of files produced in ./env.

It appears that I won't be able to use the latest version of pyMISP unfortunately through mach-nix.

EDIT: I think I figured out how to do it the way you did it. Still the same issue with the recent version, but was able to nix-build using your template above. This was a great learning experience if nothing else! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant