You are here

Feed aggregator

Meet people behind Illumos, OpenIndiana, OmniOS at @FOSDEM on Feb 3rd + 4th

SFE Articles - Fri, 02/02/2018 - 16:54

On the road to @FOSDEM Brussels!

If you like @OpenZFS, @Illumos, @OpenIndiana, @OmniOS or @opensolaris, or this extra packages project @sfepackages, then drop by the @illumos booth and have a nice chat with people actively working on these projects!

Just drop by and say "hi". You'll be surprised!

Looking forward to meet you,
Thomas

(Well, if there are Illumos T-Shirts available this year? Find out!)

Tags: FosdemboothIllumosOpenIndianaHipsterOpenSolarissfepackages
Categories: SFE

How to install LibreOffice 4.x or 5.x on Solaris OS

SFE Articles - Wed, 01/31/2018 - 19:18

To install LibreOffice on Solaris x64 platform you have to add software repository to your system and then install LibreOffice. OpenIndiana users may need the workaround mentioned here: http://sfe.opencsw.org/workbench-2017-01 and replace every "s11" with "oih".

For Solaris 11.x:
To register a new repository you have to execute as a power user this command:
pkg set-publisher -G '*' -g http://sfe.opencsw.org/localhosts11 localhosts11

For Solaris 11.4 beta (was: Solaris 12 in development (*))
To register a new repository you have to execute as a power user this command:
pkg set-publisher -G '*' -g http://sfe.opencsw.org/localhosts12 localhosts12

When your repository is ready you can install LibreOffice,
LibreOffice 4.4.x comes in 2 packages: libreoffice4 libreoffice4-desktop-int
LibreOffice 5.2.x comes in 2 packages: libreoffice52 libreoffice52-desktop-int

Choose the version you would like to install and then run command

For LibreOffice 5.2.x you have to execute:
pkg install -v libreoffice52 libreoffice52-desktop-int

For LibreOffice 4.4.x you have to execute:
pkg install -v libreoffice4 libreoffice4-desktop-int

During the installation pkg will install all necessary libraries and other packages.

Here is a complete example how LibreOffice 5.2 was installed on Solaris 11.3 desktop:
pkg install -v libreoffice52 libreoffice52-desktop-int
Packages to install: 6
Mediators to change: 1
Services to change: 2
Estimated space available: 934.34 GB
Estimated space to be consumed: 1.68 GB
Create boot environment: No
Create backup boot environment: No
Rebuild boot archive: No

Changed mediators:
mediator libreoffice:
version: None -> 5.2 (system default)

Changed packages:
localhosts11
desktop/application/libreoffice52
None -> 5.2.3.3,5.11-0.0.175.3.1.0.5.0:20170103T191502Z
desktop/application/libreoffice52-desktop-int
None -> 5.2.3.3,5.11-0.0.175.3.1.0.5.0:20170103T192726Z
sfe/library/g++/libcdr
None -> 0.1.3,5.11-0.0.175.3.1.0.5.0:20161224T143401Z
sfe/library/g++/libixion-011
None -> 0.11.1,5.11-0.0.175.3.1.0.5.0:20161224T135901Z
sfe/library/g++/liborcus-011
None -> 0.11.2,5.11-0.0.175.3.1.0.5.0:20161224T142803Z
sfe/library/mdds-12
None -> 1.2.2,5.11-0.0.175.3.1.0.5.0:20161224T135236Z

Services:
restart_fmri:
svc:/application/desktop-cache/desktop-mime-cache:default
svc:/application/desktop-cache/mime-types-cache:default

DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 6/6 14652/14652 258.9/258.9 1.8M/s

PHASE ITEMS
Installing new actions 15387/15387
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Reading search index Done
Updating search index 6/6
Updating package cache 5/5

If the installation process fails because of the network issues
DOWNLOAD PKGS FILES XFER (MB) SPEED
desktop/application/libreoffice52 0/6 10865/14652 211.0/258.9 151k/s

Errors were encountered while attempting to retrieve package or file data for
the requested operation.
Details follow:
http protocol error: code: 500 reason: Internal Server Error
URL: 'http://sfe.opencsw.org/localhosts11/file/1/83755365f1790a7413e5523b6b0a64123d5b8c5a'

