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

Make script fails if no version number found #342

Open
BinaryHammer opened this issue Sep 15, 2020 · 5 comments
Open

Make script fails if no version number found #342

BinaryHammer opened this issue Sep 15, 2020 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@BinaryHammer
Copy link

BinaryHammer commented Sep 15, 2020

Thank you for making it possible to use the toolbox CLI without homebrew.

Defect

I found the problem: Your release .zip-file is not a git repository, so the currentVersion() function in scripts/build.swift can not create a version number.

In directory toolbox-18.2.2 I used the following command.

% git describe --tags --exact-match
fatal: not a git repository (or any of the parent directories): .git

Workaround

Just clone the repository, do not use the release.
If you want to use the release you can just change the scripts/build.swift's currentVersion() function to return the current version like the following code.

func currentVersion() throws -> String {
    return "18.2.2"
}

Error message

Downloaded the release 18.2.2 and unzipped it.

Using Catalina 10.15.6 and Xcode 11.7 .

In directory toolbox-18.2.2 I used the following commands.

% ls
Dockerfile	Makefile	README.md	Tests
LICENSE.txt	Package.swift	Sources		scripts

% swift --version
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.6.0

% make build
swiftc ./scripts/build.swift
./build
Fatal error: Error raised at top level: build.ShellError(terminationStatus: 128): file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1103.8.25.8/swift/stdlib/public/core/ErrorType.swift, line 200
make: *** [build] Illegal instruction: 4
make: *** Deleting file `build'

% cd scripts
% swift build.swift 
Fatal error: Error raised at top level: build.ShellError(terminationStatus: 128): file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1103.8.25.8/swift/stdlib/public/core/ErrorType.swift, line 200
Stack dump:
0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret build.swift -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -color-diagnostics -module-name build 
1.	Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
2.	While running user code "build.swift"
0  swift                    0x00000001070db4ea PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x00000001070dacc0 SignalHandler(int) + 352
2  libsystem_platform.dylib 0x00007fff739745fd _sigtramp + 29
3  libsystem_platform.dylib 0x00007ffeece76080 _sigtramp + 2035292832
4  libswiftCore.dylib       0x00007fff72e33edf swift_errorInMain + 543
5  libswiftCore.dylib       0x000000010b7fa040 swift_errorInMain + 2560385920
6  swift                    0x0000000102e5e0aa llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 458
7  swift                    0x0000000102e6511b 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*) + 2011
8  swift                    0x0000000102e3a1da performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 14362
9  swift                    0x0000000102e2eb95 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 55813
10 swift                    0x0000000102da4b73 main + 1283
11 libdyld.dylib            0x00007fff7377bcc9 start + 1
zsh: illegal hardware instruction  swift build.swift
@BinaryHammer BinaryHammer changed the title Make throws error Make throws error (defect in release found) Sep 19, 2020
@0xTim 0xTim changed the title Make throws error (defect in release found) Make script fails if no version number found Sep 24, 2020
@0xTim 0xTim added the help wanted Extra attention is needed label May 30, 2022
@VaporBot VaporBot added this to To do in Help Wanted Issues May 30, 2022
@linus-hologram
Copy link

I'll be looking into this now :)

@0xTim
Copy link
Member

0xTim commented May 18, 2023

@linus-hologram there's also #393 that could be good to finish off at the same time if you're interested

@linus-hologram
Copy link

@0xTim alright, i'll look into this too :)

@linus-hologram
Copy link

@linus-hologram there's also #393 that could be good to finish off at the same time if you're interested

Also with this one, what work is left to do? What is the overall goal of this PR? Is there an issue it refers to? Kinda tapping in the dark what I'm supposed to do here...

@0xTim
Copy link
Member

0xTim commented May 25, 2023

Just to have it here as well as Discord, #393 does not pass CI for some reason. I don't think it's related to this one, but if it is and you can merge them together then even better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Development

No branches or pull requests

3 participants