Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dsm6] building for 6.x for braswell and x64 broken #2733

Closed
amyreese opened this issue Apr 10, 2017 · 6 comments
Closed

[dsm6] building for 6.x for braswell and x64 broken #2733

amyreese opened this issue Apr 10, 2017 · 6 comments

Comments

@amyreese
Copy link

I'm new to Synology (just got one last week), but not Linux, so forgive me if I'm missing something. I tried to follow the readme/developer how to as close as possible. I can build on 5.2, but my ds916+ is running 6.1, and the package I'd like to build needs the newer GCC in 6.x.

Expected behavior

Toolchain bootstraps and builds SPK.

Actual behavior

Toolchain download bombs on bad sha1/sha256/md5 hash for <braswell/x64>-gcc493_glibc220_linaro_x86_64-GPL.txz. Updating toolchains/syno-braswell-6.0.2/digests then results in toolchain bootstrap failure due to tons of perm denied errors. Building for 6.1 via #2727 fails in the same way. Bootstrapping/building on 5.2 works.

Steps to reproduce

1. git checkout -f dsm6
2. git clean -xfd
3. docker -it --rm -v $workspace/spksrc:/spksrc synocommunity/spksrc /bin/bash
4. make local.mk dsm-6.1
5. cd cross/nano
6. make arch-braswell

Build log

===>  Building package for arch braswell
make[1]: Entering directory '/spksrc/cross/nano'
===>  Set up toolchain
===>    Downloading files for syno-braswell
===>      File braswell-gcc493_glibc220_linaro_x86_64-GPL.txz already downloaded
===>    Verifying files for syno-braswell
===>      Checking sha1sum of file braswell-gcc493_glibc220_linaro_x86_64-GPL.txz
===>      Checking sha256sum of file braswell-gcc493_glibc220_linaro_x86_64-GPL.txz
===>      Checking md5sum of file braswell-gcc493_glibc220_linaro_x86_64-GPL.txz
/spksrc/toolchains/syno-braswell-6.0.2/../../distrib/toolchains/6.0.2/braswell-gcc493_glibc220_linaro_x86_64-GPL.txz
===>    Extracting for syno-braswell
tar -xpf /spksrc/toolchains/syno-braswell-6.0.2/../../distrib/toolchains/6.0.2/braswell-gcc493_glibc220_linaro_x86_64-GPL.txz -C /spksrc/toolchains/syno-braswell-6.0.2/work
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite/gcc: Cannot mkdir: No such file or directory
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite/gcc/testsuite: Cannot mkdir: No such file or directory
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite/gcc/testsuite/go.test: Cannot mkdir: No such file or directory
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite/gcc/testsuite/go.test/test: Cannot mkdir: No such file or directory
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite/gcc/testsuite/go.test/test/map.go: Cannot open: No such file or directory
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite/gcc/testsuite/go.test/test/deferprint.go: Cannot open: No such file or directory
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite/gcc/testsuite/go.test/test/indirect.go: Cannot open: No such file or directory
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
tar: x86_64-pc-linux-gnu/test-suite/gcc/testsuite/go.test/test/cmplxdivide.go: Cannot open: No such file or directory
tar: x86_64-pc-linux-gnu/test-suite: Cannot mkdir: Permission denied
.......
tar: Exiting with failure status due to previous errors
../../mk/spksrc.extract.mk:50: recipe for target 'extract_target' failed
make[2]: *** [extract_target] Error 2
/spksrc/cross/nano/work-braswell-6.0.2/tc_vars.mk:1: *** An error occured while setting up the toolchain, please check the messages above.  Stop.
make[1]: Leaving directory '/spksrc/cross/nano'
../../mk/spksrc.cross-cc.mk:122: recipe for target 'arch-braswell' failed
make: [arch-braswell] Error 2 (ignored)
ymartin59 added a commit to ymartin59/spksrc that referenced this issue Apr 14, 2017
@ymartin59
Copy link
Contributor

