Skip to content

Commit

Permalink
Try to fix loongarch64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Dec 17, 2023
2 parents 0d8c46b + 082ed09 commit 555e9eb
Show file tree
Hide file tree
Showing 757 changed files with 25,805 additions and 17,867 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ name: continuous-integration
env:
NUSHELL_CARGO_PROFILE: ci
NU_LOG_LEVEL: DEBUG
# If changing these settings also change toolkit.nu
CLIPPY_OPTIONS: "-D warnings -D clippy::unwrap_used"

jobs:
Expand Down Expand Up @@ -40,16 +41,17 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
with:
rustflags: ""

- name: cargo fmt
run: cargo fmt --all -- --check

# If changing these settings also change toolkit.nu
- name: Clippy
run: cargo clippy --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- $CLIPPY_OPTIONS

# In tests we don't have to deny unwrap
- name: Clippy of tests
run: cargo clippy --tests --workspace ${{ matrix.flags }} --exclude nu_plugin_* -- -D warnings
Expand Down Expand Up @@ -83,7 +85,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
with:
rustflags: ""

Expand All @@ -104,7 +106,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
with:
rustflags: ""

Expand All @@ -115,7 +117,7 @@ jobs:
run: nu -c 'use std testing; testing run-tests --path crates/nu-std'

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand All @@ -139,7 +141,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
uses: actions-rust-lang/setup-rust-toolchain@v1.6.0
with:
rustflags: ""

Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
token: ${{ secrets.WORKFLOW_TOKEN }}

- name: Setup Nushell
uses: hustcer/setup-nu@v3.6
uses: hustcer/setup-nu@v3.8
if: github.repository == 'nushell/nightly'
with:
version: 0.85.0
version: 0.86.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -135,12 +135,15 @@ jobs:
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/[email protected]
uses: actions-rust-lang/[email protected]
# WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135`
with:
rustflags: ''

- name: Setup Nushell
uses: hustcer/setup-nu@v3.6
uses: hustcer/setup-nu@v3.8
with:
version: 0.85.0
version: 0.86.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -246,12 +249,15 @@ jobs:
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/[email protected]
uses: actions-rust-lang/[email protected]
# WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135`
with:
rustflags: ''

- name: Setup Nushell
uses: hustcer/setup-nu@v3.6
uses: hustcer/setup-nu@v3.8
with:
version: 0.85.0
version: 0.86.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -315,9 +321,9 @@ jobs:
ref: main

- name: Setup Nushell
uses: hustcer/setup-nu@v3.6
uses: hustcer/setup-nu@v3.8
with:
version: 0.85.0
version: 0.86.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/release-pkg.nu
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,36 @@
# Instructions for manually creating an MSI for Winget Releases when they fail
# Added 2022-11-29 when Windows packaging wouldn't work
# Updated again on 2023-02-23 because msis are still failing validation
# Update on 2023-10-18 to use RELEASE_TYPE env var to determine if full or not
# To run this manual for windows here are the steps I take
# checkout the release you want to publish
# 1. git checkout 0.76.0
# 1. git checkout 0.86.0
# unset CARGO_TARGET_DIR if set (I have to do this in the parent shell to get it to work)
# 2. $env:CARGO_TARGET_DIR = ""
# 2. hide-env CARGO_TARGET_DIR
# 3. $env.TARGET = 'x86_64-pc-windows-msvc'
# 4. $env.TARGET_RUSTFLAGS = ''
# 5. $env.GITHUB_WORKSPACE = 'C:\Users\dschroeder\source\repos\forks\nushell'
# 6. $env.GITHUB_OUTPUT = 'C:\Users\dschroeder\source\repos\forks\nushell\output\out.txt'
# 5. $env.GITHUB_WORKSPACE = 'D:\nushell'
# 6. $env.GITHUB_OUTPUT = 'D:\nushell\output\out.txt'
# 7. $env.OS = 'windows-latest'
# 8. $env.RELEASE_TYPE = '' # There is full and '' for normal releases
# make sure 7z.exe is in your path https://www.7-zip.org/download.html
# 8. $env.Path = ($env.Path | append 'c:\apps\7-zip')
# 9. $env.Path = ($env.Path | append 'c:\apps\7-zip')
# make sure aria2c.exe is in your path https://github.com/aria2/aria2
# 9. $env.Path = ($env.Path | append 'c:\path\to\aria2c')
# 10. $env.Path = ($env.Path | append 'c:\path\to\aria2c')
# make sure you have the wixtools installed https://wixtoolset.org/
# 10. $env.Path = ($env.Path | append 'C:\Users\dschroeder\AppData\Local\tauri\WixTools')
# 11. $env.Path = ($env.Path | append 'C:\Users\dschroeder\AppData\Local\tauri\WixTools')
# You need to run the release-pkg twice. The first pass, with _EXTRA_ as 'bin', makes the output
# folder and builds everything. The second pass, that generates the msi file, with _EXTRA_ as 'msi'
# 11. $env._EXTRA_ = 'bin'
# 12. source .github\workflows\release-pkg.nu
# 13. cd ..
# 14. $env._EXTRA_ = 'msi'
# 15. source .github\workflows\release-pkg.nu
# 12. $env._EXTRA_ = 'bin'
# 13. source .github\workflows\release-pkg.nu
# 14. cd ..
# 15. $env._EXTRA_ = 'msi'
# 16. source .github\workflows\release-pkg.nu
# After msi is generated, you have to update winget-pkgs repo, you'll need to patch the release
# by deleting the existing msi and uploading this new msi. Then you'll need to update the hash
# on the winget-pkgs PR. To generate the hash, run this command
# 16. open target\wix\nu-0.74.0-x86_64-pc-windows-msvc.msi | hash sha256
# 17. open target\wix\nu-0.74.0-x86_64-pc-windows-msvc.msi | hash sha256
# Then, just take the output and put it in the winget-pkgs PR for the hash on the msi


