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

x/mobile/cmd/gomobile: generates an .app even though build fails #12505

Open
rakyll opened this issue Sep 4, 2015 · 1 comment

Comments

@rakyll
Copy link
Member

commented Sep 4, 2015

$ rm -rf example.app
$ cat main.go
package main

import (
    "fmt"
    "time"
)

func main() {
    for i := 0; i < 5000*1000; i++ {
        go func() {
            fmt.Println("hello")
            time.Sleep(time.Second)
        }()
    }

}

$ gomobile build -target=ios .
gomobile: github.com/rakyll/gom/example does not import "golang.org/x/mobile/app"

$ stat example.app
16777220 152150587 drwxr-xr-x 8 jbd (5000) 0 272 "Sep  4 15:52:31 2015" "Sep  4 15:52:05 2015" "Sep  4 15:52:05 2015" "Sep  4 15:52:04 2015" 4096 0 0 example.app

Expected output: The build should fail and the .app should not be generated.

@rakyll rakyll self-assigned this Sep 4, 2015

@rakyll rakyll added this to the Unreleased milestone Sep 4, 2015

@rakyll

This comment has been minimized.

Copy link
Member Author

commented Sep 14, 2015

/cc @crawshaw @hyangah

The same behavior applies to -target=android as well, the apk is generated even though gomobile build fails with:

gomobile: golang.org/x/mobile/example/hello does not import "golang.org/x/mobile/app"

I am not sure what is the intention behind the current behavior, we can always delete the intermediate app and apk files if x/mobile/app import condition fails. Currently, the error message reads as it is a warning but gomobile build exits with an error.

@gopherbot gopherbot added the mobile label Jul 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.