then you have to re-run the command and it will continue from where it stopped.

When LibreOffice is installed you can start it either from your desktop launch menu Applications -> Office -> LibreOffice 5.2 or you can start it as /usr/lib/libreoffice5.2/program/soffice from your terminal window.

You can check for the latest updates by executing these commands:
pkg refresh
pkg update -nv

If there are updates available:
pkg update -nv
Packages to update: 2
Services to change: 1
Estimated space available: 934.00 GB
Estimated space to be consumed: 816.26 MB
Create boot environment: No
Create backup boot environment: Yes
Rebuild boot archive: No

Changed packages:
localhosts11
desktop/application/libreoffice52
5.2.3.3,5.11-0.0.175.3.1.0.5.0:20170103T191502Z -> 5.2.4.2,5.11-0.0.175.3.1.0.5.0:20170107T191831Z
desktop/application/libreoffice52-desktop-int
5.2.3.3,5.11-0.0.175.3.1.0.5.0:20170103T192726Z -> 5.2.4.2,5.11-0.0.175.3.1.0.5.0:20170107T192237Z

Services:
restart_fmri:
svc:/application/desktop-cache/mime-types-cache:default

then you can install the updated version
pkg update -v
Packages to update: 2
Services to change: 1
Estimated space available: 933.68 GB
Estimated space to be consumed: 816.26 MB
Create boot environment: No
Create backup boot environment: Yes
Rebuild boot archive: No

Changed packages:
localhosts11
desktop/application/libreoffice52
5.2.3.3,5.11-0.0.175.3.1.0.5.0:20170103T191502Z -> 5.2.4.2,5.11-0.0.175.3.1.0.5.0:20170107T191831Z
desktop/application/libreoffice52-desktop-int
5.2.3.3,5.11-0.0.175.3.1.0.5.0:20170103T192726Z -> 5.2.4.2,5.11-0.0.175.3.1.0.5.0:20170107T192237Z

Services:
restart_fmri:
svc:/application/desktop-cache/mime-types-cache:default

DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 2/2 3544/3544 100.5/100.5 4.8M/s

PHASE ITEMS
Installing new actions 95/95
Updating modified actions 3456/3456
Updating package state database Done
Updating package cache 2/2
Updating image state Done
Creating fast lookup database Done
Reading search index Done
Updating search index 2/2
Updating package cache 5/5

---------------------------------------------------------------------------
NOTE: Please review release notes posted at:
https://support.oracle.com/rs?type=doc&id=2045311.1
---------------------------------------------------------------------------

Please visit http://sfe.opencsw.org/quickrepolinks for more information about other repositories

(*) Solaris 12 is not released yet and LibreOffice might not be production ready for this OS.
Use it with caution.
Note: Solaris is a Trademark of Oracle. "Solaris 12" is just a working title and if you google a bit around, you'll see that the Solaris Release model has change to a continuos mode, what is indeed a very good idea in my personal view (tomww). So next we might see new cool features under the name Solaris 11.4 instead of the name Solaris 12.

Originally posted 20170109
Edit: 20170205 add link to OpenIndiana workaround (tomww)
Edit: 20170207 add hint to replace "s11" with "oih" for OpenIndana Hipster. (tomww)
Edit: 20170403 Add Note about the working title "Solaris 12" (tomww)
Edit: 20180131 add new Name: Solaris 11.4 beta (tomww)

Tags: libreofficeSolarisOpenIndianaHipster
Categories: SFE

Rust Pointers for C Programmers

Josef Sipek - Sun, 01/28/2018 - 17:47

I’ve been eyeing Rust for about a year now. Here and there, I tried to use it to make a silly little program, or to implement some simple function in it to see for myself how ergonomic it really was, and what sort of machine code rustc spit out. But last weekend I found a need for a tool to clean up some preprocessor mess, and so instead of hacking together some combination of shell and Python, I decided to write it in Rust.

From my earlier attempts, I knew that there are a lot of different “pointers” but I found all the descriptions of them lacking or confusing. Specifically, Rust calls itself a systems programming language, yet I found no clear description of how the different pointers map to C—the systems programming language. Eventually, I stumbled across The Periodic Table of Rust Types, which made things a bit clearer, but I still didn’t feel like I truly understood.

