How to use Reference Types with wasm-bindgen - wasm-bindgen

First of all, I'm newby in rust and webassembly. I'd like to use Reference Types with wasm-bindgen, following theexample in wasm-bindgen book Support for Reference Types
I've tried to build my code with the reference types flag
wasm-pack build --reference-types
But I'm getting following error
error: Found argument '--reference-types' which wasn't expected, or isn't valid in this context
I've installed rustc with version 1.55 and wasm-pack with version 0.10.1.
Am I missing any thing?

Related

Undefined reference to symbol error when linking Mongo C driver static library

I'm trying to build a program using the Mongo C driver. My CMake configuration includes this:
include_directories("/usr/local/include/libmongoc-1.0")
include_directories("/usr/local/include/libbson-1.0")
...
SET (STATIC_LIBS
...
libmongoc-static-1.0.a
libbson-static-1.0.a
)
TARGET_LINK_LIBRARIES(myapp ${STATIC_LIBS})
Compile stage goes fine (so it seems that includes are correctly found), but when the linking stage takes place I get this error:
/usr/bin/ld: /usr/local/lib/libmongoc-static-1.0.a(mongoc-counters.c.o): undefined reference to symbol 'shm_unlink##GLIBC_2.2.5'
//lib/x86_64-linux-gnu/librt.so.1: error adding symbols: DSO missing from command line
It seems it correctly find the static library file but something in it doesn't like it...
Somebody has found a similar error? Is there any known solution?
Some additional info about my system:
gcc version: 6.3.0
Mongo C driver version: 1.16.0
MongoDB version: 4.4.1
Operating system: Debian 9.3
Thanks!
EDIT: debugging on this, I have discovered that if I build the Mongo C driver without SHM counters support this way:
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_SHM_COUNTERS=OFF -DENABLE_STATIC=ON ..
Then the above error disappears. However, this new and similar one happens:
/usr/bin/ld: /usr/local/lib/libmongoc-static-1.0.a(mongoc-scram.c.o): undefined reference to symbol 'usprep_close_57'
//usr/lib/x86_64-linux-gnu/libicuuc.so.57: error adding symbols: DSO missing from command line
I think I finally solved the problem this way (after looking to this piece of documentation):
include_directories("/usr/local/include/libmongoc-1.0")
include_directories("/usr/local/include/libbson-1.0")
...
find_package (mongoc-1.0 1.17.4 EXACT)
SET (STATIC_LIBS
...
mongo::mongoc_static
)
TARGET_LINK_LIBRARIES(myapp ${STATIC_LIBS})
I didn't need to use -DENABLE_SHM_COUNTERS=OFF -DENABLE_STATIC=ON to build the driver and the recommended way in documentation worked:
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..

Groovy:General error during semantic analysis: java.lang.NoSuchMethodError:

Imported the gradle project from the "complete" folder and received the following error:
Groovy:General error during semantic analysis:
java.lang.NoSuchMethodError: 'org.codehaus.groovy.ast.expr.Expression org.codehaus.groovy.ast.tools.GeneralUtils.propX(org.codehaus.groovy.ast.expr.Expression, java.lang.String)'
I am using the latest version of Eclipse, 2020-12, with groovy tools installed.
From grails guide
https://guides.grails.org/gorm-without-grails/guide/index.html
Downloaded code sample from github
https://github.com/grails-guides/gorm-without-grails.git
It seems likely to be a version mismatch, but I cannot determine how to correct this problem.
I have tried to delete the offending file, src/main/groovy/demo/domain/Manufacturer.groovy, and the error appears on the file in this package on line 1.
The error does not appear in any other package. I have done the usual internet searches for resolutions that apply, but have thus far been unable to find a suitable solution. I am hopeful for a suggestion?
I think this error comes from an AST transform that references the older signature of GeneralUtils#propX. This method used to return Expression and was changed to return PropertyExpression.
The bridge method for binary compatibility was missing in groovy-eclipse. https://github.com/groovy/groovy-eclipse/commit/f6f448675d95f858b4ec65b6fc8e55f27ccaaa94

multiple definition of `bitbang_swd' when building rocket-chip tools

I am trying to build rocket-chip tools according to instructions here: https://github.com/chipsalliance/rocket-tools/blob/master/README.md
I face the following error:
/usr/bin/ld: src/.libs/libopenocd.a(libocdjtagdrivers_la-bitbang.o):/home/mats/src/rocket-tools/riscv-openocd/build/../src/jtag/drivers/bitbang.h:61: multiple definition of `bitbang_swd'; src/.libs/libopenocd.a(libocdjtagdrivers_la-remote_bitbang.o):/home/mats/src/rocket-tools/riscv-openocd/build/../src/jtag/drivers/bitbang.h:61: first defined here
I do not understand how the same include file can get included twice.
Any support overcoming this issue is appreciated.

How can one compile Coq code reliably using `coqc` command?

I was going the the software foundations course and for some reason I could NOT get the coqc command to compile my libraries.
I did:
coqc Maps.v
but get the error:
Error: The file /Users/pinocchio/coq/software_foundations_vol1/Maps.vo
contains library maps and not library Maps
I also tried compiling with coqIDE but I get the following error:
Error: Compiled library Maps (in file
/Users/pinocchio/coq/software_foundations_vol1/Maps.vo) makes
inconsistent assumptions over library Coq.Init.Notations
Any ideas on what can I do?

how to run BasicGenerator.scala in swagger

after running ./sbt assembly, I'm trying to run the
./bin/runscala.sh src/main/scala/com/wordnik/swagger/codegen/BasicPHPGenerator.scala ~/Desktop/myspec.json
and I get the following error:
./src/main/scala/com/wordnik/swagger/codegen/BasicPHPGenerator.scala:17: error: illegal start of definition
package com.wordnik.swagger.codegen
What is the cause and how can I fix it?
I'd strongly recommend using the develop_2.0 branch of swagger-codegen which uses Java, is simpler, and is under active development. Please try it first and see if you still experience a problem.
https://github.com/swagger-api/swagger-codegen/tree/develop_2.0