Opened 21 months ago

Closed 8 months ago

#58034 closed enhancement (fixed)

Current rust not usable with IDE plugins - missing stuff

Reported by: mouse07410 (Mouse) Owned by: g5pw (Aljaž Srebrnič)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: Dave-Allured (Dave Allured)
Port: rust

Description

The current port (1.32.0) does not include rust std library, nor the mechanisms to automatically download it. This makes it impossible to use rustc and other rust-related ports with an IDE plugin, such as IntelliJ-rust for IntelliJ IDEA (or CLion).

It would be nice if this port would be self-contained.

Also, it seems to depend on llvm-6.0. It would be nice if it could at least depend on llvm-7.0 (how many llvm's do I need to keep installed on my machine?).

Thanks!

Change History (9)

comment:1 Changed 21 months ago by jmroot (Joshua Root)

Cc: g5pw@… removed
Owner: set to g5pw
Status: newassigned

comment:2 Changed 21 months ago by g5pw (Aljaž Srebrnič)

I'm assuming you mean the rust std library source code, (the binary version is included in the compiler). You can install that using port install rust-src, and that should work. I'll make some tests with llvm 7 and see how it goes, if it works correctly we can use that.

In the future, I could add some notes explaining what is needed to use rust in an IDE.

comment:3 Changed 21 months ago by mouse07410 (Mouse)

I'm assuming you mean the rust std library source code

Unfortunately, I'm a beginner in rust - so cannot validate your assumption. Probably you are right.

I'll make some tests with llvm 7 and see how it goes, if it works correctly we can use that

Yes please. Also, as I'm a beginner with Macports too, I don't know if the following is possible:

  • set the lowest acceptable version of LLVM
  • configure the rust port to use whatever LLVM is installed as long as it's not older than the lowest allowed
  • if no LLVM is installed - install the latest available (IMHO, the likelihood that it would break rust is low, but if it does and users report that - you can always place high-version restriction; I just don't want that restriction in place until and unless it's proven necessary)

In the future, I could add some notes explaining what is needed to use rust in an IDE.

YES PLEASE! Also, IntelliJ IDEA https://www.jetbrains.com/idea/download/?utm_source=product&utm_medium=link&utm_campaign=IU&utm_content=2018.2#section=mac has a free Community Edition. You can try downloading it, installing Rust plugin, and see for yourself what works and what doesn't - and then document how to go about using it with the Rust ports.

Thanks again!

comment:4 Changed 21 months ago by g5pw (Aljaž Srebrnič)

Yes please. Also, as I'm a beginner with Macports too, I don't know if the following is possible:

  • set the lowest acceptable version of LLVM
  • configure the rust port to use whatever LLVM is installed as long as it's not older than the lowest allowed
  • if no LLVM is installed - install the latest available (IMHO, the likelihood that it would break rust is low, but if it does and users report that - you can always place high-version restriction; I just don't want that restriction in place until and unless it's proven necessary)

We usually strive to have reproducible builds, and that also means that dependencies should be fixed and not generated based on what's available. I can say that the rust build with LLVM 7 compiled correctly :) if that works well, I'll switch the port over to LLVM7

YES PLEASE! Also, IntelliJ IDEA ​https://www.jetbrains.com/idea/download/?utm_source=product&utm_medium=link&utm_campaign=IU&utm_content=2018.2#section=mac has a free Community Edition. You can try downloading it, installing Rust plugin, and see for yourself what works and what doesn't - and then document how to go about using it with the Rust ports.

Yep, that's what I also use (with rust-src installed)

comment:5 Changed 21 months ago by mouse07410 (Mouse)

Yep, that's what I also use (with rust-src installed)

Could you describe how you configured the IDEA plugin? I.e., what directories/files did you point Toolchain Location and Standard Library?

Last edited 21 months ago by mouse07410 (Mouse) (previous) (diff)

comment:6 Changed 21 months ago by g5pw (Aljaž Srebrnič)

Could you describe how you configured the IDEA plugin? I.e., what directories/files did you point Toolchain Location and Standard Library?

Sure! Toolchain location is /opt/local/bin, standard library is /opt/local/share/rust/src.

comment:7 Changed 21 months ago by mouse07410 (Mouse)

Thank you! Perfect.

comment:8 Changed 20 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:9 Changed 8 months ago by g5pw (Aljaž Srebrnič)

Resolution: fixed
Status: assignedclosed

We are currently building with LLVM 9, so I'm closing this as fixed.

Note: See TracTickets for help on using tickets.