During my weekend expedition to Rust land, I think I’ve grokked things enough to write this explanation of how Rust does things. As always, feedback is welcomed.

I’ll describe what happens in terms of C. To keep things simple, I will:

  • assume that you are well-versed in C
  • assume that you can read Rust (any intro will teach you enough)
  • not bother with const for the C snippets
  • not talk about mutability

In the following text, I assume that we have some struct T. The actual contents don’t matter. In other words:

struct T { /* some members */ };

With that out of the way, let’s dive in!

*const T and *mut T

These are raw pointers. In general, you shouldn’t use them since only unsafe code can dereference them, and the whole point of Rust is to write as much safe code as possible.

Raw pointers are just like what you have in C. If you make a pointer, you end up using sizeof(struct T *) bytes for the pointer. In other words:

struct T *ptr;

&T and &mut T

These are borrowed references. They use the same amount of space as raw pointers and behave same exact way in the generated machine code. Consider this trivial example:

#[no_mangle] pub fn raw(p: *mut usize) { unsafe { *p = 5; } } #[no_mangle] pub fn safe(p: &mut usize) { *p = 5; }

A rustc invocation later, we have:

raw() raw: 55 pushq %rbp raw+0x1: 48 89 e5 movq %rsp,%rbp raw+0x4: 48 c7 07 05 00 00 movq $0x5,(%rdi) 00 raw+0xb: 5d popq %rbp raw+0xc: c3 ret safe() safe: 55 pushq %rbp safe+0x1: 48 89 e5 movq %rsp,%rbp safe+0x4: 48 c7 07 05 00 00 movq $0x5,(%rdi) 00 safe+0xb: 5d popq %rbp safe+0xc: c3 ret

Note that the two functions are bit-for-bit identical.

The only differences between borrowed references and raw pointers are:

  1. references will never point at bogus addresses (i.e., they are never NULL or uninitialized),
  2. the compiler doesn’t let you do arbitrary pointer arithmetic on references,
  3. the borrow checker will make you question your life choices for a while.

