Code Monkey home page Code Monkey logo

dinghy's People

Contributors

adrienball avatar ashdnazg avatar azdlowry avatar bestouff avatar daxpedda avatar deluvi avatar dependabot[bot] avatar dten avatar eijebong avatar fredszaq avatar geophree avatar jasper-bekkers avatar jayvdb avatar kafji avatar kali avatar ldm0 avatar madsmtm avatar marctreysonos avatar mathieupoumeyrolsonos avatar nebuto avatar pitdicker avatar robert-steiner avatar rtmvc avatar ryanpresciense avatar simlay avatar thibautlorrainsonos avatar tom-bowles avatar treymarc avatar umgefahren avatar warent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dinghy's Issues

unresolved name `ensure_shim` when trying to cargo install

Steps to reproduce

Run cargo install dinghy on Ubuntu 16.04 with either stable (1.14.0) or nightly (1.16.0-nightly 2017-01-17).

Actual results

error[E0425]: unresolved name `ensure_shim`
   --> .cargo/registry/src/github.com-1ecc6299db9ec823/dinghy-0.1.9/src/build.rs:102:5
    |
102 |     ensure_shim(device_target)?;
    |     ^^^^^^^^^^^ unresolved name

error[E0425]: unresolved name `ensure_shim`
   --> .cargo/registry/src/github.com-1ecc6299db9ec823/dinghy-0.1.9/src/build.rs:127:5
    |
127 |     ensure_shim(device_target)?;
    |     ^^^^^^^^^^^ unresolved name

error[E0425]: unresolved name `ensure_shim`
   --> .cargo/registry/src/github.com-1ecc6299db9ec823/dinghy-0.1.9/src/build.rs:152:5
    |
152 |     ensure_shim(device_target)?;
    |     ^^^^^^^^^^^ unresolved name

Expected results

Successful build.

Existence of a resource directory in project root breaks `dinghy run` for iOS simulator

cargo dinghy --platform auto-ios-aarch64-sim run --example foo where foo is an example. This is a relatively nuanced use of dinghy but I was trying to run an example on an iOS device in a project that has a resources directory and this causes the xcrun simctl install ... for unclear reasons.

The "fix" is to rm the resources directory in the Dinghy.app directory and then install it.

Obviously, using dinghy for CI is much more important but having it work on examples is also quite nice.

No more working on iOS devices 14.x

Hi,

The current version of the project isn't working on latest version of Xcode and iOS devices.

I managed to correct some bugs as the certificate management where "ON=" is now "ON = ", but I'm now struggling with lldb which can't connect to the platform and it seems to be linked to a device error which is: Unable to generate launch image for fr.doctolib.pro.dev.Dinghy because the app has no valid launch interfaces.

I have no concrete issue but I was wondering if a support of latest Xcode and iOS plateform were planned.
If it's the case I could share what I already tried to correct.

Thanks a lot !

make_linux_app is creates more and more files each time

make_linux_app copies the root of a project into target/deps/dinghy/dinghy for some reason

it also copies target, which contains the previous copy, so now you have two, next time you'll have three, and so on.

not sure best way to fix it but thought i'd let you know :)

Need some way of deploying test_data even if they are included in .gitignore

We have some test certificates that are encrypted when stored in git and the build processes uses a local key to decrypt them. To ensure that we don't accidentally check in the un-encrypted versions they are included in .gitignore which also means they don't get deployed into the bundle. However we need these files for the tests to run.

I'm looking at fixing this myself, but not sure on what the best approach would be. Maybe adding an option to the test_data to ignore .gitignore?

MacOS: Unexpected end of JSON with Xcode CommandLineTools

Using dingy to test for arm-unknown-linux-gnueabihf , I end up with an Unexpected end of JSON :

cargo dinghy test --all --env RUST_BACKTRACE=1 --target=arm-unknown-linux-gnueabihf Unexpected end of JSON

the failing code is https://github.com/snipsco/dinghy/blob/master/src/ios/mod.rs#L237
xcrun simctl list --json devices

Even though one is not using any ios devices and limit himself to android or arm : the test is executed anyway
https://github.com/snipsco/dinghy/blob/master/src/lib.rs#L64

workaround : switching to Xcode solve the issue :
xcode-select --switch /Applications/Xcode.app

Allow specifying port number for ssh

I have ssh on port other than 22 so need to allow it to be overridden.

I have a branch with this change in, just waiting for my previous PR to be merged before submitting.

test-app build fails with unable to find library -lgcc

I'm a beginner with Android cross-compiling. I fail to compile the dinghy test app, what can be wrong?

$ git log -1                                                              dinghy/git/main 
commit 5426bb371a62c6021abd2e1d30e7f9dbfbda357b (HEAD -> main, origin/main, origin/HEAD)
Author: Mathieu Poumeyrol <[email protected]>
Date:   Thu Nov 4 10:51:14 2021 +0100

    post-release 0.4.64-pre

$ cargo dinghy -V
dinghy 0.4.63

$ echo $ANDROID_NDK_HOME 
/home/td/Android/android-ndk-r23b

$ cargo dinghy -d Android --platform auto-android-armv7 test
[2021-11-12T16:56:46Z INFO  cargo_dinghy] Targeting platform 'auto-android-armv7' and device 'XEDDU18124004545'
   Compiling test-app v0.1.0 (/tmp/dinghy/test-ws/test-app)
