Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 672088 - net-libs/srt-1.3.1 : sandbox issue
Summary: net-libs/srt-1.3.1 : sandbox issue
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Luca Barbato
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 678146
  Show dependency tree
 
Reported: 2018-11-27 20:20 UTC by Toralf Förster
Modified: 2019-02-16 17:58 UTC (History)
13 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,18.04 KB, text/plain)
2018-11-27 20:20 UTC, Toralf Förster
Details
CMakeCache.txt (CMakeCache.txt,22.35 KB, text/plain)
2018-11-27 20:20 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,363.43 KB, text/plain)
2018-11-27 20:20 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,20.41 KB, application/x-bzip)
2018-11-27 20:20 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,8.95 KB, application/x-bzip)
2018-11-27 20:20 UTC, Toralf Förster
Details
net-libs:srt-1.3.1:20181127-171109.log (net-libs:srt-1.3.1:20181127-171109.log,53.64 KB, text/plain)
2018-11-27 20:20 UTC, Toralf Förster
Details
sandbox-6766.log (sandbox-6766.log,359 bytes, text/plain)
2018-11-27 20:20 UTC, Toralf Förster
Details
srt-1.3.1-remove-stransmit-symlink.patch (srt-1.3.1-remove-stransmit-symlink.patch,1.20 KB, patch)
2018-12-15 22:05 UTC, Dennis Schridde
Details | Diff
srt-1.3.1-use-destdir-for-symlinks-44a8656bd256373fe5927f49d41f5791c6538b86.patch (srt-1.3.1-use-destdir-for-symlinks-44a8656bd256373fe5927f49d41f5791c6538b86.patch,2.14 KB, patch)
2018-12-15 22:32 UTC, Dennis Schridde
Details | Diff
srt-1.3.1-use-destdir-for-symlinks-09afc227e0880b12a98e18ee8182f89c3a80e3a6.patch (srt-1.3.1-use-destdir-for-symlinks-09afc227e0880b12a98e18ee8182f89c3a80e3a6.patch,2.69 KB, patch)
2018-12-15 23:19 UTC, Dennis Schridde
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2018-11-27 20:20:29 UTC
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: symlink
S: deny

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_libressl_20181118-211953

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-7.3.1
 [2] x86_64-pc-linux-gnu-8.2.0 *

Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.6
  [3]   python2.7 (fallback)
  [4]   pypy (fallback)
Available Ruby profiles:
  [1]   ruby23 (with Rubygems)
  [2]   ruby24 (with Rubygems) *
  [3]   ruby25 (with Rubygems)
Available Rust versions:
  [1]   rust-1.30.1 *
  [2]   rust-bin-1.30.1



emerge -qpvO net-libs/srt
[ebuild  N    ] net-libs/srt-1.3.1  USE="libressl -doc -gnutls" ABI_X86="(64) -32 (-x32)"
Comment 1 Toralf Förster gentoo-dev 2018-11-27 20:20:32 UTC
Created attachment 556464 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2018-11-27 20:20:35 UTC
Created attachment 556466 [details]
CMakeCache.txt
Comment 3 Toralf Förster gentoo-dev 2018-11-27 20:20:38 UTC
Created attachment 556468 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2018-11-27 20:20:41 UTC
Created attachment 556470 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2018-11-27 20:20:43 UTC
Created attachment 556472 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2018-11-27 20:20:46 UTC
Created attachment 556474 [details]
net-libs:srt-1.3.1:20181127-171109.log
Comment 7 Toralf Förster gentoo-dev 2018-11-27 20:20:49 UTC
Created attachment 556476 [details]
sandbox-6766.log
Comment 8 Dennis Schridde 2018-11-29 03:02:38 UTC
Interesting bits:

Install the project...
-- Install configuration: "Gentoo"
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/lib64/libsrt.so.1.3.1
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/lib64/libsrt.so.1
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/lib64/libsrt.so
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/lib64/libsrt.a
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/include/srt/version.h
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/include/srt/srt.h
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/include/srt/logging_api.h
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/include/srt/platform_sys.h
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/include/srt/udt.h
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/include/srt/srt4udt.h
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/lib64/pkgconfig/haisrt.pc
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/lib64/pkgconfig/srt.pc
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/bin/srt-live-transmit
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/bin/srt-live-transmit
 * ACCESS DENIED:  symlink:      /usr/bin/stransmit
CMake Error: failed to create symbolic link '/usr/bin/stransmit': permission denied
-- Created symlink: /usr/bin/stransmit -> srt-live-transmit
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/bin/srt-file-transmit
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/bin/srt-file-transmit
-- Installing: /tmp/portage/net-libs/srt-1.3.1/image/usr/bin/srt-multiplex
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/bin/srt-multiplex
-- Up-to-date: /tmp/portage/net-libs/srt-1.3.1/image/usr/bin/srt-ffplay
>>> Completed installing srt-1.3.1 into /tmp/portage/net-libs/srt-1.3.1/image/

 * Final size of build directory: 14692 KiB (14.3 MiB)
 * Final size of installed tree:   5372 KiB ( 5.2 MiB)

 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-819.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: symlink
S: deny
P: /usr/bin/stransmit
A: /usr/bin/stransmit
R: /usr/bin/stransmit
C: /usr/bin/cmake -E create_symlink srt-live-transmit /usr/bin/stransmit 

F: symlink
S: deny
P: /usr/bin/stransmit
A: /usr/bin/stransmit
R: /usr/bin/stransmit
C: /usr/bin/cmake -E create_symlink srt-live-transmit /usr/bin/stransmit 
 * --------------------------------------------------------------------------------
