Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

TockOS subproject errors #1057

Open
dc740 opened this issue Sep 19, 2018 · 3 comments
Open

TockOS subproject errors #1057

dc740 opened this issue Sep 19, 2018 · 3 comments

Comments

@dc740
Copy link

dc740 commented Sep 19, 2018

I'm trying to import Tock OS into eclipse, and I keep getting an error when I open a rust file.

LSP (org.eclipse.corrosion.RLS)
Error reading manifest path: Error message { msg: "could not find Cargo.toml in or any parent directory"}

TockOS is an embedded operative system written in Rust. The project organization is a little odd: it is written with a Makefile at the top of the project. This Makefile actually handles calling cargo in the different parts of the operative system. Each chip or board has his own cargo project, and every time I try to open a rust file, I get the message listed above, because the Cargo.toml file is not present at the root of the project.
I have to import Tock using "Existing code as a Makefile project", since there isn't any main Cargo.toml file at the root of the project. It's only a Makefile, and the cargo files are inside the different parts of the project. The thing is: the different parts of the project do NOT compile independently unless you set some variables that are generated inside the Makefile, so you can't import them as independent project separately.

Is there any way to workaround this? Right now I don't have any choice, so I had to completely disable RLS. Thank you

@Xanewok
Copy link
Member

Xanewok commented Sep 19, 2018

At the moment RLS only works with and expects a Cargo project (which means it has to have a Cargo.toml and whatnot).

As of now, the RLS needs to consume "save-analysis" files (generated by rustc ... -Zunstable-options -Zsave-analysis for each rustc call) in order to work. As a quick workaround, you can use the external build plan (#988) option. It's not ideal (e.g. doesn't support diagnostics) but if you could execute the build you're interested in yourself, generate the appropriate save-analysis files (needs nightly) and point the RLS to them (more info at #988) you would still get go to definition, find references and all the IDE features.

Other than that it's not possible; however I'm currently working on integration with more build systems so hopefully this can extend to supporting Tock OS as well.

@dc740
Copy link
Author

dc740 commented Jan 5, 2019

I reopened a bug in the eclipse plugin project to keep track of the build_command support.
eclipse-corrosion/corrosion#135 (comment)

About integrating new build systems, is there a ticket or branch where I could track this progress?

Thank you

@Xanewok
Copy link
Member

Xanewok commented Mar 3, 2019

Unfortunately I don't think so, the closest we have is #401

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

No branches or pull requests

2 participants