(#3 gets better over time.)

Box<T>

These are owned “pointers”. If you are a C++ programmer, you are already familiar with them. Never having truly worked with C++, I had to think about this a bit until it clicked, but it is really easy.

No matter what all the documentation and tutorials out there say, Box<T> is not a pointer but rather a structure containing a pointer to heap allocated memory just big enough to hold T. The heap allocation and freeing is handled automatically. (Allocation is done in the Box::new function, while freeing is done via the Drop trait, but that’s not relevant as far as the memory layout is concerned.) In other words, Box<T> is something like:

struct box_of_T { struct T *heap_ptr; };

Then, when you make a new box you end up putting only what amounts to sizeof(struct T *) on the stack and it magically starts pointing to somewhere on the heap. In other words, the Rust code like this:

let x = Box::new(T { ... });

is roughly equivalent to:

struct box_of_t x; x.heap_ptr = malloc(sizeof(struct T)); if (!x.heap_ptr) oom(); *x.heap_ptr = ...;

&[T] and &mut [T]

These are borrowed slices. This is where things get interesting. Even though it looks like they are just references (which, as stated earlier, translates into a simple C-style pointer), they are much more. These types of references use fat pointers—that is, a combination of a pointer and a length.

struct fat_pointer_to_T { struct T *ptr; size_t nelem; };

This is incredibly powerful, since it allows bounds checking at runtime and getting a subset of a slice is essentially free!

&[T; n] and &mut [T; n]

These are borrowed references to arrays. They are different from borrowed slices. Since the length of an array is a compile-time constant (the compiler will yell at you if n is not a constant), all the bounds checking can be performed statically. And therefore there is no need to pass around the length in a fat pointer. So, they are passed around as plain ol’ pointers.

struct T *ptr;

T, [T; n], and [T]

While these aren’t pointers, I thought I’d include them here for completeness’s sake.

T

Just like in C, a struct uses as much space as its type requires (i.e., sum of the sizes of its members plus padding).

[T; n]

Just like in C, an array of structs uses n times the size of the struct.

[T]

The simple answer here is that you cannot make a [T]. That actually makes perfect sense when you consider what that type means. It is saying that we have some variable sized slice of memory that we want to access as elements of type T. Since this is variable sized, the compiler cannot possibly reserve space for it at compile time and so we get a compiler error.

The more complicated answer involves the Sized trait, which I’ve skillfully managed to avoid thus far and so you are on your own.

Summary

That was a lot of text, so I decided to compact it and make the following table. In the table, I assume that our T struct is 100 bytes in size. In other words:

/* Rust */ struct T { stuff: [u8; 100], } /* C */ struct T { uint8_t stuff[100]; };

Now, the table in its full glory:

Rust C Size on
ILP32/LP64
(bytes) Value let x: T; struct T x; 100/100 Raw pointer let x: *const T; let x: *mut T; struct T *x; 4/8 Reference let x: &T; let x: &mut T; struct T *x; 4/8 Box let x: Box<T>; struct box_of_T { struct T *heap_ptr; }; struct box_of_T x; 4/8 Array of 2 let x: [T; 2]; struct T x[2]; 200/200 Reference to
an array of 2 let x: &[T; 2]; struct T *x; 4/8 A slice let x: [T]; struct T x[]; unknown at
compile time A reference
to a slice let x: &[T]; struct fat_ptr_to_T { struct T *ptr; size_t nelem; }; struct fat_ptr_to_T x; 8/16

A word of caution: I assume that the sizes of the various pointers are actually implementation details and shouldn’t be relied on to be that way. (Well, with the exception of raw pointers - without those being fixed FFI would be unnecessarily complicated.)

I didn’t cover str, &str, String, and Vec<T> since I don’t consider them fundamental types, but rather convenience types built on top of slices, structs, references, and boxes.

Anyway, I hope you found this useful. If you have any feedback (good or bad), let me know.

clamav: update to 0.99.3, fix runpath

github/OpenIndiana/oi-userland - Fri, 01/26/2018 - 21:46
clamav: update to 0.99.3, fix runpath
Categories: oi-userland

pcre: avoid embedding RPATH in pcre and dependent objects

github/OpenIndiana/oi-userland - Fri, 01/26/2018 - 18:49
pcre: avoid embedding RPATH in pcre and dependent objects
Categories: oi-userland

libtasn1: fix CVE-2017-10790, CVE-2018-6003

github/OpenIndiana/oi-userland - Fri, 01/26/2018 - 07:49
libtasn1: fix CVE-2017-10790, CVE-2018-6003
Categories: oi-userland

coreutils: cp -a fails on /tmp

github/OpenIndiana/oi-userland - Fri, 01/26/2018 - 00:33
coreutils: cp -a fails on /tmp
Categories: oi-userland

guilt: update to 0.36

github/OpenIndiana/oi-userland - Thu, 01/25/2018 - 15:59
guilt: update to 0.36
Categories: oi-userland

firefox: update to 52.6.0esr

github/OpenIndiana/oi-userland - Thu, 01/25/2018 - 13:32
firefox: update to 52.6.0esr
Categories: oi-userland

trousers: fix gcc-6 build

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 10:41
trousers: fix gcc-6 build
Categories: oi-userland

Fix mongodb-34 REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix mongodb-34 REQUIRED_PACKAGES
Categories: oi-userland

Fix mongodb-33 REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix mongodb-33 REQUIRED_PACKAGES
Categories: oi-userland

Fix ant REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix ant REQUIRED_PACKAGES
Categories: oi-userland

Fix ospm REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix ospm REQUIRED_PACKAGES
Categories: oi-userland

Fix gucharmap REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix gucharmap REQUIRED_PACKAGES
Categories: oi-userland

Fix gnome-utils REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix gnome-utils REQUIRED_PACKAGES
Categories: oi-userland

Fix gnome-netstatus REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix gnome-netstatus REQUIRED_PACKAGES
Categories: oi-userland

Fix gnome-nettool REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix gnome-nettool REQUIRED_PACKAGES
Categories: oi-userland

Fix gnome-commander REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix gnome-commander REQUIRED_PACKAGES
Categories: oi-userland

Fix avant-window-navigator REQUIRED_PACKAGES

github/OpenIndiana/oi-userland - Wed, 01/24/2018 - 08:31
Fix avant-window-navigator REQUIRED_PACKAGES
Categories: oi-userland

Pages

Subscribe to OpenIndiana Ninja aggregator