Skip to content

[ci] fix sh-compatibility issue in build-cran-package.sh - #6118

Merged
jameslamb merged 1 commit into
masterfrom
r/cran-script-portability
Sep 29, 2023
Merged

jameslamb merged 1 commit into
masterfrom
r/cran-script-portability

Conversation

@jameslamb

Copy link
Copy Markdown
Member

build-cran-package.sh is used to prepare a CRAN-style source distribution of this project's R package.

It's intentionally an sh and not bash script, to attempt to be as portable as possible.

I noticed tonight that that script is currently using one bash feature that isn't supported in at least some implementations of sh... [[ for an if condition.

See https://github.com/microsoft/LightGBM/actions/runs/6301758829/job/17107497663#step:7:7057.

build-cran-package.sh: 135: [[: not found

Or run the following from the root of this repo to reproduce it.

docker run \
    --rm \
    -v $(pwd):/opt/LightGBM \
    -w /opt/LightGBM \
    -it ghcr.io/r-hub/containers/ubuntu-clang:latest \
    sh build-cran-package.sh --no-build-vignettes

This PR fixes that.

@jameslamb
jameslamb merged commit b7418dc into master Sep 29, 2023
@jameslamb
jameslamb deleted the r/cran-script-portability branch September 29, 2023 16:00
@jameslamb

Copy link
Copy Markdown
Member Author

thanks as always @jmoralez !

@github-actions

github-actions Bot commented Jan 3, 2024

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants