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

Keeps trying to download 2019 keynote? (and crashes) #87

Open
tomkidd opened this issue Jun 6, 2019 · 16 comments
Open

Keeps trying to download 2019 keynote? (and crashes) #87

tomkidd opened this issue Jun 6, 2019 · 16 comments

Comments

@tomkidd
Copy link

tomkidd commented Jun 6, 2019

OK so for some reason when I run the downloader script ./wwdcDownloader.swift it tries to download the WWDC 2019 Keynote video, which then fails, presumably because it isn't available. But I can't figure out why it's trying to do this.

For extra strange points I popped the code into an Xcode command line project and it works fine (downloads them to whatever DerivedData directory the thing outputs to). I notice when it fails from the command line it's trying to download a 1080p keynote video but in Xcode it's just downloading 720p everything.

In Xcode, where it succeeds

Downloading HD videos in current directory 
Let me ask Apple about currently available sessions. This can take some times (15 to 20 sec.) ...

[Session 101] : Keynote
Video : Video is not yet available !!!
...

On the command line, where it fails

Downloading 1080p videos in current directory
Let me ask Apple about currently available sessions. This can take some times (15 to 20 sec.) ...

[Session 101] : Keynote
Video : 101_1080p_keynote.mp4
[Session 101] Getting 101_1080p_keynote.mp4:
Stack dump:
0.    Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret ./wwdcDownloader.swift -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -color-diagnostics -module-name wwdcDownloader 
0  swift                    0x00000001062cbee3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x00000001062cb6bc SignalHandler(int) + 348
2  libsystem_platform.dylib 0x00007fff5e42eb5d _sigtramp + 29
3  libsystem_platform.dylib 0x00007f9c59f3c410 _sigtramp + 4222671056
4  libswiftCore.dylib       0x00007fff5dc66c09 _swift_updateClassMetadataImpl(swift::TargetClassMetadata<swift::InProcess>*, swift::ClassLayoutFlags, unsigned long, swift::TypeLayout const* const*, unsigned long*, bool) + 265
5  libswiftCore.dylib       0x00007fff5dc66c4b swift_updateClassMetadata2 + 27
6  libswiftCore.dylib       0x000000010b26212b swift_updateClassMetadata2 + 2908730619
7  libswiftCore.dylib       0x00007fff5dc6eb77 swift::MetadataCacheEntryBase<(anonymous namespace)::SingletonMetadataCacheEntry, int>::doInitialization(swift::ConcurrencyControl&, swift::MetadataCompletionQueueEntry*, swift::MetadataRequest) + 215
8  libswiftCore.dylib       0x00007fff5dc643f3 swift_getSingletonMetadata + 579
9  libswiftCore.dylib       0x000000010b26200f swift_getSingletonMetadata + 2908741215
10 libswiftCore.dylib       0x000000010b25746d swift_getSingletonMetadata + 2908697277
11 libswiftCore.dylib       0x000000010b25e90d swift_getSingletonMetadata + 2908727133
12 libswiftCore.dylib       0x000000010b25f599 swift_getSingletonMetadata + 2908730345
13 libswiftCore.dylib       0x000000010b25f5f8 swift_getSingletonMetadata + 2908730440
14 libswiftCore.dylib       0x00007fff5dae5004 $sSTsE7forEachyyy7ElementQzKXEKF + 452
15 libswiftCore.dylib       0x000000010b249b0f $sSTsE7forEachyyy7ElementQzKXEKF + 2910211279
16 swift                    0x0000000102b6338d llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 365
17 swift                    0x0000000102b69762 llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char const* const*) + 1090
18 swift                    0x0000000102132831 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 58929
19 swift                    0x000000010212092e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6862
20 swift                    0x00000001020be9ce main + 1246
21 libdyld.dylib            0x00007fff5e2433d5 start + 1
22 libdyld.dylib            0x000000000000000a start + 2715536438
Bus error: 10

This is with source I fetched just now with the PRs that just got merged for video streams and ffmpeg and so forth. Presumably this script works for folks so I'm not sure what I'm doing wrong.

@tomkidd tomkidd changed the title Keeps trying to download 2019 keynote? Keeps trying to download 2019 keynote? (and crashes) Jun 6, 2019
@ohoachuck
Copy link
Owner

Yeah, sorry, it's mostly related to swift version. It appear that crash occurs with the latest 2363 Swift version (xcode-select --version).
For some reason that work on Playground (mac) with the latest version but not from terminal.
I have added a notice in README until the issue is fix. Any help welcome.

I just downloaded 120Go for current status of available HD videos.

O.

@tomkidd
Copy link
Author

tomkidd commented Jun 6, 2019

Interesting. Good to know I'm not going crazy. I'll see if I can figure anything out.

EDIT: Looks like I'm running Swift 2354, so it might not just be the latest latest version

@ohoachuck
Copy link
Owner

I just verified that the issue is not related to Xcode version installed, but to binaries updated with latest Mac OS versions. I was almost sure that swift was only updated with Xcode, but it does not seems to be the case. Swift is in /usr/bin/swift.
And the current swift version having the issue is /usr/bin/swift --verison:
Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5) Target: x86_64-apple-darwin18.6.0
I had mac os 10.14.3 (not updated) with Xcode Version 10.2.1 (10E1001) installed (together with Xcode-beta) => wwdcDownloader was working just fine.
I have just updated mac os to 10.14.5 and I have the issue.

@weyhan
Copy link

weyhan commented Jun 7, 2019

@tomkidd

