Spagett1 / pineflash

A tool to flash ironos to the pinecil soldering iron and possibly other pine64 devices in the future
Other
223 stars 12 forks source link

[macOS] building from code scripts and manual build not functioning #27

Closed KineticLabs25 closed 1 year ago

KineticLabs25 commented 1 year ago

Build Option 1: After cloning and running generic_linux_install.sh, the terminal returns:

generic_linux_install.sh: line 20: syntax error near unexpected token 'else'
generic_linux_install.sh: line 20: 'else'

Build Option 2: Trying to build manually, the command sudo mv ./tools/blisp/blisp /usr/bin/ needs to be changed to sudo mv ./tools/blisp/blisp /usr/local/bin/ in macOS.

Once blisp has been built, running 'cargo build --release' compiles a while then returns:

error[E0425]: cannot find value `target_dir` in this scope
   --> src/main.rs:239:62
    |
239 | ...sor::new(data), &target_dir, false).unwrap();
    |                     ^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `pineflash` due to previous error
Spagett1 commented 1 year ago

The build script has been updated, would you mind giving it another crack and letting me know if the cargo error still occurs? Cheers

Djhg2000 commented 1 year ago

I can confirm the same compilation bug also occurs on Debian Sid.

Edit: Cargo error output for completeness:

error[E0425]: cannot find value `target_dir` in this scope
   --> src/main.rs:239:62
    |
239 |                     zip_extract::extract(Cursor::new(data), &target_dir, false).unwrap();
    |                                                              ^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `pineflash` due to previous error
Spagett1 commented 1 year ago

thanks for the info, i believe ive fixed that cargo issue. @KineticLabs25 ive updated the install script so it should work on macos now (no need to compile manually) would you mind giving it a shot and letting me know if it works? thanks!

Djhg2000 commented 1 year ago

I'd rather still compile blisp in the process, but the cargo build work fine now.

Spagett1 commented 1 year ago

The reason ive switched the instructions and script to downloading blisp is because the current blisp master branch is broken for macos and its easier for people not used to compiling to just download it. Feel free to compile it though it shouldnt have any issues doing that. Glad to hear the cargo problems fixed on debian.

Once i can get kineticlabs to test it on macos ill close this issue.

Djhg2000 commented 1 year ago

Yeah I put together a quick script (or rather, three lazy one-liners in a file) to build everything from source. It has very rudimentary error handling but it works well enough for me at the moment:

rm -rf PineFlash; git clone https://github.com/Spagett1/PineFlash/ && cd PineFlash

rm blisp && git clone --recursive https://github.com/pine64/blisp.git && cd blisp && git submodule update --init --recursive && mkdir build && cd build && cmake -DBLISP_BUILD_CLI=ON .. && cmake --build . && sudo cp -v ./tools/blisp/blisp /usr/local/bin/ && cd ../..

cargo build --release && sudo cp -v ./target/release/pineflash /usr/local/bin/
Spagett1 commented 1 year ago

Yeah that seems pretty similar to the generic_unix_install.sh script ive got in the repo (aside from it downloading blisp binaries depending on os and only compiling it if on arm not x86_64)

KineticLabs25 commented 1 year ago

Script works! I was able to build Pineflash and successfully flash the firmware on my V2.

I did however get a message at the end of building:

replace blisp? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: blisp                   
Password:
cp: /usr/bin/pineflash: Operation not permitted

Didn't seem to impact functionality, though I've built blisp myself prior to trying out Pineflash. Could this have something to do with not using /usr/local/bin/ instead of /usr/bin/?

Spagett1 commented 1 year ago

That message is just because there is a folder named blisp and its trying to extract to blisp this wont be an issue for anyone who downloads the latest source code since it doesnt include the blisp folder. Thanks!