pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: using binary Rust on Solaris



Hello!

Thanks. I have far to less knowledge about pkgsrc to fully integrate this, but for anyone interested:

I installed rustc and cargo from Solaris IPS:

$ pkg install rustc

$ pkg info rustc
             Name: developer/rust/rustc
          Summary: Rust compiler
         Category: Development/Other Languages
            State: Installed
        Publisher: solaris
          Version: 1.61.0
           Branch: 11.4.57.0.1.144.2
   Packaging Date: Wed May 17 15:24:30 2023
Last Install Time: Fri Jul  7 14:07:31 2023
             Size: 983.33 MB
FMRI: pkg://solaris/developer/rust/rustc@1.61.0-11.4.57.0.1.144.2:20230517T152430Z
      Project URL: http://www.rust-lang.org/
Source URL: https://static.rust-lang.org/dist/rustc-1.61.0-src.tar.xz


$ pkg install cargo

$ pkg info cargo
             Name: developer/rust/cargo
          Summary: Rust package manager
         Category: Development/Other Languages
            State: Installed
        Publisher: solaris
          Version: 1.61.0
           Branch: 11.4.57.0.1.144.2
   Packaging Date: Wed May 17 15:23:28 2023
Last Install Time: Mon Jul 10 06:35:48 2023
             Size: 47.52 MB
FMRI: pkg://solaris/developer/rust/cargo@1.61.0-11.4.57.0.1.144.2:20230517T152328Z
      Project URL: http://www.rust-lang.org/
Source URL: https://static.rust-lang.org/dist/rustc-1.61.0-src.tar.xz


and because I know no better way to fake the presence of a working rust/cargo, I commented it out in security/py-cryptography/Makefile

-.include "../../lang/rust/cargo.mk"
+#.include "../../lang/rust/cargo.mk"

and had to allow network access

-MAKE_ENV+=     CARGO_NET_OFFLINE=true
+#MAKE_ENV+=    CARGO_NET_OFFLINE=true

With these changes security/py-cryptography did build for me, and the subsequent build of sysutils/ansible-core also succeeded. Both ansible-playbook with SSH connections to remote hosts and ansible-vault work, so I guess security/py-cryptography is doing its job.


graphics/libimagequant on the other hand is one of those packages that demands Rust 1.63 and refuses to build at the moment.

Joern


Am 07.07.2023 um 19:12 schrieb Greg Troxel:
"Clausen, Jörn" <joern.clausen%uni-bielefeld.de@localhost> writes:

Hello!

I'd like to build a current ansible-core on Solaris 11, which requires
py-cryptography, wich requires Rust.

In order to avoid the hustle of building lang/rust, I decided to
install rustc via Oracle IPS. I then defined

PREFER_NATIVE =              rust-bin
RUST_TYPE =                  bin

RUST_TYPE=bin says to use rust-bin

The first line doesn't do anything.

But building security/py-cryptography still tries to build
lang/rust-bin, which then fails. How do I convince pkgsrc to use the
native Rust compiler?

Write and debug a builtin.mk that looks for and qualifies as native rust
and arranges to use that instead.  This is analogous to how every other
native thing is used instead of the pkgsrc version when good enough.

As I understand it, people generally think this would be ok, but also
that it is a lot of work and so far nobody has taken the time to do it.

The wrinkle is that rust is an unstable family of languages and it seems
that code  has to be written to a specific version.  Or rather that
while most code can handle a range, using an older version could be
trouble, and a newer one could too.

But, it's probably ok to look at the version-required variable and
accept the native one if it's >=, hope for the best, and fix whatever
needs fixing.  That is the usual approach for checking native.

--
Jörn Clausen
Plattformen & Serverdienste
BITS - Bielefelder IT-Servicezentrum
https://www.uni-bielefeld.de/bits


Home | Main Index | Thread Index | Old Index