error: linking with `/tmp/dinghy/test-ws/target/armv7-linux-androideabi/auto-android-armv7/linker` failed: exit status: 1
  |
  = note: "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/auto-android-armv7/linker" "-Wl,--allow-multiple-definition" "-march=armv7-a" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.155zmvuipkyqc9fs.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.1fxpeynjk4v2vm31.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.1jw9wcob0na7cktv.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.1v512u3hgwjmabxd.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.1xapapp4r8tc8ibi.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.23315aplnzqczrx8.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.24izc5d48f5v9ai.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.264zbsugsmizaixg.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.26ysm4dtifv1fm2g.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.2e2ffsa1y5useq17.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.2ig8o2x9b5y1deix.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.2lo51p639r01k2z6.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.2lu174f67zrxv8bj.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.2n2hz55v6zvgqt4w.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.2pn6s3vrssbt1gxu.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.3dra06vnszgsyvaj.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.3le0ve9x1a7r1sih.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.3ltp5kxeisgxjipy.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.3oec4303p22mzxzv.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.3z3s14x2evdtuev3.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.453xp6ou8r9sbuw6.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.49ax5hnllnzjnxks.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.49bhychz5061snut.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.4cyiakxfcu2x9n2f.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.4idxbqm9rwlecv7.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.4lcv5fhr84qe7zxk.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.4na31hnr88d6zznm.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.4nxuekkazcubuz87.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.4w428jce0dznbp2d.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.4wdvhduammy6klcp.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.50ko6zv76grom3r7.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.51nfqya74d9nkqoa.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.55f29yix9hpwpnnh.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.5d06ddmvk7wpa2hd.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.5dtc3y8feyjjek9s.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.5fql54f0hec35j04.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.ev1dxbz5gksbg6n.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.fo4jth8ii18mfnt.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.n757p5jy360ikng.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.rspnvyvzbu28gan.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.uywk5watx4l0x9j.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.xhrsq43f4ny3iah.rcgu.o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa.28q9g37otcvnwbg5.rcgu.o" "-Wl,--as-needed" "-L" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps" "-L" "/tmp/dinghy/test-ws/target/debug/deps" "-L" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib" "-Wl,-Bstatic" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libtest-f9bbd00a44766c01.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libgetopts-370e8b69214b39ce.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libunicode_width-79e14557f0250d5a.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/librustc_std_workspace_std-b45722d779702107.rlib" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/libdinghy_test-100c982e69fca2f3.rlib" "-Wl,--start-group" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libstd-7c7e45d534f8fa06.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libpanic_unwind-ad6934d3cf1c0d0b.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libminiz_oxide-c7baf1454b30cefe.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libadler-67d8db4698d3f246.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libobject-fb0d41ef8e8c5cc4.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libaddr2line-3f43442ea174ea94.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libgimli-56e04e7d1611cfa9.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libstd_detect-690ab2226f8a185a.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/librustc_demangle-4c6146b4ac94eea2.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libhashbrown-3628e66666682011.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/librustc_std_workspace_alloc-05e088fb67d48d33.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libunwind-07b063e47dc4d93a.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libcfg_if-80596e8aedaede48.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/liblibc-4c68357613d22201.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/liballoc-dfb256f061df33b9.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/librustc_std_workspace_core-5e1546e12d1faa33.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libcore-3f0b412fc12ff4a4.rlib" "-Wl,--end-group" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-891f4b491d25d70e.rlib" "-Wl,-Bdynamic" "-ldl" "-llog" "-lgcc" "-lc" "-lm" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib" "-o" "/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/test_app-d3301fa506692ffa" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-fuse-ld=lld"
  = note: ld.lld: error: unable to find library -lgcc
          clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
          

[2021-11-12T16:56:46Z ERROR cargo_dinghy] could not compile `test-app` due to previous error
    
    Caused by:
        process didn't exit successfully: `rustc --crate-name test_app --edition=2018 test-app/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=d3301fa506692ffa -C extra-filename=-d3301fa506692ffa --out-dir /tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps --target armv7-linux-androideabi -C linker=/tmp/dinghy/test-ws/target/armv7-linux-androideabi/auto-android-armv7/linker -C incremental=/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/incremental -L dependency=/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps -L dependency=/tmp/dinghy/test-ws/target/debug/deps --extern dinghy_test=/tmp/dinghy/test-ws/target/armv7-linux-androideabi/debug/deps/libdinghy_test-100c982e69fca2f3.rlib -C link-arg=-fuse-ld=lld` (exit status: 1)

sysroot not found for LEDE/OpenWrt targets

First of all, thank you for the development for such an non-trivial tool.
I have followed your documentation and have hit the following problem:

 ERROR cargo_dinghy > Error: no sysroot found in toolchain "/my/path/to/toolchain/lede-meta/build/zynq/lede/staging_dir/toolchain-arm_cortex-a9+neon_gcc-5.4.0_musl-1.1.16_eabi"

The toolchain generated by Lede/OpenWRT doesn't have the expected layout.

Why do you need the full sysroot in the first place? Cargo is able to cross compile the full executable as well as only the test configuration. It is just not able to deploy and run the cross compiled tests...:

cargo test --target=arm-unknown-linux-musleabi
Syntax error: word unexpected (expecting ")")
error: test failed, to rerun pass '--bin foo' 

Running the test failed obviously, however I can do the manual steps:

scp target/arm-unknown-linux-musleabi/debug/foo-2794d1068ffc6a94 [email protected]:~/ 
ssh [email protected] -C ./foo-2794d1068ffc6a94

The only thing for the cross compilation to work is local project's cargo config that specifies the required linker:

cat .cargo/config
[target.arm-unknown-linux-musleabi]
linker = "arm-openwrt-linux-muslgnueabi-gcc"

I believe cargo now has full information to build the project assuming my cross toolchain is accessible in the path - and this is trivial to achieve. Maybe I am not seeing any of the details, however in case of android toolchain I would assume this would be roughly the same, too.

Thank you for any input on this topic.

Link error when executing 'cargo install dinghy'

