Skip to content
This repository was archived by the owner on Jan 24, 2022. It is now read-only.

Add qemu example and run in CI #128

Merged
merged 17 commits into from
Sep 24, 2018
Merged

Conversation

sekineh
Copy link
Contributor

@sekineh sekineh commented Sep 20, 2018

As @japaric has suggested I ported lm3s6965evb/src/main.rs into example/qemu.rs.

All errors were fixed, but qemu never exits automatically qemu prints text and exits.

sekineh@sekineh-VirtualBox:~/cortex-m-rt_me$ cargo run --example qemu --target thumbv7m-none-eabi
   Compiling cortex-m-rt v0.6.3 (file:///home/sekineh/cortex-m-rt_me)                                            
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
     Running `qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel target/thumbv7m-none-eabi/debug/examples/qemu`
x = 42
sekineh@sekineh-VirtualBox:~/cortex-m-rt_me$

supported targets

  • thumbv6m-none-eabi
  • thumbv7m-none-eabi

code size

code size is 0, which is apparently wrong:

sekineh@sekineh-VirtualBox:~/cortex-m-rt_me$ size target/thumbv7m-none-eabi/debug/examples/qemu
   text	   data	    bss	    dec	    hex	filename
  10776	      0	      0	  10776	   2a18	target/thumbv7m-none-eabi/debug/examples/qemu

code size (original)

(deleted; different compiler version)

@sekineh sekineh requested a review from a team as a code owner September 20, 2018 17:11
@sekineh
Copy link
Contributor Author

sekineh commented Sep 20, 2018

I can't add example's dependency, so I used dev-dependency.

I'm curious, in Rust 2018, we no longer need extern crates. In that era how rustc knows what lib to be linked for example programs?

@sekineh sekineh changed the title [DOES NOT RUN] Add qemu example [WIP; DOES NOT RUN] Add qemu example Sep 20, 2018
Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

We don't run examples by default so could you add cargo run --example qemu --target $TARGET to ci/script.sh? This should only run when the target is thumbv7m-none-eabi.

examples/qemu.rs Outdated

#[exception]
#[inline(always)]
fn HardFault(_ef: &ExceptionFrame) -> ! {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this (the whole function) is not required because there is a default implementation so it can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

examples/qemu.rs Outdated

#[exception]
#[inline(always)]
fn DefaultHandler(_irqn: i16) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same case as HardFault; this can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

.cargo/config Outdated
@@ -0,0 +1,3 @@
[target.thumbv7m-none-eabi]
# uncomment this to make `cargo run` execute programs on QEMU
runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -semihosting-config enable=on,target=native -nographic -kernel"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot that we didn't have a .cargo/config in this repo. You'll at least need -C link-arg=-Tlink.x to produce a valid binary. It'd be easiest to just copy over this part and you can remove the commented out bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@japaric The above did a trick and qemu now prints and exits as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

examples/qemu.rs Outdated

// hint to the optimizer that any code path which calls this function is statically unreachable
unsafe {
unreachable::unreachable();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to omit this line because this may be run on hardware with semihosting disabled and then debug::exit would return and this line would be executed and that'd be equivalent to UB (undefined behavior). We usually add a loop {} to the end of main to make it type check (since it's a divergent function).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the unsafe block removed.

@japaric
Copy link
Member

japaric commented Sep 20, 2018

I can't add example's dependency, so I used dev-dependency.

Yes, that's OK. Dependencies that are only used by examples should be dev-dependencies. That way they don't get compiled when this crate is compiled as a dependency of another (reduces compile time).

I'm curious, in Rust 2018, we no longer need extern crates. In that era how rustc knows what lib to be linked for example programs?

If you write something like

use foo::bar;

// ..

then rustc assumes that there is an implicit extern crate foo. If you remove foo::bar then the foo crate won't be linked into the final binary.

This crate is still using the 2015 edition though so we still need the extern crates.

@sekineh sekineh changed the title [WIP; DOES NOT RUN] Add qemu example [WIP] Add qemu example Sep 20, 2018
@sekineh
Copy link
Contributor Author

sekineh commented Sep 20, 2018

Thanks, @japaric for the Rust 2018 explanation!

Now CI fails to compile examples/alignment which I didn't touch.

error: linking with `arm-none-eabi-ld` failed: exit code: 1
  |
  = note: "arm-none-eabi-ld" "-L" "/home/sekineh/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/examples/alignment-06b48917f6efb910.58dop9zan5qykfk9.rcgu.o" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/examples/alignment-06b48917f6efb910.9yoz0mdc5sm1bwf.rcgu.o" "-o" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/examples/alignment-06b48917f6efb910" "--gc-sections" "-L" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/deps" "-L" "/home/sekineh/cortex-m-rt_me/target/debug/deps" "-L" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/build/cortex-m-rt-7537c90ef268308e/out" "-L" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/build/cortex-m-45166b3b1442526e/out" "-L" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/build/cortex-m-semihosting-ebe3167ad60cb5a9/out" "-L" "/home/sekineh/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib" "--start-group" "-Bstatic" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/deps/libpanic_halt-6796aabce447fb67.rlib" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/deps/libcortex_m_rt-27e34b108ad68a46.rlib" "/home/sekineh/cortex-m-rt_me/target/thumbv6m-none-eabi/debug/deps/libr0-5eed40e500c728fc.rlib" "/home/sekineh/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib/libcore-b7d265e3e22c7475.rlib" "--end-group" "/home/sekineh/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib/libcompiler_builtins-84c25f489ad2f4af.rlib" "-Tlink.x" "-Tlink.x" "-Bdynamic"
  = note: arm-none-eabi-ld:memory.x:10: warning: redeclaration of memory region `FLASH'
          arm-none-eabi-ld:memory.x:11: warning: redeclaration of memory region `RAM'
          arm-none-eabi-ld: 
          BUG(cortex-m-rt): the reset vector is missing
          arm-none-eabi-ld: 
          BUG(cortex-m-rt): the exception vectors are missing
          arm-none-eabi-ld: 
          There can't be more than 32 interrupt handlers. This may be a bug in
          your device crate, or you may have registered more than 32 interrupt
          handlers.
          arm-none-eabi-ld: 
          BUG(cortex-m-rt): the reset vector is missing
          arm-none-eabi-ld: 
          BUG(cortex-m-rt): the exception vectors are missing
          arm-none-eabi-ld: 
          There can't be more than 32 interrupt handlers. This may be a bug in
          your device crate, or you may have registered more than 32 interrupt
          handlers.

@sekineh
Copy link
Contributor Author

sekineh commented Sep 20, 2018

The failure is due to redundant options
"-Tlink.x" "-Tlink.x"
OK, let's remove the option in script.sh!

@sekineh
Copy link
Contributor Author

sekineh commented Sep 20, 2018

Of course, I also need to install qemu-system-arm in travis image.

@japaric
Copy link
Member

japaric commented Sep 20, 2018

Of course, I also need to install qemu-system-arm in travis image.

You can use addons for that.

@japaric
Copy link
Member

japaric commented Sep 20, 2018

https://travis-ci.org/rust-embedded/cortex-m-rt/jobs/431175116#L891

Interesting. It seems that the version of QEMU that's shipped with Ubuntu trusty doesn't understand the -semihosting-config flag. That's good to know because it means that we should recommend some minimal QEMU version in our docs.

Perhaps it's possible to install qemu-system-arm from debian-sid? That version may be new enough. @sekineh could you try:

addons:
  apt:
    sources:
      - debian-sid
    packages:
      - qemu-system-arm

I think that's the correct syntax.

@japaric
Copy link
Member

japaric commented Sep 24, 2018

@sekineh the debian-sid stuff doesn't work; I tried it in rust-embedded/embedonomicon#24. But you can use this pre-compiled version of QEMU; you can use rust-embedded/embedonomicon#24 as a reference.

@sekineh
Copy link
Contributor Author

sekineh commented Sep 24, 2018

It seems precompiled version is handier than docker images. Thanks.

I’ll do it in this week!

@sekineh sekineh changed the title [WIP] Add qemu example Add qemu example Sep 24, 2018
@sekineh sekineh changed the title Add qemu example Add qemu example and run in CI Sep 24, 2018
@sekineh
Copy link
Contributor Author

sekineh commented Sep 24, 2018

@japaric I think it can be merged.

Notable change other than qemu installation is now both GNU LD and rustc's LLD binaries are run.

@japaric
Copy link
Member

japaric commented Sep 24, 2018

@sekineh Great! Thank you.

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 24, 2018

👎 Rejected by too few approved reviews

@japaric
Copy link
Member

japaric commented Sep 24, 2018

bors r+

bors bot added a commit that referenced this pull request Sep 24, 2018
128: Add qemu example and run in CI r=japaric a=sekineh

As @japaric has suggested I ported `lm3s6965evb/src/main.rs` into `example/qemu.rs`.

All errors were fixed, ~but qemu never exits automatically~ `qemu` prints text and exits.
```
sekineh@sekineh-VirtualBox:~/cortex-m-rt_me$ cargo run --example qemu --target thumbv7m-none-eabi
   Compiling cortex-m-rt v0.6.3 (file:///home/sekineh/cortex-m-rt_me)                                            
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
     Running `qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel target/thumbv7m-none-eabi/debug/examples/qemu`
x = 42
sekineh@sekineh-VirtualBox:~/cortex-m-rt_me$
```
## supported targets

- thumbv6m-none-eabi
- thumbv7m-none-eabi

## code size

~code size is 0, which is apparently wrong:~
```
sekineh@sekineh-VirtualBox:~/cortex-m-rt_me$ size target/thumbv7m-none-eabi/debug/examples/qemu
   text	   data	    bss	    dec	    hex	filename
  10776	      0	      0	  10776	   2a18	target/thumbv7m-none-eabi/debug/examples/qemu
```

## code size (original)
(deleted; different compiler version)

Co-authored-by: Hideki Sekine <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 24, 2018

Build succeeded

@bors bors bot merged commit 1bb0e3f into rust-embedded:master Sep 24, 2018
@qwerty19106
Copy link

qwerty19106 commented Dec 1, 2018

This code not work as expected (.cargo/config):

rustflags = [
  "-C", "link-arg=-Tlink.x"
]

I use cortex-m-rt in examples for my library (Cargo.toml):

[dev-dependencies]
...
cortex-m-rt = "0.6.5"

Examples runs by gitlab-ci and qemu-system-arm to test library.
And I have this code in my .cargo/config:

rustflags = [
  "-C", "link-arg=-Tlink.x"
]

If I run cargo build --target thumbv6m-none-eabi --examples -vv then build is ok:

...
Running `rustc --edition=2018 --crate-name queue_test examples/queue_test.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=f91cd96f99be813e -C extra-filename=-f91cd96f99be813e --out-dir /home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/examples --target thumbv6m-none-eabi -C incremental=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/incremental -L dependency=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps -L dependency=/home/pc/projects/RTX/rtx5-rs/target/debug/deps --extern cortex_m=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps/libcortex_m-e8cb6c6767278d50.rlib --extern cortex_m_rt=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps/libcortex_m_rt-7e1d68603543c834.rlib --extern cortex_m_semihosting=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps/libcortex_m_semihosting-942bbe4afb4f4cf0.rlib --extern generic_array=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps/libgeneric_array-a40d28abb7f82a20.rlib --extern panic_semihosting=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps/libpanic_semihosting-aa34afca846b24f2.rlib --extern rtx5=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps/librtx5-5537d95dc0ad7eec.rlib --extern static_assertions=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps/libstatic_assertions-cd9588aff1ce98b5.rlib --extern vcell=/home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/deps/libvcell-af3aa1e9576ab9ce.rlib -C link-arg=-Tlink.x --cfg 'build="debug"' --cfg armv6m --cfg cortex_m -L /home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/build/cortex-m-7cd0b3e78639a3de/out -L /home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/build/cortex-m-rt-1b084d2e661a7b95/out -L /home/pc/projects/RTX/rtx5-rs/target/thumbv6m-none-eabi/debug/build/cortex-m-semihosting-2e7e5719b20ebe2a/out`
    Finished dev [unoptimized + debuginfo] target(s) in 20.19s

Then I run git clone my_project in other folder, and run cargo build --target thumbv6m-none-eabi --examples -vv.
I got linking error from -C link-arg=-Tlink.x duplicating:

error: linking with `rust-lld` failed: exit code: 1
  |
  = note: "rust-lld" "-flavor" "gnu" "-L" "/home/pc/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.10nzi0anihjf7qc1.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.23betr0gelfpsxh2.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.2fn3hw6luasahg3h.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.3me1t05irsddtz87.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.3nkhenjyyakgztee.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.3yv7we3m9j0sc8k0.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.45cavzs7tpqpnefk.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.4iuj0pn0l5d0bbu5.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.4jme9ju0lq53o8ml.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.4yh5h7szytt1hji0.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.5ae3ogs9xmkmh1xd.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.5bb3w8cl0wher8q6.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.lc5lnsjtnljk0e2.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.r5wa2k15t8foorm.rcgu.o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e.y3n8ymd4k5apumh.rcgu.o" "-o" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/examples/queue_test-f91cd96f99be813e" "--gc-sections" "-L" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps" "-L" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/debug/deps" "-L" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/build/cortex-m-7cd0b3e78639a3de/out" "-L" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/build/cortex-m-rt-1b084d2e661a7b95/out" "-L" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/build/cortex-m-semihosting-2e7e5719b20ebe2a/out" "-L" "/home/pc/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib" "-Bstatic" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/librtx5-5537d95dc0ad7eec.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libgeneric_array-a40d28abb7f82a20.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libtypenum-5f9558c3d66b8ffa.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libstatic_assertions-cd9588aff1ce98b5.rlib" "--start-group" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libpanic_semihosting-aa34afca846b24f2.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libcortex_m_semihosting-942bbe4afb4f4cf0.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libcortex_m-e8cb6c6767278d50.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libvolatile_register-acc56c0cc4ab64d5.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libvcell-af3aa1e9576ab9ce.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libbare_metal-ed8e7edeeabf88b4.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libaligned-0d494abdc33a59b5.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libcortex_m_rt-7e1d68603543c834.rlib" "/home/pc/projects/RTX/rtx5-rs/builds/0/project-0/target/thumbv6m-none-eabi/debug/deps/libr0-b73ecbfdc783a4e5.rlib" "/home/pc/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib/libcore-24f6ed8f521884d1.rlib" "--end-group" "/home/pc/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib/libcompiler_builtins-0e4966fbb420f4dc.rlib" "-Tlink.x" "-Tlink.x" "-Bdynamic"
  = note: rust-lld: error: memory.x:4: region 'FLASH' already defined
          >>>   FLASH : ORIGIN = 0x00000000, LENGTH = 256K
          >>>                                         ^

And on deploy machine I get link error also but sometimes building is good.

If I remove link-arg from .cargo/config then build is ok but binary is wrong (linking by default link script).
And on deploy machine build is ok and binary is ok but sometimes binary is wrong (linking by default link script).

I found such a solution: remove link-arg from .cargo/config and run env RUSTFLAGS="-C link-arg=-Tlink.x" cargo build --target $TARGET --examples. It works always!

I think that cargo does not handle correctly link-arg in .cargo/config in requirements library. It must be only in binary crate.

Please let me know what you think about this.
With respect,
Roman Krivenkov.

@qwerty19106
Copy link

I reproduce problem.

If exists this folder structure:
RustRepo/111/2222/333/OtherRustRepo
when RustRepo/111/2222/333 can have any depth of nesting (for example RustRepo/1/22/3/444/fdf/555/...),
and when RustRepo and OtherRustRepo is bin repository

Then linking of OtherRustRepo (by cargo build) used OtherRustRepo/.cargo/config and RustRepo/.cargo/config. Thus I have -C link-arg=-Tlink.x -C link-arg=-Tlink.x.

It's fantastic!
It break down my code because I use gitlab-runner which create the folder structure RustRepo/builds/0/project-0/CopyOfRustRepo.

I doubt it is bug or feature of cargo?

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

Successfully merging this pull request may close these issues.

3 participants