We have moved to a new Sailfish OS Forum. Please start new discussions there.
5

SDK user shouldn't use developer's dotfiles [released]

asked 2013-12-25 20:31:56 +0300

TuukkaH gravatar image

Currently, the SDK virtual machine used for builds has the developer's real home directory set as the home directory in the virtual machine as well. This causes the SDK to use the developer's dotfiles, which can lead into various issues as they typically aren't designed to be shared between systems:

  1. .profile and .bashrc can fail or mess up the environment in the virtual machine if they refer to software that only exist in the host machine (or exist in incompatible versions), such as python virtualenvwrapper or git prompt for bash.

  2. .bash_history will include entries that only make sense in either the host machine or the virtual machine.

  3. ... [who knows what else]

edit retag flag offensive reopen delete

The question has been closed for the following reason "released in a software update" by kaltsi
close date 2014-08-19 16:46:21.788152

Comments

Among other things, it also uses your home's .scatchbox2 folder, effectively destroying your existing Scratchbox2 configuration.

javispedro ( 2014-01-10 23:25:37 +0300 )edit

Aaand it does lots of IO to ~/rpmbuild everytime (despite the fact I have a custom _topdir), which is on a SSD, instead of on my %_topdir, which is not.

javispedro ( 2014-01-11 18:50:00 +0300 )edit

3 Answers

Sort by » oldest newest most voted
2

answered 2014-01-02 16:31:10 +0300

kaltsi gravatar image

The bash we use in the SDK virtual machine is built with an option to source the user's .bashrc even when the session is non-interactive. This can cause failures if the user's .bashrc does not include a non-interactive session check.

A workaround you can use at this time is to add the following to the top of your .bashrc:

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

It's possible that we will change this behavior of bash regarding the dotfiles in non-interactive sessions, but I can't say when that would take place.

Modifying the home mount like described in pcfe's reply is possible, but unsupported and not tested.

edit flag offensive delete publish link more
2

answered 2014-04-13 15:38:11 +0300

kaltsi gravatar image

updated 2014-04-18 00:03:13 +0300

This behavior has been changed in the upcoming SDK update. The MerSDK virtual machine no longer directly uses your home directory as its home directory.

Previously your home directory was mounted as the home directory for the user mersdk inside the virtual machine. Now mersdk gets a real home directory of its own and your home dir is mounted as /home/mersdk/share inside the virtual machine.

edit: this change is included in SDK 1404, released Apr 16th.

edit flag offensive delete publish link more

Comments

By the way, SDKMainteinanceTool _still_ decided to delete my .scratchbox2 folder . I suspect this is because the tool still believes it installed the file, and that on next uninstallations/updates it won't do that. Will see...

javispedro ( 2014-05-02 00:52:32 +0300 )edit
1

answered 2013-12-25 20:57:23 +0300

pcfe gravatar image

This should do it. But I agree that it would be nice if the SDK used a subdirectory by default

  1. make separate directories (this is in addition to the SailfishOS directory)

    [user@host ~]$ cd $HOME

    [user@host ~]$ mkdir -p Sailfish/home Sailfish/src

  2. launch virtualbox from the menu or the commandline

  3. Change two of the 5 shared folders of the virtual machine MerSDK

    home and src, to the ones created above.

edit flag offensive delete publish link more

Question tools

Follow
2 followers

Stats

Asked: 2013-12-25 20:31:56 +0300

Seen: 308 times

Last updated: Apr 18 '14