Expand Down Expand Up @@ -141,10 +143,8 @@ print (ls -f $executable); sleep 1sec
print $'(char nl)Copying release files...'; hr-line
"To use Nu plugins, use the register command to tell Nu where to find the plugin. For example:
> register ./nu_plugin_query" | save $'($dist)/README.txt'
> register ./nu_plugin_query" | save $'($dist)/README.txt' -f
[LICENSE $executable] | each {|it| cp -rv $it $dist } | flatten
# Sleep a few seconds to make sure the cp process finished successfully
sleep 3sec

print $'(char nl)Check binary release version detail:'; hr-line
let ver = if $os == 'windows-latest' {
Expand All @@ -153,7 +153,7 @@ let ver = if $os == 'windows-latest' {
(do -i { ./output/nu -c 'version' }) | str join
}
if ($ver | str trim | is-empty) {
print $'(ansi r)Incompatible nu binary...(ansi reset)'
print $'(ansi r)Incompatible Nu binary: The binary cross compiled is not runnable on current arch...(ansi reset)'
} else { print $ver }

# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -195,7 +195,7 @@ if $os in [$USE_UBUNTU, 'macos-latest'] {
cargo install cargo-wix --version 0.3.4
cargo wix --no-build --nocapture --package nu --output $wixRelease
# Workaround for https://github.com/softprops/action-gh-release/issues/280
let archive = ($wixRelease | str replace -a '\' '/')
let archive = ($wixRelease | str replace --all '\' '/')
print $'archive: ---> ($archive)';
echo $"archive=($archive)" | save --append $env.GITHUB_OUTPUT

Expand All @@ -207,7 +207,7 @@ if $os in [$USE_UBUNTU, 'macos-latest'] {
let pkg = (ls -f $archive | get name)
if not ($pkg | is-empty) {
# Workaround for https://github.com/softprops/action-gh-release/issues/280
let archive = ($pkg | get 0 | str replace -a '\' '/')
let archive = ($pkg | get 0 | str replace --all '\' '/')
print $'archive: ---> ($archive)'
echo $"archive=($archive)" | save --append $env.GITHUB_OUTPUT
}
Expand All @@ -232,7 +232,7 @@ def 'cargo-build-nu' [ options: string ] {

# Print a horizontal line marker
def 'hr-line' [
--blank-line(-b): bool
--blank-line(-b)
] {
print $'(ansi g)---------------------------------------------------------------------------->(ansi reset)'
if $blank_line { char nl }
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,22 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1

- name: Update Rust Toolchain Target
run: |
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/[email protected]
# WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135`
with:
rustflags: ''

- name: Setup Nushell
uses: hustcer/setup-nu@v3.6
uses: hustcer/setup-nu@v3.8
with:
version: 0.85.0
version: 0.86.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -171,19 +174,22 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1

- name: Update Rust Toolchain Target
run: |
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/[email protected]
# WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135`
with:
rustflags: ''

- name: Setup Nushell
uses: hustcer/setup-nu@v3.6
uses: hustcer/setup-nu@v3.8
with:
version: 0.85.0
version: 0.86.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,15 @@ jobs:
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/[email protected]
uses: actions-rust-lang/[email protected]
# WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135`
with:
rustflags: ''

- name: Setup Nushell
uses: hustcer/setup-nu@v3.6
uses: hustcer/setup-nu@v3.8
with:
version: 0.85.0
version: 0.86.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -167,12 +170,15 @@ jobs:
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/[email protected]
uses: actions-rust-lang/[email protected]
# WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135`
with:
rustflags: ''

- name: Setup Nushell
uses: hustcer/setup-nu@v3.6
uses: hustcer/setup-nu@v3.8
with:
version: 0.85.0
version: 0.86.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
uses: actions/checkout@v4

- name: Check spelling
uses: crate-ci/[email protected].15
uses: crate-ci/[email protected].24
with:
config: ./.github/.typos.toml
Loading

0 comments on commit 555e9eb

Please sign in to comment.