Skip to content

What was that? #12

@popov654

Description

@popov654

It kinda worked before your last commit. Now the SCons script crashes on Python 3.9 (which is now required) with the following error:

AttributeError: type object 'SConsToolingMetrics' has no attribute 'register_metrics'

Please revert it back

Activity

JedMeister

JedMeister commented on Dec 3, 2023

@JedMeister

I can't speak to your specific error, but I suspect that you aren't setting up the dependencies as they are now required (since the last update to this repo). FYI the readme (of this repo) needs to be updated - specifically the dependency resolution (upstream now uses poetry rather than pip). See my post here: #11

popov654

popov654 commented on Dec 4, 2023

@popov654
Author

Of course I did install poetry. The error is not related to its absense, for sure

JedMeister

JedMeister commented on Dec 4, 2023

@JedMeister

Of course I did install poetry.

Ok, although I note that nothing in your post made that obvious to me. I'm not a mind reader! 😁

The error is not related to its absense, for sure

I wasn't necessarily suggesting that you hadn't installed poetry itself (although as I note above, it certainly isn't obvious in your post that you had). I was suggesting that you have missing or outdated dependencies and haven't setup/installed the environment correctly (i.e. poetry install) and/or loaded it properly (i.e. poetry shell or poetry run ...). That's certainly what the error message you posted suggests to me.

Also, looking at the code, there is an explicit comment noting that the env needs to be setup correctly before that method will work. A quick look at the code (the mongo-tooling-metrics package) shows that if you have the correct dependencies installed, then SConsToolingMetrics definitely should have a register_metrics attribute (SConsToolingMetrics is a subclass of MongoMetrics and the MongoMetrics class (in base_metrics.py) has the method register_metrics).

Further, it's working fine here so if you have indeed set up the env correctly (via poetry), I'm not sure what the issue with your system is?

If you're not interested in working out what your local issue is and a previous version was working for you (and you don't care about using an older version), why don't you just revert to that? The latest commit in this repo just pulls in a newer version (of the 'mongo' git submodule) from upstream, so just revert the mongo repo to the previous commit. I.e. (starting in (path/to/mongodb-without-avx):

# gd HEAD^
diff --git a/mongo b/mongo
index 0065186..63c9bc0 160000
--- a/mongo
+++ b/mongo
@@ -1 +1 @@
-Subproject commit 006518628b59623ceb9e0f6503f4bf6a744f120f
+Subproject commit 63c9bc0881f596c25b7d6432e20ebe501feb986a-dirty
# cd mongo
# git checkout 006518628b5

(Note that mine notes it's "dirty" because I've applied the patch as per this repo).

Good luck.

popov654

popov654 commented on Dec 5, 2023

@popov654
Author

Thanks, I made a checkout of the submodule and everything went fine. However, I don't understand what commands I should have used with poetry before issuing the main command. Please update the readme to reflect all the necessary steps for beginners :)

JedMeister

JedMeister commented on Dec 5, 2023

@JedMeister

Thanks, I made a checkout of the submodule and everything went fine.

Awesome.

However, I don't understand what commands I should have used with poetry before issuing the main command.

That's why I pointed you towards the issue that I opened the other day: #11. That includes the commands needed (or at least needed by me), from start to finish. If you're not using Debian, you may need to make some adjustments, but it should be close (and the poetry related stuff should be the same).

To be really specific, after cloning the repo and installing poetry, whilst in the mongo dir, run poetry install to install the dependencies (instead of the pip install ... command that was required previously).

Then you have 2 options:

  • either run poetry shell (essentially activating the venv); or
  • poetry run ... (where ... is the command(s) you wish to run in the venv)

Please update the readme to reflect all the necessary steps for beginners :)

I agree! FWIW that's why I opened that other issue. (FYI I am nothing to do with this repo - I'm just a random person on the internet - who got stuck trying to build mongo, but then managed to work it out and shared my solution).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @JedMeister@popov654

        Issue actions

          What was that? · Issue #12 · GermanAizek/mongodb-without-avx