Skip to content

Conversation

DLBPointon
Copy link

@DLBPointon DLBPointon commented Jun 3, 2025

Hi all,
Thanks for a great project! I'm looking at moving my finances over to another spreadsheet tool (I can't find an acounting tool I like, so I have a fairly complex accounts workbook, happy to talk about as you are looking for spreadsheet templates), I've just started getting banner ads on google sheets for getting AI insights into my data, and that's a hard no for me.
I'm also slowly learning rust, with a couple of ok projects under my belt, so hopefully I can help a little bit here!

Anyway, I've started with something comfortably in my ability, i think, by adding the Excel implementation of PERCENTOF.

As far as I can tell this passes tests and compiles (on github runner), however, i'm having an issue with getting it to compile on my M3 Mac. Though i think i saw some commits about that this morning. I'll give it some tests later once on my PC, but opening the PR now for comments.

So far i've:

  • Added fn_percentof (which has ended up larger than I was expecting to be honest).
  • Added into_number to CalcResult
  • This means I can, in theory, do =Percentof( =SUM() / =SUM() )
  • Added some simple tests

@DLBPointon DLBPointon marked this pull request as draft June 3, 2025 10:10
@DLBPointon DLBPointon changed the title PERCENTOF Addition of function PERCENTOF Jun 3, 2025
@DLBPointon
Copy link
Author

DLBPointon commented Jun 7, 2025

Annoyingly I can't compile.
My windows PC lacks libnode, which I have spent all morning (about 4 hours of my day) trying to get installed and compiled it self.
My Mac seems to struggle to compile, though I might see if I can give it another go on Monday.

If anyone else can compile and test it would be much appreciated.

Thanks

PS C:\Users\dlbpointon\Documents\IronCalc> cargo build
   Compiling pyo3-ffi v0.23.4
   Compiling pyo3-macros-backend v0.23.4
   Compiling pyo3 v0.23.4
   Compiling ironcalc_nodejs v0.5.0 (C:\Users\dlbpointon\Documents\IronCalc\bindings\nodejs)
error: failed to run custom build command for `ironcalc_nodejs v0.5.0 (C:\Users\dlbpointon\Documents\IronCalc\bindings\nodejs)`

Caused by:
  process didn't exit successfully: `C:\Users\dlbpointon\Documents\IronCalc\target\debug\build\ironcalc_nodejs-e518e62debcb041b\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=DEBUG_GENERATED_CODE
  cargo:rerun-if-env-changed=TYPE_DEF_TMP_PATH
  cargo:rerun-if-env-changed=CARGO_CFG_NAPI_RS_CLI_VERSION

  --- stderr

  thread 'main' panicked at C:\Users\dlbpointon\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\napi-build-2.1.4\src\windows.rs:15:5:
  libnode.dll not found in any search path
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

@nhatcher
Copy link
Member

nhatcher commented Jun 7, 2025

Hi @DLBPointon, in principle you don't have to build the nodejs bindings. Those might be a bit tricky depending on the platform.
I think cargo build will also build those. I don't have a windows box where to test this, but this works on my Mac and Linux boxes.

@nhatcher
Copy link
Member

nhatcher commented Jun 7, 2025

about 4 hours of my day

Ouch! If you do:

base$: cargo test
xlsx$ cargo test

Should be enough to test this PR (BTW, review coming!).
Also if you get stuck happy to jump on a call.
And thanks for your efforts!

@DLBPointon
Copy link
Author

Great, thank you.

Just jumped on the mac quickly to get a fresh copy of the error:

            "__Py_NotImplementedStruct", referenced from:
                pyo3_ffi::object::Py_NotImplemented::heb118b75b528c544 in ironcalc.5376hjekjhdglo23mbqjfc0ls.rcgu.o
            "__Py_TrueStruct", referenced from:
                pyo3_ffi::boolobject::Py_True::hebc65d5a82675c40 in ironcalc.cnd7z11sj9qkglz4x0s2n9kbr.rcgu.o
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: could not compile `pyroncalc` (lib) due to 1 previous error

Annoyingly, until my new server bits come through the post, I only have windows and mac arm so i seem to be stuck.

Cargo test works wonderfully on the mac though and it's a screen of green, 23 passes and 0 fails.

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

Successfully merging this pull request may close these issues.

2 participants