GithubHelp home page GithubHelp logo

Comments (13)

BlankSpruce avatar BlankSpruce commented on August 10, 2024 1

It matches my experience when python is not pointing to python2 which is the case on Manjaro. I've tested it with gersemi but I think it doesn't matter what repository is used. Here's what happens in Firefox:
image
and Chromium:
image

However if you apply this patch it works as expected:

diff --git a/code-compass.el b/code-compass.el
index 9b210d7..af12d2a 100644
--- a/code-compass.el
+++ b/code-compass.el
@@ -2936,7 +2936,7 @@ ZHVsZSYmbW9kdWxlLmV4cG9ydHM/bW9kdWxlLmV4cG9ydHM9R286dGhpcy5kMz1Hb30oK
TsK"                                                                                      
   (message "Produce json...")
   (shell-command
    (format
-    "cd /tmp; python csv_as_enclosure_json.py --structure cloc-%s.csv --weights %s-revisions.csv > /tmp/%s/%s_hotspot_proto.json"                                                   
+    "cd /tmp; python2 csv_as_enclosure_json.py --structure cloc-%s.csv --weights %s-revisions.csv > /tmp/%s/%s_hotspot_proto.json"                                                  
     (f-filename repository)
     (f-filename repository)
     (f-filename repository)

from code-compass.

furious-luke avatar furious-luke commented on August 10, 2024 1

@ag91 Thanks for the quick response, much appreciated. I think @BlankSpruce has identified the issue; I'm using Python 3.8 by default, and so it's most likely the same issue. I'll try the patch and see how it goes. Thanks!

from code-compass.

davidkrauser avatar davidkrauser commented on August 10, 2024 1

I'm seeing this same issue (n is undefined) with the latest main branch (58daee0), but it looks like @BlankSpruce 's patch no longer applies :-/

I tried @BlankSpruce 's branch (803e920) from an open pull request that appeared to be d3 related, but that just moved the problem. Now I see:

Uncaught TypeError: i is undefined
    n http://localhost:8888/d3/d3.v3.min.js:4
    n http://localhost:8888/d3/d3.v3.min.js:4
    <anonymous> http://localhost:8888/script.js:45
    t http://localhost:8888/d3/d3.v3.min.js:1
    i http://localhost:8888/d3/d3.v3.min.js:1
    Cn http://localhost:8888/d3/d3.v3.min.js:1
    json http://localhost:8888/d3/d3.v3.min.js:5
    <anonymous> http://localhost:8888/script.js:43
d3.v3.min.js:4:23546

This is happens when running c/show-knowledge-graph on Debian Unstable with Python 3.9 and Emacs 27.1. Other commands have similar results.

from code-compass.

BlankSpruce avatar BlankSpruce commented on August 10, 2024 1

The closest I could get to reproducing this problem was when I removed code-maat from the system:
image

Steps:

  1. Build the following Dockerfile:
FROM debian:unstable

RUN \
        apt update \
        && apt install -y emacs git python3 cloc \
        && cd ~ \
        && git clone https://github.com/ag91/code-compass

ENTRYPOINT ["/usr/bin/emacs"]

2a) Inside dockerized emacs install all the elisp dependencies of code-compass (minimal setup example is helpful).

docker build -t code-compass-reproduce-issue .
docker run -v /tmp/:/tmp/ -it code-compass-reproduce-issue

2b) As a cheat step you can use .emacs.d from the host but you have to open dockerized emacs like so:

docker run -v /tmp/:/tmp/ -v ~/.emacs.d/:/root/.emacs.d/ -it code-compass-reproduce-issue
  1. Invoke c/show-knowledge-graph on code-compass itself (since it's available inside the image).
  2. Open produced /tmp/code-compass-code-compass/zoomable.html.

Since inside the image there is no code-maat main-dev.csv file is empty which then leads to this error:

$ python3 knowledge_csv_as_enclosure_diagram.py --structure cloc.csv --owners main-dev.csv --authors authors.csv
Traceback (most recent call last):
  File "/tmp/code-compass-code-compass/knowledge_csv_as_enclosure_diagram.py", line 183, in <module>
    run(args)
  File "/tmp/code-compass-code-compass/knowledge_csv_as_enclosure_diagram.py", line 166, in run
    module_ownership = parse_csv(args.owners,
  File "/tmp/code-compass-code-compass/knowledge_csv_as_enclosure_diagram.py", line 40, in parse_csv
    heading = read_heading_from(r)
  File "/tmp/code-compass-code-compass/knowledge_csv_as_enclosure_diagram.py", line 34, in read_heading_from
    p = next(r)
StopIteration

@davidkrauser
Double check if you have code-maat installed. Given that c/code-maat-command by default is set to dockerized code-maat you should see something like this:

$ docker run -it code-maat-app --help   
This is Code Maat, a program used to collect statistics from a VCS.
Version: 1.0-SNAPSHOT

[...rest of the output...]

If code-maat is available please confirm if /tmp/code-compass-<your-project>/main-dev.csv is empty.

from code-compass.

ag91 avatar ag91 commented on August 10, 2024

Thanks for trying it out! Does this happen for all repositories you try it on? What browser are you using? Do you have a repository online so I can reproduce?
Also, if you can check that there are 6 lines in /tmp/your-repo/d3/d3.min.js starting for !function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNa, that would help discard that the d3 minified library is exported wrongly.

from code-compass.

furious-luke avatar furious-luke commented on August 10, 2024

Yep, that resolves the issue. Thanks @BlankSpruce, much appreciated!

from code-compass.

ag91 avatar ag91 commented on August 10, 2024

I will try to reproduce asap. At the moment I do not have 3.9 yet, so could you run the failing analysis (knowledge for example) and then move to /tmp/code-compass- and run python3 knowledge_csv_as_enclosure_diagram.py --structure cloc.csv --owners main-dev.csv --authors authors.csv?
It would help me to know if you see a result or not that looks like json (I do not need the output because it contains data about your repository that you may not want to share).

from code-compass.

davidkrauser avatar davidkrauser commented on August 10, 2024

@BlankSpruce that was the issue - code-maat was installed but emacs had permissions issues interacting with docker. Thank you, everything appears to be working as expected now. Strange that this manifested in almost the same way as an unrelated issue. /cc @ag91

from code-compass.

ag91 avatar ag91 commented on August 10, 2024

great way to reproduce @BlankSpruce: smart idea to use Docker!
@davidkrauser would you mind to share here how you fixed the permission issue (in case somebody else struggles with it later)?

from code-compass.

davidkrauser avatar davidkrauser commented on August 10, 2024

@ag91 absolutely - I added myself to the docker group (sudo usermod -aG docker $USER), but I didn't log out/log in to get that to stick in all environments. I used newgrp docker in my terminal to ensure code-maat worked in the terminal. Unfortunately, Emacs (and the subprocesses it spawned) didn't recognize that I had been added to the docker group. Logging out and logging back in fixed my problem.

from code-compass.

ag91 avatar ag91 commented on August 10, 2024

from code-compass.

mattford63 avatar mattford63 commented on August 10, 2024

You end up with this error message if you don't satisfy any of the dependencies required - in my case it was cloc. Perhaps a do we meet requirements function would help solve this?

from code-compass.

ag91 avatar ag91 commented on August 10, 2024

Thanks @mattford63 for reminding me: I was planning to write a c/doctor from a while: I have now added it. Sorry for your waste of time, I should have spent a few minutes on this earlier on. Added it now: better later than never.

from code-compass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.