Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

linter-rust + Cargo = Error #15

Closed
azerupi opened this issue Jun 7, 2015 · 6 comments
Closed

linter-rust + Cargo = Error #15

azerupi opened this issue Jun 7, 2015 · 6 comments

Comments

@azerupi
Copy link

azerupi commented Jun 7, 2015

This plug-in produces an error when using Cargo to compile.

See this issue I made in the Cargo repo: rust-lang/cargo#1669

@colin-kiegel
Copy link
Contributor

I also get these random concurrency issue.

steps

  • atom > packages 'build' + 'linter-rust'
  • edit some files
  • compile via 'build' package causes simultaneous save of all modified project files

I suspect tat linter-rust runs cargo once per file save, limited by the number of jobs specified in the settings of linter-rust (default: 2). This gives 3 cargo-runs in parallel.

Not good since:

rust-lang/cargo#354 Concurrent usage of cargo will generally result in badness

  1. The best way to solve it, would be upstream cargo - but it's been open for months. Could take long.
  2. One could use a different workflow - i.e. don't use 'build' with 'auto-save on build' and set parallel jobs in linter-rust to 1. Then 'save all', wait sufficiently until linter-rust is done, and then 'build'. Not very nice.
  3. So what could we do in atom? Does it make sense for the linter (meta-package) and build to communicate with each other and try to avoid parallel activity? Not so good either.
  4. Or could the linter use a shadow-directory structure all-together and let cargo work with something like a duplicate set of temporary files than build? I don't know if that is feasable - but it would be my favourite.

@colin-kiegel
Copy link
Contributor

I have written a tiny wrapper script for cargo on linux that waits for all previous processes to finish - to avoid the concurrency issues. :-)

This should do the job - until cargo implements its own locking-mechanism. Of course it's a workaround - and nothing to be included in linter-rust - but anyone with that issue could use it in the meantime.

@gmist
Copy link
Member

gmist commented Jul 17, 2015

An interesting idea but not cross-platform... I think that PR712 will help solve this problem.

@colin-kiegel
Copy link
Contributor

You are right, the wrapper is not cross-platform. Still I think it's good to have different approaches until this is fixed in upstream cargo. :-)

@Arcanemagus
Copy link
Member

@colin-kiegel Your 4. solution above would be relatively simple to implement using the tempFile method from https://github.com/AtomLinter/atom-linter 😉.

@azerupi
Copy link
Author

azerupi commented Apr 29, 2016

This hasn't happened to me in a while, I think it has been fixed in Cargo? If it has this issue can be closed :)

@azerupi azerupi closed this as completed Apr 29, 2016
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

4 participants