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

Git cannot be found in $PATH while using cross-rs with git dependencies. #1576

Closed
5 of 11 tasks
david9991 opened this issue Oct 19, 2024 · 1 comment
Closed
5 of 11 tasks

Comments

@david9991
Copy link

Checklist

Describe your issue

Git cannot be found in $PATH while using cross-rs with git dependencies.

Here is my cargo.toml with remote dependencies.

[package]
name = "modbusDriver"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1.35.1", features = ["full"] }
tokio-modbus = { version = "0.14.0", default-features = false, features = [
    "tcp",
] }
dust_dds = { git = "https://github.com/david9991/dust-dds", branch = "workaround" }
dust_dds_derive = { git = "https://github.com/david9991/dust-dds", branch = "workaround" }


[build-dependencies]
tokio = { version = "1.35.1", features = ["full"] }
dust_dds_gen = { git = "https://github.com/david9991/dust-dds", branch = "workaround" }
reqwest = { version = "0.11", features = ["blocking"] }

[workspace.metadata.cross.target.aarch64-unknown-linux-gnu]
pre-build = [
    "dpkg --add-architecture $CROSS_DEB_ARCH",
    "apt-get update && apt-get --assume-yes install git libssl-dev:$CROSS_DEB_ARCH",
    "git version",
]

And here is the output:

#16 [builder 8/8] RUN CROSS_REMOTE=1 DOCKER_HOST=tcp://localhost:2375 cross build --release --target=aarch64-unknown-linux-gnu
#16 5.716 [src/lib.rs:944:30] workspace_metadata.get("cross") = Some(
#16 5.716     Object {
#16 5.716         "target": Object {
#16 5.716             "aarch64-unknown-linux-gnu": Object {
#16 5.716                 "image": String("registry.i.pocograph.com/plcc-public/3rd-party/aarch64-unknown-linux-gnu"),
#16 5.716                 "pre-build": Array [
#16 5.716                     String("dpkg --add-architecture $CROSS_DEB_ARCH"),
#16 5.716                     String("apt-get update && apt-get --assume-yes install git libssl-dev:$CROSS_DEB_ARCH"),
#16 5.716                     String("git version"),
#16 5.716                 ],
#16 5.716             },
#16 5.716         },
#16 5.716     },
#16 5.716 )
#16 5.812 info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
#16 6.639 info: latest update on 2024-10-17, rust version 1.82.0 (f6e511eec 2024-10-15)
#16 6.639 info: downloading component 'cargo'
#16 7.035 info: downloading component 'rust-std'
#16 8.305 info: downloading component 'rustc'
#16 10.24 info: installing component 'cargo'
#16 10.74 info: installing component 'rust-std'
#16 12.06 info: installing component 'rustc'
#16 15.31
#16 15.31   stable-x86_64-unknown-linux-gnu installed - (error reading rustc version)
#16 15.31
#16 15.31 info: checking for self-update
#16 15.45 info: downloading component 'rust-std' for 'aarch64-unknown-linux-gnu'
#16 17.27 info: installing component 'rust-std' for 'aarch64-unknown-linux-gnu'
#16 19.58 #0 building with "default" instance using docker driver
#16 19.58
#16 19.58 #1 [internal] load build definition from Dockerfile.aarch64-unknown-linux-gnu-custom
#16 19.58 #1 transferring dockerfile: 272B done
#16 19.58 #1 DONE 0.0s
#16 19.58
#16 19.58 #2 [internal] load metadata for registry.i.pocograph.com/plcc-public/3rd-party/aarch64-unknown-linux-gnu:latest
#16 19.69 #2 DONE 0.3s
#16 19.79
#16 19.79 #3 [internal] load .dockerignore
#16 19.79 #3 transferring context: 2B done
#16 19.79 #3 DONE 0.0s
#16 19.79
#16 19.79 #4 [1/2] FROM registry.i.pocograph.com/plcc-public/3rd-party/aarch64-unknown-linux-gnu:latest@sha256:7f8308a8734d9fcd2ebbe9a3e4bdea74af293f0799d80c3cc341e340cda49a4c
#16 19.79 #4 DONE 0.0s
#16 19.79
#16 19.79 #5 [2/2] RUN eval "dpkg --add-architecture $CROSS_DEB_ARCH
#16 19.79 apt-get update && apt-get --assume-yes install git libssl-dev:$CROSS_DEB_ARCH
#16 19.79 git version"
#16 19.79 #5 CACHED
#16 19.79
#16 19.79 #6 exporting to image
#16 19.79 #6 exporting layers done
#16 19.79 #6 writing image sha256:b01fa82ba2155496b1a1caaf597c9831b32a91b26f61c33e5d20041b37e23037 done
#16 19.79 #6 naming to localhost/cross-rs/cross-custom-build:aarch64-unknown-linux-gnu-fa0b1-pre-build done
#16 19.79 #6 DONE 0.0s
#16 19.79 WARNING: current commit information was not captured by the build: git was not found in the system: exec: "git": executable file not found in $PATH
#16 21.97     Updating git repository `https://github.com/david9991/dust-dds`
#16 DONE 24.0s

What target(s) are you cross-compiling for?

No response

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5

Example

No response

Additional information / notes

No response

@david9991
Copy link
Author

I've solved my problem by installing git on the host instead of in pre-build.

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

1 participant