Comment 9 Dennis Schridde 2018-11-29 10:04:14 UTC
Keywords+=PATCH

See-Also: https://github.com/Haivision/srt/issues/357
See-Also: https://github.com/Haivision/srt/pull/503
Comment 10 Attila Tóth 2018-12-04 22:12:15 UTC
(In reply to Dennis Schridde from comment #9)
> Keywords+=PATCH
> 
> See-Also: https://github.com/Haivision/srt/issues/357
> See-Also: https://github.com/Haivision/srt/pull/503

Works for me. Thanks.
Comment 11 Jouni Kosonen 2018-12-04 23:16:47 UTC
(In reply to Attila Tóth from comment #10)
> Works for me. Thanks.
For me it completes but doesn't actually install the stransmit softlink.
From the log:

failed to create symbolic link '${DESTDIR}/usr/bin/stransmit': No such file or directory
-- Created symlink: /usr/bin/stransmit -> srt-live-transmit

which doesn't seem quite right.
Comment 12 Adrian Bassett 2018-12-05 21:20:42 UTC
(In reply to Jouni Kosonen from comment #11)
> (In reply to Attila Tóth from comment #10)
> > Works for me. Thanks.
> For me it completes but doesn't actually install the stransmit softlink.
> From the log:
> 
> failed to create symbolic link '${DESTDIR}/usr/bin/stransmit': No such file
> or directory
> -- Created symlink: /usr/bin/stransmit -> srt-live-transmit
> 
> which doesn't seem quite right.

This is also what I am seeing.

The problem as I understand it is that ${DESTDIR} is being expanded at the temporary install stage whereas it should be left unexpanded until the merge into the live filesystem. The result is that absolute-path symlinks are being created in the temporary location which point to the wrong location vis-a-vis the live location.

It is slightly confusing that in the build treee there are both 32- and 64-bit directories each of which includes the problematic symlink.  In the final install there is only one instance (/usr/bin/srt-live-transmit) which needs to be symlinked (/usr/bin/stransmit).

So what I did to get round the delay in resolving this was to build the code manually using the ebuild command in the following stages:

ebuild srt-1.3.1.ebuild unpack

manually apply the changes in the patch referred to in the seoncd url in #9 (expands to https://github.com/devurandom/gentoo-patches/commit/45066e045c43beb2f55228b6322e2491b3c9d741) to the correct file in the workdir.

ebuild srt-1.3.1.ebuild install

cd to the workdir location.  Delete the stransmit symlink in each of the 32-bit and 64-bit directory tress and make (chown -h portage:portage) a relative-path symlink pointing to the srt-live-transmit file in the current directory.

ebuild srt-1.3.1.ebuild qmerge

which gets us where we want to be:

/usr/bin:

-rwxr-xr-x   1 root root         754608 Dec  5 19:58 srt-live-transmit
lrwxrwxrwx   1 root root             17 Dec  5 20:01 stransmit -> srt-live-transmit

(Note that ebuild srt-1.3.1.ebuild package will fail.)

So I now have srt-1.3.1 installed, which allows ffmpeg-4.1 to install and unblocks other s/w and versions which depend on >=ffmpeg-4.

(I am slightly concered that not many people appear to be encountering this problem (or at least reporting it).)

However, hope this helps.
Comment 13 Dennis Schridde 2018-12-15 22:05:27 UTC
Created attachment 557872 [details, diff]
srt-1.3.1-remove-stransmit-symlink.patch

Attached patch removes the symlink generation from the project's build system. It should instead be done in the ebuild, because CMake's capabilities dealing with symlinks are too limited / too automagic: https://github.com/Haivision/srt/pull/503#issuecomment-447600237
Comment 14 Dennis Schridde 2018-12-15 22:06:22 UTC
See-Also: https://github.com/Haivision/srt/issues/357
See-Also: https://github.com/Haivision/srt/pull/503
Comment 15 Dennis Schridde 2018-12-15 22:32:18 UTC
Created attachment 557876 [details, diff]
srt-1.3.1-use-destdir-for-symlinks-44a8656bd256373fe5927f49d41f5791c6538b86.patch

(In reply to Dennis Schridde from comment #13)
> Created attachment 557872 [details, diff] [details, diff]
> srt-1.3.1-remove-stransmit-symlink.patch
> 
> Attached patch removes the symlink generation from the project's build
> system. It should instead be done in the ebuild, because CMake's
> capabilities dealing with symlinks are too limited / too automagic:
> https://github.com/Haivision/srt/pull/503#issuecomment-447600237

Actually I was just badly interacting with other code in CMakeLists.txt.  Attached patch should fix the issue properly.

Keywords+=PATCH
Comment 16 Dennis Schridde 2018-12-15 23:19:12 UTC
Created attachment 557878 [details, diff]
srt-1.3.1-use-destdir-for-symlinks-09afc227e0880b12a98e18ee8182f89c3a80e3a6.patch

Fix Windows build
Comment 17 Jouni Kosonen 2018-12-18 09:40:57 UTC
(In reply to Dennis Schridde from comment #16)
> Created attachment 557878 [details, diff] [details, diff]
Works for me, thanks!
Comment 18 Dennis Schridde 2018-12-18 10:19:48 UTC
(In reply to Jouni Kosonen from comment #17)
> (In reply to Dennis Schridde from comment #16)
> > Created attachment 557878 [details, diff] [details, diff] [details, diff]
> Works for me, thanks!

https://github.com/Haivision/srt/pull/503 was merged upstream.
Comment 19 Andreas Sturmlechner gentoo-dev 2019-02-16 17:58:29 UTC
Apparently this bug was just forgotten to close after commit 9feafbf

Thanks for the patch and pushing it upstream.