The issue is not just the macOS version but Xcode as well. I had the latest non-beta Mojave and Xcode installed and have the same crash problem. However, I also have multiple versions of Xcode installed. When adding the audio track handling, I was using the older version of Xcode (10.1) and there were no problem.

To work around the problem, install the older version of Xcode and use xcode-select to set using the older version (Based solely on memory. Path may be slightly different):
sudo xcode-select -s /Applications/<path to older xcode>/Content/Developer

To download older version of Xcode, login to Apple Developer portal and [https://developer.apple.com/download/more/](go here) to find Xcode 10.1. If you want to install in the /Applications folder, make sure to rename Xcode.app to a different name before moving to /Applications so you don’t overwrite other Xcode version you’ve installed there.

On why the script crash, this is a compiler bug that I can’t fix unless Apple fixes it. So hopefully Apple will fix it in the next Xcode release. If not, the script may need to be changed to be compilable into a command line app.

Sent with GitHawk

@ohoachuck
Copy link
Owner

Ok, I’ll test that. Could it be juste Swift binary from the previous version that would be enough to get for running the script ?

@weyhan
Copy link

weyhan commented Jun 7, 2019

I think it’s possible.

Sent with GitHawk

@ohoachuck
Copy link
Owner

Ok, I found a workaround (a bit complicated for a script that should not have dependencies :)) explained in the readme.
It's very weird that it works on PlayGround with latest swift runtime but not from the script. ;(

@ohoachuck
Copy link
Owner

I went to the lab and it is indeed a bug in Swift 5.1!
So easy workaround is to compile the script with swiftc and use the compiled version.
I have quickly updated readme and added a wwdcDownloader.sh bash script that quickly (and dirtily) do just that :).
Thanks your contribution.

O.

@weyhan
Copy link

weyhan commented Jun 8, 2019

You’re welcome.

It’s good to have access to the labs. :)

Sent with GitHawk

@vandadnp
Copy link

vandadnp commented Jun 8, 2019

When I run

./wwdcDownloader.sh --hd720 --pdf --sample

I get the following error:

dyld: Library not loaded: @rpath/libswiftAppKit.dylib
  Referenced from: /Users/vandad/Desktop/wwdc2019/wwdc-downloader/./wwdcDownloader
  Reason: image not found
./wwdcDownloader.sh: line 3:   959 Abort trap: 6           ./wwdcDownloader "$@"

Swift version:

xcrun swift --version       
Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin19.0.0

@weyhan
Copy link

weyhan commented Jun 8, 2019

If you have more than one version of Xcode installed, which version is setup to be used (what's the output of xcode-select -p)?

Try to use xcode-select anyway to see if you can fix the problem:
xcode-select -s /Applications/<Your Xcode app>/Contents/Developer/

If you have just installed the version of Xcode you've installed, try also launching it to get it to install additional components.

Hope this helps.

@vandadnp
Copy link

vandadnp commented Jun 8, 2019

I have both the latest release version of Xcode and the latest Beta of Xcode

xcode-select -p returns /Applications/Xcode.app/Contents/Developer which is the Release version of Xcode

I did the xcode-select but that didn't help either. Still getting the same error unfortunately

➜  wwdc-downloader git:(master) ✗ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
Password:
➜  wwdc-downloader git:(master) ✗ ./wwdcDownloader.sh --hd720 --pdf --sample                        
dyld: Library not loaded: @rpath/libswiftAppKit.dylib
  Referenced from: /Users/vandad/Desktop/wwdc2019/wwdc-downloader/./wwdcDownloader
  Reason: image not found
./wwdcDownloader.sh: line 3:  2745 Abort trap: 6           ./wwdcDownloader "$@"

@weyhan
Copy link

weyhan commented Jun 8, 2019

I think it's possible that the beta version of Xcode could have messed up something. I don't have any more ideas at the moment.

@ohoachuck
Copy link
Owner

Hello @vandadnp,
What does /usr/bin/swiftc wwdcDownloader.swift ?
Do you have the same error ?

O.

@ignazioc
Copy link

I'm on the same configuration as @vandadnp .
I'm running Catalina 10.15 Beta (19A471t) and I have both code 10.2 and 11 beta.
Even compiling using swiftc I got the same error of "Library not loaded".

I solved using the interpreter:

/usr/bin/swift wwdcDownloader.swift --wwdc-year 2019 --list-only

@ohoachuck
Copy link
Owner

Hello @ignazioc, the issue occurs when trying to download a video.
So when the crash occurs, while using latest swift version (5.x):

  • /usr/bin/swift wwdcDownloader.swift --wwdc-year 2019 --list-only might work,
  • /usr/bin/swift wwdcDownloader.swift --hd720 --pdf will not work.

Compiling wwdcDownloader.swift with /usr/bin/swiftc (like /usr/bin/swiftc wwdcDownloader.swift) will produce a fully functional compiled script (that you should be able to run with wwdcDownloader --hd720 --pdf for instance).

For me, it indeed crash with:

  • Xcode Version 10.15 Beta (19A471t)
  • Xcode-select --version => xcode-select version 2363
  • /usr/bin/swiftc --version => Apple Swift version 5.1 (swiftlang-1100.0.38.29 clang-1100.0.20.14) Target: x86_64-apple-darwin19.0.0
  • /usr/bin/swift --version=> Apple Swift version 5.1 (swiftlang-1100.0.38.29 clang-1100.0.20.14)
    Target: x86_64-apple-darwin19.0.0

I believe it's not particularly related to Xcode but to installed Swift version. After visiting Apple Swift Labs, it have been confirmed as a swift 5 version. I have filed a radar (and Open Radar does not seems to work at the moment).

O.

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

5 participants