Languages

Menu
Sites
Language
Poor SDK Code Quality

While playing with the SDK I noticed some realy bad stuff. Documenting here in the hopes to having it fixed:

InstallManager (really bad code quality):

  • Installation doesn't succeed when folders already exist because an exception will cause the installer to abort when a file can't be hardlinked.
  • InstallManager (java) uses shell commands to copy/remove files. Java has great support for file operations such that there is no need to use shell commands, especially if it makes the code more complex and less portable.
  • Over-eagerly uses exceptions when return values would be perfectly fine

SDK:

  • Require root privileges for installation: some scripts relink stuff from my distribution - the SDK *REALLY* shouldn't touch my system! It's a user component that has no business changing the system.
  • Building a project Tried erasing my harddrive when i ran "make clean" on a native project -> when SA_REPORT_PATH is not set, rm -rf /* is executed. I also managed to trigger this from within the SDK by accident - not cool! Get rid of the wildcard in the makefile or at the very least check if the variable is empty before applying the wildcard on it.
  • Lacks x86_64 target support
  • (Is based on eclipse...)

Responses

7 Replies
AVSukhov

Hello,

I hope these comments will be accepted into consideration in future SDK releases.

Yeongkyoon Lee

Hello,

Thanks for your kind feedbacks.

Please see my comments below.

 

InstallManager (really bad code quality):

  • Installation doesn't succeed when folders already exist because an exception will cause the installer to abort when a file can't be hardlinked.

=>[Yeongkyoon] It is a bug about hanlding of duplicated files, which will be fixed in next Tizen SDK release coming soon.

  • InstallManager (java) uses shell commands to copy/remove files. Java has great support for file operations such that there is no need to use shell commands, especially if it makes the code more complex and less portable.

=>[Yeongkyoon] Shell commands were used for enhancing file I/O performance, because old Java APIs, such as Java SE 6, showed poor performance, which was improved in new NIO 2 File I/O since Java SE 7, probably which you mean. Now is the time to check the migration to Java, because we dropped the unofficial support Java SE 6 not long ago.

  • Over-eagerly uses exceptions when return values would be perfectly fine

=>[Yeongkyoon] Well, I think it's a matter of coding style, especially depending on language. :-)

SDK:

  • Require root privileges for installation: some scripts relink stuff from my distribution - the SDK *REALLY* shouldn't touch my system! It's a user component that has no business changing the system.

=>[Yeongkyoon] Could you share what version and what scripts you used? Since at least 2.3 Rev2, no installation scripts need root privilege except for Emulator, which inevitably needs root for hypervisor, such as, KVM or HAXM. Unless you install Tizen Emulator, you don't need root during installation.

  • Building a project Tried erasing my harddrive when i ran "make clean" on a native project -> when SA_REPORT_PATH is not set, rm -rf /* is executed. I also managed to trigger this from within the SDK by accident - not cool! Get rid of the wildcard in the makefile or at the very least check if the variable is empty before applying the wildcard on it.

=>[Yeongkyoon] You are right. It will be fixed in next Tizen SDK release coming soon.

  • Lacks x86_64 target support

=>[Yeongkyoon] It's ongoing now. I'm not sure when it'll released to public.

  • (Is based on eclipse...)

(=>[Yeongkyoon] Eclipse might not be the best choice but no alternatives now we have. :-( We should migrate hundreds of packages with tons of source codes when dropping Eclipse. Instead, we are investingating the way to complement the shortcomings of Eclipse.)

 

 

blah

Hi Yeongkyoon

thanks for hearting my comments and for the detailed reply *with actual reasoning*. This kind of enagagement and especially open communication is really what the community needs most right now to show appreciation for outside developers! Thank you!

I think you're right about the sudo invoking scripts coming from the emulator, however, it just needs access to the virtualization features to run, not full root (access to the groups hvm and libvirt is enough to run on my ubuntu box) and still shouldn't modify links in my core system during the installation - otherwise you might just break other stuff. In my case, the link was already pointing to the right shared library version and so a simple check with a warning promping the user if he actually wants the change performed might just do the trick without bypassing user consent. Also a pop up indicating the actual root command might help promoting trust., When I currently get prompted for my password (Gnome desktop) I only see that "/bin/ln" wants root access - which is kind of useless without the parameters (blame it on the system in this case)

Btw, InstallManager runs flawlessly on OpenJDK (x86_64, 1.7). I guess it's OK to leave the warning if you don't officially support it, but there are enough people that won't drop to oracle's version and I appreciate that it doesn't simply exit when it's detected.

I hope that this new SDK version will follow shortly :)

Kind regards

Yeongkyoon Lee

Hi blah,

It looks good idea to show root command when it needed, and we'll check it.

I'm not sure whether it's feasible to use hvm or libvirt other than root. It needs somebody's help.

About OpenJDK, we investigated to support it, but haven't found a way of support Eclipse which doesn't work well on OpenJDK. However, we have plan to partially support OpenJDK for some tools other than IDE, such as, installer and CLI tools, probably by the end of this year. Moreover, let me check a way of earlier support for installer not to simply exit on OpenJDK.

Thanks.

Sangho Park

Hi blah,

At first, thank you for your comments about Tizen SDK and your suggestion to show the actual command for root priviledge.

I'd like to talk about root priviledge on installing the SDK.

Tizen SDK adds a current user to the kvm group when (s)he selected to install Tizen Emulator as you mentioned. "addgroup" also requires the root priviledge. Except adding group, we need to install initscript to start kvm module and adding the kvm device to kvm group. In order to skip the root-priviledge-installation in the PC in which is already ready to use kvm, we will research and elaborate.

Thank you,

 

blah

Sangho, I understand that those operations need root and they're not the problem since they're not destructive (unless the files already exist from a previous installation..)

sdb_2.2.51_ubuntu-64.zip/install.sh is the system modifying culprit I'm talking about:

# link to libudev.so.1
UDEV_LIB_VER_0=libudev.so.0
UDEV_LIB_VER_1=libudev.so.1
UDEV_PATHS=(
  "/lib/x86_64-linux-gnu" # Ubuntu 64bit
  "/lib/i386-linux-gnu" # Ubuntu 32bit
)
for i in "${UDEV_PATHS[@]}"
do
  if [ -f $i/$UDEV_LIB_VER_1 ]
  then
    ${TSUDO} ln -sf $i/$UDEV_LIB_VER_1 $i/$UDEV_LIB_VER_0
    break
  fi
done

 

Cheers

Dongkyun Yun

Hi blah

Now, we have removed the dependency libudev for sdb in ubuntu

This dependency is fixed with sdb version 2.2.55

This sdb will be released 

Thanks