htwg-syslab / nix-expressions

This project contains nix expressions to run the syslab courses at HTWG Konstanz.
0 stars 0 forks source link

labshell & shells: increase debug information; refactor shell expressions; prefer native binaries in cross-development shells #87

Closed steveej closed 7 years ago

steveej commented 7 years ago

Fixes #86

fabs77 commented 7 years ago

@steveeJ To your question of #86 : It was the full output of file

LABSHELL_EXPRESSIONS_REMOTE_URL=https://github.com/htwg-syslab/nix-expressions/archive/sj-workaround-cross-drawbacks.tar.gz labshell sysoHW3

I've started the labshell this way, but i'm encountering the same issue... After building the binary with gcc I also have to execute chmod +x but still the same error...

$ file sysinfo sysinfo: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped, with debug_info

Full output of file...

Clear works!

steveej commented 7 years ago

@fabs77

Are you sure you actually recompiled the binary? make doesn't know that your compiler changed, so it won't rebuild for you in that case. It works for me:

$ echo $IN_NIX_SHELL 
1
sjunker@ct-staff-0 ✓ »sysoHW3@2« ~/src/htwg-syslab-syso/syso-ss17-grp0/HW3/sysinfo/src
$ echo $LABSHELL_FLAVOR_INSTANTIATED 
sysoHW3
sjunker@ct-staff-0 ✓ »sysoHW3@2« ~/src/htwg-syslab-syso/syso-ss17-grp0/HW3/sysinfo/src
$ gcc -Wall sysinfo.c -o sysinfo
sjunker@ct-staff-0 ✓ »sysoHW3@2« ~/src/htwg-syslab-syso/syso-ss17-grp0/HW3/sysinfo/src
$ file sysinfo
sysinfo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/izxnyg94352qxa4a4783dzgnpy5cwazj-glibc-2.25/lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped, with debug_info
sjunker@ct-staff-0 ✓ »sysoHW3@2« ~/src/htwg-syslab-syso/syso-ss17-grp0/HW3/sysinfo/src
$ ./sysinfo 
---- gethostname Information ----
Hostname: ct-staff-0

---- sysinfo Information ----
Uptime: 6527648 seconds
Process count: 3184 
Total RAM: 33406656512 Byte
Free RAM: 1415757824 Byte
Page size: 1 Byte

---- utsname Information ----
system name: Linux
node name: ct-staff-0
release: 4.4.40-1-pve
version: #1 SMP PVE 4.4.40-82 (Thu, 23 Feb 2017 15:14:06 +0100)
machine: x86_64
fabs77 commented 7 years ago

I did not use make, but the gcc directly. I tried it one more time. And its working now! Thank you!