Hello. DSM 6.1 toolchains available in #2727 are perfectly valid and I properly built cross/nano with make arch-braswell-6.1, it is even downloadable from #2716 . So please checkout my branch and try again: https://github.com/ymartin59/spksrc/tree/dsm6-toolchains-6.1

Care about removing work-braswell-6.0.2 after "unrecoverable" failure to try again.

And you're right, all toolchain 6.0.2 digests are incorrects, probably new releases have been published by Synology. I fixed them in #2737

@amyreese
Copy link
Author

As I mentioned, I tried this directly from your branch in #2727, and I still get the permissions issues when I cd cross/nano && make arch-braswell. I've done everything from make clean in cross/nano and make dist-clean in the root path to git clean -xfd, and it still gives permissions errors while extracting the toolchain.

@amyreese
Copy link
Author

Hmm, digging a bit more, it seems like this is an issue with mounting spksrc/ from the host system. I'm not sure why this works with the old 5.x toolchains but not with the 6.x toolchains. I set up Debian in Virtualbox, and get similar errors when running a shared mount from the host system, but can build without issue when running a fresh checkout on the native disk. Would love to know why that happens, as I'd much prefer being able to build from the checkout on the host filesystem.

@amyreese
Copy link
Author

Not sure why this happens on shared mounts, but the workaround for me was to rsync changes from the shared mount into a native directory where I actually performed the builds. I could then successfully build packages and copy the resulting binaries back into the shared folder. Not the best solution, but good enough.

@ymartin59
Copy link
Contributor

@jreese I had same troubles with toolchains when hosting spksrc on a filesystem where I used noexec for security reasons. So checkout your mount point options like noexec, nosuid or nodev before starting docker container.

ymartin59 added a commit to ymartin59/spksrc that referenced this issue Apr 27, 2017
ymartin59 added a commit to ymartin59/spksrc that referenced this issue Apr 27, 2017
jvega1976 pushed a commit to jvega1976/spksrc that referenced this issue Nov 25, 2017
* 'dsm6' of https://github.com/jvega1976/spksrc: (83 commits)
  [DSM6] Add support for apollolake and denverton toolchains (6.1) (SynoCommunity#2942)
  [DSM 6] Add support for rtd1296 (SynoCommunity#2890)
  Update 6.1 toolchains digests
  Add dockerx64 DSM 6.1 toolchain
  DSM 6.1 toolchains (SynoCommunity#2727)
  Fix DSM 6.0.2 toolchains digests. SynoCommunity#2733 (SynoCommunity#2737)
  Radarr DSM6 Compatibility: var->.config + version checking fix (SynoCommunity#2746)
  Update Sonarr for DSM6 Compatibility: var->.config + version checking fix/improvement (SynoCommunity#2745)
  Borgbackup (SynoCommunity#2694)
  Determine correct user for web-based packages via BUILDNUMBER - Remove duplicate entries
  znc
  umurmur
  tvheadend
  tt-rss
  transmission
  syncthing
  subliminal
  squidguard
  sonarr
  sickrage
  ...
@yuezhu
Copy link
Contributor

yuezhu commented Dec 31, 2017

If you ran bash shell in the container using docker -it --rm -v $workspace/spksrc:/spksrc synocommunity/spksrc /bin/bash, the user and group would be root:root inside the container. This somehow would cause tar -xpf /spksrc/toolchains/syno-braswell-6.0.2/../../distrib/toolchains/6.0.2/braswell-gcc493_glibc220_linaro_x86_64-GPL.txz to fail due to the absence of write permission for root user in the extracted directory x86_64-pc-linux-gnu.

Just using the same user and group to run a bash shell in the container could avoid this issue: docker run -it -e UID=$(id -u) -u $(id -u):$(id -g) -e USERNAME=$USERNAME -e USER=$USER -e USERID=$UID -v ~/spksrc:/spksrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants