github / semantic

Parsing, analyzing, and comparing source code across many languages
8.94k stars 454 forks source link

AST.dyn_o file is missing for Python #604

Closed ch3rn0v closed 4 years ago

ch3rn0v commented 4 years ago

Hi. When I try to cabal new-build all it says:

gcc: error: ***/semantic/dist-newstyle/build/x86_64-linux/ghc-8.8.3/semantic-python-0.0.0.0/build/Language/Python/AST.dyn_o: No such file or directory
`gcc' failed in phase `Linker'. (Exit code: 1)

Which results in failure. All the directories mentioned in the path do exist, only the file itself is absent. As a workaround, I simply created an empty one, as I do not intend to parse Python right now. But it looks like this might be an issue for those who does.

patrickt commented 4 years ago

Are you running Arch Linux, by chance? If not, have you installed your cabal and ghc through your system package manager?

ch3rn0v commented 4 years ago

Nope, I'm using Ubuntu 19.

If not, have you installed your cabal and ghc through your system package manager?

Re cabal - yes, I did. And I installed ghc according to the advice laid out here.

However, I did not reboot the system since and manually updated the paths (in the same terminal where I then built semantic). Could this be the reason?

patrickt commented 4 years ago

Hmm. Try exiting the shell, as you suggested; also perhaps try a cabal build in case the cache is corrupted. The fact that it’s looking for dyn_o files seems to indicate that it’s being compiled with -dynamic, which is not what you want; I’m baffled as to why it would do this. Does running which ghc and which cabal point to items in ~/.ghcup?

If you continue running into problems, you could give the Bazel build a shot.

ch3rn0v commented 4 years ago

it’s being compiled with -dynamic, which is not what you want

Nope, I did not specify this flag.

Try exiting the shell, as you suggested; also perhaps try a cabal build in case the cache is corrupted

I removed the whole directory, downloaded it afresh and built again with cabal v2-build all -j1 (apparently 32 Gb RAM isn't enough for a multi-threaded build process). This worked properly, thank you!