I'm not actually able to compile and install dinghy on my local machine as the linker command fails:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" [truncated, whole bunch of rlibs] "-framework" "MobileDevice" "-l" "iconv" "-framework" "Security" "-framework" "CoreFoundation" "-l" "ssl" "-l" "crypto" "-framework" "CoreFoundation" "-l" "curl" "-l" "z" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m"
  = note: Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _git_path_iconv in liblibgit2_sys-ce5bbe4559aebb33.rlib(path.c.o)
     (maybe you meant: _git_path_iconv_init_precompose, _git_path_iconv , _git_path_iconv_clear )
  "_iconv_open", referenced from:
      _git_path_direach in liblibgit2_sys-ce5bbe4559aebb33.rlib(path.c.o)
      _git_path_iconv_init_precompose in liblibgit2_sys-ce5bbe4559aebb33.rlib(path.c.o)
      _git_path_diriter_init in liblibgit2_sys-ce5bbe4559aebb33.rlib(path.c.o)
  "_iconv_close", referenced from:
      _git_path_direach in liblibgit2_sys-ce5bbe4559aebb33.rlib(path.c.o)
      _git_path_iconv_clear in liblibgit2_sys-ce5bbe4559aebb33.rlib(path.c.o)
      _git_path_diriter_free in liblibgit2_sys-ce5bbe4559aebb33.rlib(path.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It seems strange since a standalone cargo project referring just to git2 seems to compile OK. I'm not quite sure what it could be or how to fix it at this point.

Possible refs:

rust-lang/cargo#1032
ogham/exa#67

test --no-fail-fast is not recognized

romanov@WIN-ETK2ST62JCS:/mnt/e/MyProgramming/tokenizers/tokenizers$ CXXSTDLIB=c++ TARGET_CXXFLAGS="-frtti -fexceptions" cargo dinghy -d c1bae23f test --no-fail-fast
error: Found argument '--no-fail-fast' which wasn't expected, or isn't valid in this context
        Did you mean --no-default-features?

USAGE:
    cargo-dinghy test --no-default-features

(for https://github.com/huggingface/tokenizers project).

It looks like support was added in 9534035, but then removed.

Dinghy on Linux

Hi, I had trouble when using Dinghy on Linux. After a couple hours of debugging I found 2 issues:

  1. It seem the path to Android NDK is different on Linux (or did they change it? I don't remember). I installed the NDK using Android Studio SDK manager, and it puts the NDK at $ANDROID_SDK_ROOT/ndk/21.3.6528147 where 21.3.6528147 is the NDK version. It looks like you can install multiple versions of NDK from the SDK manager now.

    Since the NDK location is different than what Dinghy expected, Dinghy fails to guess the NDK location.

  2. When Dinghy fails to guess the location of NDK it would assume that Android platforms is non existent without warning. Eventhough it found Android SDK and found that there is an Android emulator connected.

The workaround is to explicitly set the NDK location for Dinghy:

export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/21.3.6528147

But I think there are few improvements that can be made:

For the first issue, I'm not sure if it is Linux specific or it just the new default path for NDK. I think we should also check if NDK exist there.

For the second issue, I think we should also print out a message when Dinghy did not found the NDK location when the verbose flag is specified.

What do you think?

Fails to sign when there is any non .mobileprovision file in Profiles folder

Hi! I'm blessed to find this amazing tool folks and I can't tell how thankful I am:)!

However, there is an issue that puzzled me for a day to the point I almost gave up. If there is any file (that is not provision profile) or folder with update date higher then our Dinghy provisioning profile, then it fails with not too descriptive Rust error "failed to fill whole buffer".

So for example if you view the folder with Finder (like we - guys coming from Windows - usually do with visual tools and not cmd :D ), then .DS_Store file is always updated or if you happen to create some folder to backup some profiles - anything that is not signing profile with higher date will cause Dinghy to read it first and exit with the confusing error message.

I will try to do the PR for the fix - it's in xcode.rs:124, but if you'd be faster to fix, I won't be jealous I promise since I'm pretty new to Rust.

Again many thanx for the great tool.

You guys rock!

Error installing dinghy

It seems that dinghy currently doesn't build:

error[E0283]: type annotations required: cannot resolve `std::path::Component<'_>: std::convert::AsRef<_>`
   --> src/lib.rs:152:46
    |
152 |         if path.components().any(|comp| comp.as_ref() == "target" ) {
    |                                              ^^^^^^

error: aborting due to previous error

error: failed to compile `dinghy v0.2.15`, intermediate artifacts can be found at `/var/folders/mm/y444qqwd0kn52fycyz6nsph40000gn/T/cargo-install.m0ljJEc7Mo0Q`

Caused by:
  Could not compile `dinghy`.

Android emulator support?

It is not clear from the docs whether dinghy supports running on the Android emulator.

Is it supported?

Old android device using ro.product.cpu.abi rather than ro.product.cpu.abilist

First off, nice job with dinghy! It seems really handy.

I'm trying to use it to run tests on an old Samsung S4 Mini. Out of the box it doesn't work, failing with:

> cargo dinghy -d android test
ERROR cargo_dinghy > Error: No device and platform combination found for device hint `android'

After a bit of googling, on a hunch I cloned the repo and did a local build, and got it working with two changes to android/device.rs:

line 25: "ro.product.cpu.abilist" to "ro.product.cpu.abi"
line 34: "armv7-linux-androideabi" to "arm-linux-androideabi"

Using NDK 21.0.6113669 installed via an Android Studio I installed today.

I literally just got into android development, so I'm not sure if you could do a fallback to look for the older key if the lookup fails or the implications of changing that triple, but do you think it might be possible to add this support more generally?

Copies libdl.so to Android, causing failure to run

Running tests or benches for my crate on Android gives me
CANNOT LINK EXECUTABLE "/data/local/tmp/dinghy/microscope-6f3350548eff39a3/_dinghy_microscope-6f3350548eff39a3": cannot locate symbol "android_get_application_target_sdk_version" referenced by "/apex/com.android.runtime/lib64/bionic/libc.so".... That's with API 26 - using API 30 gives me a segfault instead.

I can run the binary directly in adb shell without error, and I can reproduce the error by adding /data/local/tmp/dinghy/overlay/ to LD_LIBRARY_PATH as dinghy does. That folder contains only libdl.so and libdl.a.

I've been able to work around the problem by making is_banned in src/compiler.rs explicitly exclude libdl the same way it excludes libstdc++. Whether that's the right fix though, I don't know. Certainly, libdl is not your average .so - the android linker knows about it and redirects things that depend on it to call into the linker instead.

Refactoring some common logic into a library

Hi,

Would you be open to a PR where I factor some code out into a common sub-crate? Or alternatively I would just create a new git repo and then I could submit a PR request to dinghy to use some of the shared logic?

After chatting with Alex from the Rust team, it seems they'd much prefer I put all the logic in Rust rather than Python, so by doing this we'd be able to use that logic in dinghy but also in the rust compiler.

Alternatively I could just copy/paste instead of creating a dependency in Dinghy; the code is small enough that I guess that would be OK too.

Support building crates that use resolver 2

If a crate (or any of its dependencies) has opted in to resolver 2, it won't currently build with dinghy. The 2021 edition will make resolver 2 the default for new crates (rust-lang/cargo#9048), so this will probably become a widespread issue over time.

To reproduce, create a new empty library like cargo new resolver_2_test --lib, then add resolver = "2" to resolver_2_test/Cargo.toml. Then run dinghy as normal with cargo dinghy -d rust_test_simulator test, and you'll get the following error:

[2021-07-27T20:59:01Z ERROR cargo_dinghy] failed to parse manifest at `/Users/.../resolver_2_test/Cargo.toml`

    Caused by:
        feature `resolver` is required

        this Cargo does not support nightly features, but if you
        switch to nightly channel you can add
        `cargo-features = ["resolver"]` to enable this feature

Rust 2021 Edition

When using cargo-dinghy for a project based on the Rust 2021 edition with this command:

cargo dinghy --platform auto-ios-x86_64 test

I get the following errors:

[2022-03-06T18:02:20Z INFO  cargo_dinghy] Targeting platform 'auto-ios-x86_64' and device 'D9450570-89F6-4EE7-9150-FF2FE599AD57'
[/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/dinghy-lib-0.4.62/src/ios/platform.rs:70] &self.toolchain = Toolchain {
    rustc_triple: "x86_64-apple-ios",
}
[2022-03-06T18:02:47Z ERROR cargo_dinghy] failed to parse manifest at `/Users/runner/work/godot-rust/godot-rust/gdnative-core/Cargo.toml`
    
    Caused by:
        feature `edition2021` is required
        
        consider adding `cargo-features = ["edition2021"]` to the manifest

See also the corresponding CI run.

Is there something that can be done on my side, or does cargo-dinghy itself need to update to Rust 2021 (and MSRV 1.56)?

.pc files are created with the name of the platform

they should be named against the libraries instead

steps to reproduce :

  • create a platform definition named device
  • create an overlay named 'mylib' with no *.pc and just one lib
  • watch dinghy generating a pc for named device.pc instead of mylib.pc

mitigation :

  • always create a pc file for each overlay
  • renamed and move the generated pc files to the overlay

Fails to sign iOS app when there is more recent auto-signing .mobileprovision file in Profiles folder

Hi - this one id related to #77 .

Dinghy also fails to sign app bundle when it discovers first any auto-signing profile (XCode-created provisioning profiles - with names starting with XC) with App Bundle ID with *.Dinghy pattern. This also implies that one actually still needs Apple Developer (paid) Account to be able to generate Manual provisioning profiles on XCode that can be used by Dinghy?

Failure linking backtrace-sys on android: undefined reference to 'getpagesize'

Maybe not a dinghy error, but I'm stuck and don't know what to do :-( Should I use different api level? Different NDK version? What I do currently and fail:

I'm using ndk-bundle from Android Studio. Content of source.properties:

Pkg.Desc = Android NDK
Pkg.Revision = 16.1.4479499

I built the toolchain with
./build/tools/make_standalone_toolchain.py \/ho~7-a --api 18 --install-dir toolchains/armv7-18

Content of ~/.dinghy.toml:

[platforms.android-armv7]
rustc_triple="armv7-linux-androideabi"
toolchain="/home/td/Android/Sdk/ndk-bundle/toolchains/armv7-18"

I try to build the following project:

Cargo.toml

[package]
name = "test-backtrace"
version = "0.1.0"
authors = ["Tomas Dvorak <[email protected]>"]

[dependencies]
backtrace="0.3"

src/main.rs

extern crate backtrace;
use backtrace::Backtrace;
fn main() {
    let bt = Backtrace::new();
    println!("{:?}", bt);
}

I do a

cargo dinghy -d android build

test-backtrace/git/master cargo dinghy -d android build
 INFO  cargo_dinghy > Targeting platform 'android-armv7' and device '4200867ce05ba3fb'
   Compiling cc v1.0.10
   Compiling rustc-demangle v0.1.7
   Compiling libc v0.2.40
   Compiling cfg-if v0.1.2
   Compiling backtrace-sys v0.1.16
   Compiling backtrace v0.3.6
   Compiling test-backtrace v0.1.0 (file:///tmp/test-backtrace)
error: linking with `/tmp/test-backtrace/target/armv7-linux-androideabi/android-armv7/linker` failed: exit code: 1
  |
  = note: "/tmp/test-backtrace/target/armv7-linux-androideabi/android-armv7/linker" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--allow-multiple-definition" "-march=armv7-a" "-L" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace0.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace1.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace10.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace11.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace12.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace2.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace3.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace4.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace5.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace6.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace7.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace8.rcgu.o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.test_backtrace9.rcgu.o" "-o" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/test_backtrace-66c659bd1ccd3d09.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps" "-L" "/tmp/test-backtrace/target/debug/deps" "-L" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/build/backtrace-sys-db33a1232efa21a3/out/.libs" "-L" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib" "-Wl,-Bstatic" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/libbacktrace-d2ed26e03b069ed7.rlib" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/libbacktrace_sys-4a74d434a9e6ca9d.rlib" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/libcfg_if-8465f4735353df87.rlib" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/liblibc-04845f02d46806fc.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libstd-b0da19f2d692501d.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libpanic_unwind-242eaced57051917.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/liballoc_jemalloc-26f7e4cbe93f7672.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libunwind-6331842fea676519.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/liballoc_system-133ce0bbc9bd63ed.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/liblibc-8e0555f144f880a6.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/liballoc-86980ccd7d424d3c.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libstd_unicode-c637fe1b1e39daa3.rlib" "/tmp/test-backtrace/target/armv7-linux-androideabi/debug/deps/librustc_demangle-cacda5c5d2875c10.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libcore-5c39c43032358f5e.rlib" "/home/td/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-3b0ffcc5dfdf46ec.rlib" "-Wl,-Bdynamic" "-l" "dl" "-l" "log" "-l" "gcc" "-l" "gcc" "-l" "c" "-l" "m"
  = note: /home/td/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace/mmapio.c:63: error: undefined reference to 'getpagesize'
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

Thank you for any ideas.

Error when I try to use dinghy

ken@ken-XPS-13-9360:~/rust/dinotree$ cargo dinghy build
No such file or directory (os error 2)

dinghy devices correctly shows android device.

How to build with non-default crate features?

Hello!

We are trying to use dinghy to cross-compile and run benchmarks on android (and on the raspberry pi in the future).

Previously we have built the project with the following command:

cargo build --target aarch64-linux-android --release --lib --no-default-features --features "android_build"

As you can see we disable default features and enable the "android_build" feature. This is because there are certain dependencies in our project that won't work on android and we also have some dependencies that are only needed for android.

I've tried to run the benchmarks with all of these:

cargo dinghy -d android bench --no-default-features --features "runtime/android_build"
cargo dinghy -d android bench --no-default-features --features runtime/android_build
cargo dinghy -d android bench --no-default-features --features "android_build"

But they all cause the error message:

[2021-01-21T12:29:36Z ERROR cargo_dinghy] cargo does not support --features flag when building from root of workspace

The project isn't a workspace so it seems like dinghy makes it a workspace to perfom the builds. How do I enable or disable crate features when using dinghy?

failed to compile cargo-dinghy v0.3.2 - multiple packages link to native library git2

with rustc 1.27.0-beta.6 (60d8c667f 2018-05-21)

error: failed to compile `cargo-dinghy v0.3.2`, intermediate artifacts can be found at `/tmp/cargo-installJC5Rne`

Caused by:
  multiple packages link to native library `git2`, but a native library can be linked only once

package `libgit2-sys v0.6.19`
    ... which is depended on by `cargo v0.24.0`
    ... which is depended on by `cargo-dinghy v0.3.2`
links to native library `git2`

package `libgit2-sys v0.7.1`
    ... which is depended on by `git2 v0.7.1`
    ... which is depended on by `git2-curl v0.8.1`
    ... which is depended on by `cargo v0.27.0`
    ... which is depended on by `dinghy-lib v0.3.4`
    ... which is depended on by `cargo-dinghy v0.3.2`
also links to native library `git2`

Add android app platform version to specify/match a minSdk Version

Hey,
on older android versions (< 7) I have the following error while loading a library created with cargo dinghy in my activity:

companion object {
        init {
            System.loadLibrary("my")
        }
    }
    java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__gnu_Unwind_Find_exidx" referenced by "/data/app/<package>/lib/arm/libmy.so"...

"__gnu_Unwind_Find_exidx"
"__register_atfork"
or other "symbols" on different devices

Newer Android versions do not have this problem. I guess that is a problem with the APP_PLATFORM variable for android ndk builds? This version should be not lower than the android os version (api version)?

Is there a possible way to specify this APP_PLATFORM Version?

Best regards :)

Cannot run tests on iOS 14 device

Hi,
When I tried to run my test with the command cargo dinghy -d iphone test I got the following error:

[2021-03-15T14:19:28Z ERROR cargo_dinghy] error: e8000022

I get the same error when I run cargo dinghy -d iphone lldbproxy.
My package compiles without problems. I guess it is related to this ios-control/ios-deploy#469 (comment).

Specs:

  • iPhone 8, iOS 14.4.1
  • macOS 11.2.2, Xcode 12.4

run cargo examples?

Hello, Thanks for this utility. It's great. I was struggling to run some cargo tests on Android until I found this and it worked on the first try ;)

Quick question, is there a way to run cargo examples too? I have some more complex tests that run on desktop using: cargo run --example NAME. It would be great to support this feature.

If not possible with dinghy, do you know whats the best way to do it? Creating a shared library and a full android studio project seems like a lot of work for some quick tests, there should be a easier way :)

Can't determine where tests panicked on iOS.

I have tests that access file system and network interfaces, and the code tested panics when runs on my iPhone. Here's the output:

(lldb) command source -s 1 '/var/folders/nt/ycrcdlzj7t90hdmzpyt6jqj40000gn/T/mobiledevice-rs-lldb.59rBGgfsFD4l/lldb-script'

running 1 test
test data_files ... FAILED

failures:

---- data_files stdout ----
thread 'data_files' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    data_files

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

 ERROR cargo_dinghy > Error: LLDB returned error code Some(101)
stack backtrace:
   0:        0x10db543fe - backtrace::backtrace::trace::hc8118fbba0127c20
   1:        0x10db551cc - <backtrace::capture::Backtrace as core::default::Default>::default::h8fba7e19f94a2479
   2:        0x10db5524d - backtrace::capture::Backtrace::new::h1b88bb7cfb77806c
   3:        0x10d685177 - error_chain::make_backtrace::h69a0b27a79a617a4
   4:        0x10d685208 - <error_chain::State as core::default::Default>::default::hb857561dc1f50632
   5:        0x10d649c85 - dinghy_lib::device::ios::run_remote::hb4ec3da983800656
   6:        0x10d63c57a - <dinghy_lib::device::ios::IosDevice as dinghy_lib::Device>::run_app::h4e1b394ec9bd9859
   7:        0x10d56ab6c - cargo_dinghy::prepare_and_run::h8f17db4f72955880
   8:        0x10d56929d - cargo_dinghy::main::h80243af41f4e7bf2
   9:        0x10d571505 - std::rt::lang_start::{{closure}}::hca1d6f3fa4a4acce
  10:        0x10dbd5be7 - std::panicking::try::do_call::hcfe6ac53944e0624
  11:        0x10dbe532e - ___rust_maybe_catch_panic
  12:        0x10dbcba4c - std::rt::lang_start_internal::hb972e1f76be57958
  13:        0x10d56b98b - _main

The error message points to the core lib, which is not very helpful, and the backtrace doesn't seem to show where the panic was.

How can I see more detailed error logs?

Dinghy with ARMv7M (Ledger Nano S)

Targeting Raspberry Pi is definitely cool, but what about going further to ARMv7M ?!) Investigating it right now - but if you see any obvious immediate blockers that I'm missing, would be very thankful to get notified in advance before investing too much ๐Ÿ˜ƒ

cargo install dinghy takes too long

I don't know if something can be done about this (if dinghy must depend on cargo then probably not), but it currently takes ~7 minutes to cargo install dinghy in travis-ci. One can use Travis cache: cargo as a workaround, but there must be a better way.

Support for aarch64-apple-ios-sim in dinghy

With the new M1 Macbooks and as of rust 1.56, you can compile stuff to aarch64-apple-ios-sim.

It's not super needed as macOS on the M1 supports running x86_64-apple-ios in the simulator so this would just be a nice-to-have.

Benchmarking errors due to insufficient permissions for using Criterion

Hi again!) Probably minor thing but I'm getting errors due to insufficient permissions when using Criterion on iOS. Would be nice to fix it either with optional parameter or simply by providing sufficient permissions to the Dinghy app. Again - if I will be faster will gladly do PR with fix, but you guys are welcome to overtake ๐Ÿ˜‰

Benchmarking keygen: AnalyzingCriterion.rs ERROR: error: Failed to access file "target/criterion/keygen/new": Operation not permitted (os error 1)
Criterion.rs ERROR: error: Failed to access file "target/criterion/keygen/new/tukey.json": No such file or directory (os error 2)
Criterion.rs ERROR: error: Failed to access file "target/criterion/keygen/new/sample.json": No such file or directory (os error 2)
Criterion.rs ERROR: error: Failed to access file "target/criterion/keygen/new/estimates.json": No such file or directory (os error 2)

dinghy_test::test_file_path doesn't work when running tests natively on desktop platform

I tried out dinghy at work where we have some cross-platform Rust code but aren't currently running our Rust tests on any mobile platforms. I got things to work without a lot of trouble (very cool!) but one of our tests had additional data files so I followed the sending more files directions and using dinghy_test::test_file_path worked fine running the tests on Android. However, when I tried to run the tests natively on my mac using cargo test it would fail with Couldn't find test data .... I looked briefly at the dinghy-test source and while there seems to be a branch for non-mobile platforms I'm guessing this isn't exactly supported. I wound up just using cfg to use the existing hardcoded paths to the test files on non-mobile which isn't great but works.

It'd be nice if dinghy_test worked for native desktop tests as well or if at least the documentation reflected the fact that you shouldn't use it for non-mobile testing.

paths for .dinghy.toml

The current loop stop a bit too early, skipping /.dinghy.toml

Also, ~/ should be tried.

Cannot detect simulator instance

I always getting error no valid simulator instance but sim is already started and initially detected by dinghy.

    Finished dev [unoptimized + debuginfo] target(s) in 35.92 secs
(lldb) command source -s 1 '/var/folders/cr/y1wtyb1n2y777n_vwf22z9w00000gn/T/mobiledevice-rs-lldb.Gqd3iLNaZcr6/lldb-script'
process left in lldb state: invalid
error: no valid simulator instance
(lldb) command source -s 1 '/var/folders/cr/y1wtyb1n2y777n_vwf22z9w00000gn/T/mobiledevice-rs-lldb.V02por2HXcEI/lldb-script'
process left in lldb state: invalid
error: no valid simulator instance
~/Developer/Projects/test-proj > cargo dinghy devices
IosSimDevice { id: "796ABB82-3E3B-4DB3-AD49-5153E9CA32F9", name: "iPhone 4s", os: "9.1" }
~/Developer/Projects/test-proj > lldb --version
lldb-900.0.57
  Swift-4.0

Another try:

~/Developer/Projects/test-proj > cargo dinghy devices
IosSimDevice { id: "93447327-AC8C-48FF-B4ED-B3C9614CBFE3", name: "iPhone 4s iOS 8.4", os: "8.4" }
~/Developer/Projects/test-proj > cargo dinghy test
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
(lldb) command source -s 1 '/var/folders/cr/y1wtyb1n2y777n_vwf22z9w00000gn/T/mobiledevice-rs-lldb.n25n5Hu6vJtV/lldb-script'
process left in lldb state: invalid
error: no valid simulator instance
(lldb) command source -s 1 '/var/folders/cr/y1wtyb1n2y777n_vwf22z9w00000gn/T/mobiledevice-rs-lldb.kDQwoGcqnOCU/lldb-script'
process left in lldb state: invalid
error: no valid simulator instance

Should benchmarks return performance numbers?

I just set up testing rand with dinghy. Installing the android sdk and dinghy was reasonably easy!

cargo dinghy test works as expected, and all tests pass ๐Ÿ˜„.

But is cargo dinghy bench only expected to run benchmarks as tests, returning ok instead of performance numbers? Asking here just in case this is intended before looking much further.

My system: Fedora Linux, with adb from Fedora, and a downloaded android-ndk-r16b. My phone is an Android Motorola G3, and for rust I am using the latest nightly, but also no luck with a nightly from three months ago.

`catch_unwind` broken on `armv7-apple-ios`

Tried the following on my iPad (1st generation, iOS 9.3.6), not sure if this is a Dinghy error or a rustc error?

// main.rs
fn main() {
    let res = std::panic::catch_unwind(|| {
        panic!("test");
    });
    println!("{:?}", res);
}
# Cargo.toml
[package]
name = "ios-panic"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "ios-panic"
path = "main.rs"
# .cargo/config.toml
[unstable]
# To allow building for armv7-apple-ios
build-std = ["core", "alloc", "std"]

Run with RUST_LOG=dinghy=debug cargo +nightly dinghy --device ipad run.

Traceback:

[2022-06-13T20:43:37Z DEBUG dinghy_lib::android] ADB found: "$HOME/Library/Android/sdk/platform-tools/adb"
[2022-06-13T20:43:37Z DEBUG dinghy_lib::android] Candidates SDK: []
[2022-06-13T20:43:37Z DEBUG dinghy_lib::android] Android NDK not found
[2022-06-13T20:43:38Z DEBUG dinghy_build::build_env] Setting environment variable "TARGET_CC"="gcc"
[2022-06-13T20:43:38Z DEBUG dinghy_build::build_env] Setting environment variable "CC_armv7-apple-ios"="gcc"
[2022-06-13T20:43:38Z DEBUG dinghy_build::build_env] Setting environment variable "TARGET_SYSROOT"="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk"
[2022-06-13T20:43:38Z DEBUG dinghy_build::build_env] Setting environment variable "CARGO_TARGET_ARMV7_APPLE_IOS_LINKER"="$PROJECT/target/armv7-apple-ios/auto-ios-armv7/linker"
[$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/dinghy-lib-0.4.71/src/ios/platform.rs:70] &self.toolchain = Toolchain {
    rustc_triple: "armv7-apple-ios",
}
[2022-06-13T20:43:38Z DEBUG dinghy_build::build_env] Setting environment variable "PKG_CONFIG_ALLOW_CROSS"="1"
[2022-06-13T20:43:38Z DEBUG dinghy_build::build_env] Setting environment variable "PKG_CONFIG_LIBPATH_armv7_apple_ios"=""
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
[2022-06-13T20:43:38Z DEBUG dinghy_lib::compiler] Found libraries {}
[2022-06-13T20:43:38Z DEBUG dinghy_lib::ios::xcode] signing identities: [SigningIdentity { id: "[redacted]", name: "Apple Development: [email protected] ([redacted])", team: "[redacted]" }]
[2022-06-13T20:43:38Z DEBUG dinghy_lib::ios::xcode] considering profile "$HOME/Library/MobileDevice/Provisioning Profiles/034e9187-22e8-4c95-9677-5da2f5be907b.mobileprovision"
[2022-06-13T20:43:38Z DEBUG dinghy_lib::ios::xcode] considering profile "$HOME/Library/MobileDevice/Provisioning Profiles/5b3f5cb9-37e6-4157-a037-34acce372470.mobileprovision"
[2022-06-13T20:43:38Z DEBUG dinghy_lib::ios::xcode]   app in profile does not match (iOS Team Provisioning Profile: dk.marquart.mobile-test)
[2022-06-13T20:43:38Z DEBUG dinghy_lib::device] Removing previous bundle "$PROJECT/target/armv7-apple-ios/debug/dinghy/ios-panic-unwind/Dinghy.app"
[2022-06-13T20:43:38Z DEBUG dinghy_lib::device] Making bundle "$PROJECT/target/armv7-apple-ios/debug/dinghy/ios-panic-unwind/Dinghy.app"
[2022-06-13T20:43:38Z DEBUG dinghy_lib::device] Copying exe "$PROJECT/target/armv7-apple-ios/debug/ios-panic-unwind" to bundle "$PROJECT/target/armv7-apple-ios/debug/dinghy/ios-panic-unwind/Dinghy.app/_dinghy_ios-panic-unwind"
[2022-06-13T20:43:38Z DEBUG dinghy_lib::device] Copying dynamic libs to bundle
[2022-06-13T20:43:38Z DEBUG dinghy_lib::device] Copying src . to bundle $PROJECT/target/armv7-apple-ios/debug/dinghy/ios-panic-unwind/Dinghy.app
[2022-06-13T20:43:38Z DEBUG dinghy_lib::project] Copying recursively from . to $PROJECT/target/armv7-apple-ios/debug/dinghy/ios-panic-unwind/Dinghy.app excluding ["./target"]
[2022-06-13T20:43:38Z DEBUG dinghy_lib::device] Copying test_data to bundle $PROJECT/target/armv7-apple-ios/debug/dinghy/ios-panic-unwind/Dinghy.app
[2022-06-13T20:43:38Z DEBUG dinghy_lib::project] Copying recursively from $PROJECT/target/armv7-apple-ios/debug/ios-panic-unwind to $PROJECT/target/armv7-apple-ios/debug/dinghy/ios-panic-unwind/Dinghy.app/Dinghy excluding []
[2022-06-13T20:43:38Z DEBUG dinghy_lib::ios::xcode] Will sign "$PROJECT/target/armv7-apple-ios/debug/dinghy/ios-panic-unwind/Dinghy.app" with team: 9K7QZYTTLY using key: Apple Development: [email protected] ([redacted]) and profile: $HOME/Library/MobileDevice/Provisioning Profiles/034e9187-22e8-4c95-9677-5da2f5be907b.mobileprovision
[2022-06-13T20:43:38Z DEBUG dinghy_lib::ios::xcode] entitlements file: $PROJECT/target/armv7-apple-ios/debug/dinghy/entitlements.xcent
[2022-06-13T20:43:42Z DEBUG dinghy_lib::ios::device] mount developer image
[2022-06-13T20:43:43Z DEBUG dinghy_lib::ios::device] Looking for device support directory in "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport" for iOS version "9.3.6"
[2022-06-13T20:43:43Z DEBUG dinghy_lib::ios::device] Picked "9.3"
[2022-06-13T20:43:43Z DEBUG dinghy_lib::ios::device] Developer image path: "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/9.3/DeveloperDiskImage.dmg"
[2022-06-13T20:43:43Z DEBUG dinghy_lib::ios::device] AMDeviceMountImage returns: 0
[2022-06-13T20:43:43Z DEBUG dinghy_lib::ios::device] start debugserver on phone
[2022-06-13T20:43:43Z DEBUG dinghy_lib::ios::device] debug server running
[2022-06-13T20:43:43Z DEBUG dinghy_lib::ios::device] start local lldb proxy
[2022-06-13T20:43:43Z DEBUG dinghy_lib::ios::device] started lldb proxy localhost:56093
[2022-06-13T20:43:44Z DEBUG dinghy_lib::ios::device] Looking for device support directory in "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport" for iOS version "9.3.6"
[2022-06-13T20:43:44Z DEBUG dinghy_lib::ios::device] Picked "9.3"
(lldb) command source -s 1 '/var/folders/pj/fqvl2zvs1bv7zf_l2l_tgj5c0000gn/T/mobiledevice-rs-lldb.mOgniAZesVqd/lldb-script'
thread 'main' panicked at 'test', main.rs:3:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'attempt to subtract with overflow', $HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/panic_unwind/src/gcc.rs:309:51
stack backtrace:
thread panicked while panicking. aborting.
process left in lldb state: stopped
thread #1: tid = 0xde9f, 0x23a82c5c libsystem_kernel.dylib`__pthread_kill + 8, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  frame #0: 0x23a82c5c libsystem_kernel.dylib`__pthread_kill + 8
  frame #1: 0x23b2c732 libsystem_pthread.dylib`pthread_kill + 62
  frame #2: 0x23a170ac libsystem_c.dylib`abort + 108
  frame #3: 0x00167d94 Dinghy`std::sys::unix::abort_internal::h2ed838f0f9540198 at mod.rs:290:14
  frame #4: 0x0011abc8 Dinghy`std::panicking::rust_panic_with_hook::h367df0f40dd58875(payload=&mut dyn core::panic::BoxMeUp @ 0x0057eb74, message=Option<&core::fmt::Arguments> @ 0x0057eb7c, location=0x0025c170, can_unwind=true) at panicking.rs:713:9
  frame #5: 0x0011a648 Dinghy`std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::h340976b0ddda462a at panicking.rs:586:13
  frame #6: 0x000e7928 Dinghy`std::sys_common::backtrace::__rust_end_short_backtrace::hc61979b07926d413(f=<unavailable>) at backtrace.rs:138:18
  frame #7: 0x00119eac Dinghy`rust_begin_unwind(info=0x0057ee24) at panicking.rs:584:5
  frame #8: 0x00247dcc Dinghy`core::panicking::panic_fmt::h42253fa52d701b69(fmt=<unavailable>) at panicking.rs:142:14
  frame #9: 0x00247b98 Dinghy`core::panicking::panic::h2d595c1dac7a76e4(expr=(data_ptr = "attempt to subtract with overflow", length = 33)) at panicking.rs:48:5
  frame #10: 0x001d5f10 Dinghy`panic_unwind::real_imp::find_eh_action::h2208c04352ae5ba3(context=0x0057f32c) at gcc.rs:309:51
  frame #11: 0x001d6098 Dinghy`panic_unwind::real_imp::rust_eh_personality_impl::hb9cfcdd77b55d3ff(version=1, actions=_UA_SEARCH_PHASE, _exception_class=5570770221508416340, exception_object=0x15d796c0, context=0x0057f32c) at gcc.rs:238:35
  frame #12: 0x001d62ac Dinghy`rust_eh_personality(version=1, actions=_UA_SEARCH_PHASE, exception_class=5570770221508416340, exception_object=0x15d796c0, context=0x0057f32c) at gcc.rs:291:21
  frame #13: 0x23b42b28 libunwind.dylib`_Unwind_SjLj_RaiseException + 60
  frame #14: 0x001d5bec Dinghy`panic_unwind::real_imp::panic::he35599c6903e9c02(data=alloc::boxed::Box<(dyn core::any::Any + core::marker::Send), alloc::alloc::Global> @ 0x0057f03c) at gcc.rs:62:12
  frame #15: 0x001d3ccc Dinghy`__rust_start_panic(payload=0x0057f198) at lib.rs:109:5
  frame #16: 0x0011ac6c Dinghy`rust_panic(msg=&mut dyn core::panic::BoxMeUp @ 0x0057f198) at panicking.rs:746:9
  frame #17: 0x0011ab58 Dinghy`std::panicking::rust_panic_with_hook::h367df0f40dd58875(payload=&mut dyn core::panic::BoxMeUp @ 0x0057f304, message=Option<&core::fmt::Arguments> @ 0x0057f30c, location=0x002581d4, can_unwind=true) at panicking.rs:716:5
  frame #18: 0x0011a648 Dinghy`std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::h340976b0ddda462a at panicking.rs:586:13
  frame #19: 0x000e7928 Dinghy`std::sys_common::backtrace::__rust_end_short_backtrace::hc61979b07926d413(f=<unavailable>) at backtrace.rs:138:18
  frame #20: 0x00119eac Dinghy`rust_begin_unwind(info=0x0057f5ac) at panicking.rs:584:5
  frame #21: 0x00247dcc Dinghy`core::panicking::panic_fmt::h42253fa52d701b69(fmt=<unavailable>) at panicking.rs:142:14
  frame #22: 0x000d7930 Dinghy`ios_panic_unwind::main::_$u7b$$u7b$closure$u7d$$u7d$::hb341b0be0b951d4c((null)={closure_env#0} @ 0x0057f5e8) at main.rs:3:9
Traceback (most recent call last):
  File "/var/folders/pj/fqvl2zvs1bv7zf_l2l_tgj5c0000gn/T/mobiledevice-rs-lldb.mOgniAZesVqd/helpers.py", line 30, in start
    print("  %s"%(frame))
  File "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python3/lldb/__init__.py", line 6002, in __str__
    return _lldb.SBFrame___str__(self)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd7 in position 88: invalid continuation byte

Try to make the readme a bit more pedagogic?

Issue: the only line in the whole readme that shows how to execute dinghy is the very last line that states cargo dinghy test.

  • First: add a table of contents.

  • Second: add a quick start guide, with two self contained examples, one for ios and one for androd that shows how to get the tests of a very basic Rust project to run. By self contained I mean that somebody that does this for the first time shouldn't need to google anything (for example, how to download, install, start the simulators, etc.).

  • Put "more advanced" features afterwards. Like how to ssh into a phone, copy files, etc. Try to add examples that work (I know this is hard, or might not always be possible, but maybe one can copy files or ssh into a simulator?).

Also, I think dinghy could be very useful for CI on travis against the ios-simulator and the android simulators. It would be great if the travis-ci setup could have some build bots that run the tests of an example project in both (ideally across different Xcode versions and Android NDK versions to make sure dinghy works across the board).

don't work for ios 13.3 on osx 10.15.5

I followed this doc https://github.com/snipsco/dinghy/blob/master/docs/ios.md, it all worked fine until I ran the final test command. I can run the test xcode project on my iphone, but when I ran cargo dinghy -d iphone test it_works, it reported an error.

command:
RUST_BACKTRACE=1 cargo dinghy -d iphone test it_works

output:

[2020-06-10T12:15:03Z INFO  cargo_dinghy] Targeting platform 'auto-ios-aarch64' and device '***'
    Finished debug [unoptimized + debuginfo] target(s) in 0.02s
[2020-06-10T12:15:07Z ERROR cargo_dinghy] error: e80000be

    Stack backtrace:
       0: std::backtrace::Backtrace::create
       1: std::backtrace::Backtrace::capture
       2: dinghy_lib::ios::device::mk_result
       3: dinghy_lib::ios::device::IosDevice::install_app
       4: <dinghy_lib::ios::device::IosDevice as dinghy_lib::Device>::run_app
       5: cargo_dinghy::prepare_and_run
       6: cargo_dinghy::main
       7: std::rt::lang_start::{{closure}}
       8: std::rt::lang_start_internal
       9: main

Here is the environment:
mac:
os version: 10.15.5 (19F101)
xcode version: 11.5 (11E608c)

iphone:
model: iPhone 8
os version: 13.3

What should I do to make it work?

add option to use-or-start ios simulator

It would be great if, like the libc-crate does:

https://github.com/rust-lang/libc/blob/master/ci/ios/deploy_and_run_on_ios_simulator.rs#L59

dinghy could start an ios-simulator.

Maybe dinghy could:

  • have an option to list all simulators installed
  • have an option to select the ios-simulator instance to either use (if its already started) or start

Of course none of this is necessary because users can already do this via the terminal, but I think it would be nice to be able to do this directly via dinghy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.