Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

error: could not create home directory: '/.rustup' with use-cross #183

Closed
lpil opened this issue Jun 15, 2021 · 4 comments
Closed

error: could not create home directory: '/.rustup' with use-cross #183

lpil opened this issue Jun 15, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@lpil
Copy link

lpil commented Jun 15, 2021

Hello! Thank you for this useful project

Description

A couple days ago my workflow stopped working without modification. Upon attempting to run cargo build with use-cross set to true I get this error:

Status: Downloaded newer image for clux/muslrust:latest
error: could not create home directory: '/.rustup'
Error: error: caused by: Permission denied (os error 13)
Error: The process 'cross' failed with exit code 1

Workflow code

Here is my workflow: https://github.com/gleam-lang/gleam/blob/e25991fe92901577b47b0c6d3d71894a7abbc5e0/.github/workflows/ci.yaml#L46-L51

I believe this to be a reproduction:

name: ci
on:
  pull_request:
  push:
    branches:
      - main
jobs:
  test:
    env:
      RUSTFLAGS: "-D warnings"
    name: test
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2

    - name: Install Rust toolchain
      uses: actions-rs/toolchain@v1
      with:
        toolchain: stable
        target: x86_64-unknown-linux-musl
        profile: minimal
        override: true

    - name: Build binary
      uses: actions-rs/cargo@v1
      with:
        use-cross: true
        command: build
        args: --release --target x86_64-unknown-linux-musl

Action output

Here is the full log https://github.com/gleam-lang/gleam/runs/2828986249?check_suite_focus=true

Expected behavior

cargo build runs

Thanks,
Louis

@lpil lpil added the bug Something isn't working label Jun 15, 2021
@praveenperera
Copy link

Could be related to a change made in the base image 3 days ago: clux/muslrust@fb96930

@lpil
Copy link
Author

lpil commented Jun 15, 2021

I think this may also be related to cross-rs/cross#543, which is as yet not released

@tranzystorekk
Copy link

tranzystorekk commented Jun 29, 2022

Unfortunately this still happens with cross 0.2.2 (newly released), so it's probably not directly caused by cross, or some changes might be needed in clux/muslrust

EDIT: specifying the CROSS_CONTAINER_UID: 0 env variable fixes this after all!

@lpil
Copy link
Author

lpil commented Jun 30, 2022

Fab! Thanks @tranzystorek-io

@lpil lpil closed this as completed Jun 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants