Comments (14)
Hint: If I change the code to this:
#execute_process(COMMAND "${DART}" run
# "${CMAKE_CURRENT_SOURCE_DIR}/../libsodium_version.dart"
# OUTPUT_VARIABLE LIBSODIUM_VERSION_JSON
# COMMAND_ERROR_IS_FATAL ANY
#)
set(LIBSODIUM_VERSION_JSON "{\"ffi\":\"1.0.18\",\"js\":\"0.7.9\"}")
(so adding manually the version information), everything works fine! It seems like dart cannot be executed from the CMake file. Any ideas, what the problem could be?
Thanks and best regards!
from libsodium_dart_bindings.
Huh, that is weird. Is the dart executable available in your PATH? What happens if you run dart --version
in the same command prompt as the one where you run the build? However, the check in https://github.com/Skycoder42/libsodium_dart_bindings/blob/main/packages/sodium_libs/windows/CMakeLists.txt#L16 should already fail if dart was not found. Which CMake version are you using?
If thats not it, I am not sure where the problem is. In the CI-Pipeline, the build succeeds. Maybe you could replace the find program check with the following to see what is actually found:
if(DART)
message("Found dart at: ${DART}")
else()
message(FATAL_ERROR "Did not find dart in PATH!")
endif()
Also, running flutter build ... --verbose
might output something useful, so it's worth a try.
from libsodium_dart_bindings.
I will check tomorrow - the dart executable is in the PATH, I can call dart --version
so this shouldn't be the problem. Looks like the CMAKE process runs in a thread that does not have access to the path.
The error also does not say, that dart isn't available but that dart isn't a valid Win32 application.
I think it could be an issue with Win 11 and Visual Studio 2022 - would it be ok for you to tell me your Windows Version (10?) and the Visual Studio Version you are running? Then I will set up a VM and test it there.
Thanks a lot!
from libsodium_dart_bindings.
I am using the GitHub Actions CI with the windows-latest
image. You can find more information on the image, including OS-Version and more here: https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
I have not tested it on Windows 11 yet, so that might be the reason. And yes, the error message seems to indicate that cmake fails to pass the correct dart path to the subshell executing the command.
from libsodium_dart_bindings.
I just changed the code to:
execute_process(COMMAND "c:\\flutter\\bin\\cache\\dart-sdk\\bin\\dart.exe" run
now, it works - it seems like CMake resolve the dart.exe to something else, in my case to "C:\flutter\bin". Maybe I need to change my path then...
from libsodium_dart_bindings.
I found a fix: if I replace
execute_process(COMMAND "${DART}" run
with exec_program("${DART}" run
then it works. According to https://cmake.org/cmake/help/v3.0/command/execute_process.html, the execute_process does not spin up a shell and hence doesn't know about all the env variable. Would it be possible for you to test that as well and maybe commit it, if ok?
Thanks a lot!
from libsodium_dart_bindings.
That is weird. As far as I know, the dart executable is "linked" in the C:\flutter\bin
directory (If I remember correctly, as a batch script), so that path should work as well. But maybe the execute_process cannot directly execute a script, that could be an explanation. Does your C:\flutter\bin
contain a dart executable/script?
I also looked at the documentation of exec_program, and apparently, it is deprecated and should not be used anymore: https://cmake.org/cmake/help/v3.0/command/exec_program.html#command:exec_program
So I am unsure if I should actually use it. I think, maybe just explicitly using a shell (cmd /c "${DART}"
) might be enough.
from libsodium_dart_bindings.
I tried with cmd /c {DART}
but it says: "The file cannot be found." :(
from libsodium_dart_bindings.
This is my flutter\bin folder. There is only a batch file and a file named "dart" without extension. Maybe thats the linux version.
from libsodium_dart_bindings.
Okay, so I updated the native flutter parts of the plugin and changed the windows build to use "cmd /c ${dart} ...". The pipeline succeeds, so it seams to at least generally work.
Could you try the build with the lastest main branch? You can simply use a git-dependency in the pubspec for that:
dependencies:
sodium_libs:
git:
url: https://github.com/Skycoder42/libsodium_dart_bindings.git
path: packages/sodium_libs
from libsodium_dart_bindings.
So I tried it myself on a Windows 11 Machine with VS 2022 and I can build successfully. Did the changes on the master branch fix your problem?
from libsodium_dart_bindings.
Sorry for the delay, I'm currently traveling, but will have a look on it next week and give feedback! Thanks a lot for your effort!
from libsodium_dart_bindings.
Yes, it works - thank you so much for your help and support with this!
from libsodium_dart_bindings.
perfekt, then I will publish that soon
from libsodium_dart_bindings.
Related Issues (20)
- iOS: Failed to lookup symbol 'sodium_init' HOT 5
- Full build for Android version HOT 1
- Cannot read properties of undefined (reading 'then') HOT 2
- please update ffi HOT 2
- sodium.js - Cannot read properties of undefined (reading 'then') HOT 5
- Speed of sodium.crypto.secretBox.easy() etc... HOT 4
- Implement crypto_stream_xchacha20 HOT 1
- FFI failure or SodiumInit timing problem? HOT 9
- Flutter_test Failed to lookup symbol 'sodium_init' HOT 9
- Create `Sodium.runIsolated` method to easily run computation heavy cryptographic operations in an isolate HOT 12
- How does one use AES-GCM? HOT 12
- Request for SecretStream encryption/decryption example HOT 7
- Sodium.runIsolated breaking flutter run build HOT 2
- build failure: libsodium.so not found on latest update HOT 4
- Implement cryptoSignEd25519SkToSeed (crypto_sign_ed25519_sk_to_seed) HOT 8
- Use chacha20poly1305 instead of xchacha20poly1305_ietf HOT 2
- Secret stream state initialization; Continue interrupted upload of encrypted stream; HOT 3
- How update flutter_sodium 0.2.0 to sodium_libs? HOT 3
- How to create a shared secret using Scalarmult? HOT 6
- Fails to build on Fedora HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsodium_dart_bindings.