Conflicting cross-version suffixes in: org.scala-stm:scala-stm - build

At my end, I have the following setup
C:>where play
C:\apps\play-2.2.0\play
C:\apps\play-2.2.0\play.bat
C:>where scala
C:\apps\scala\bin\scala
C:\apps\scala\bin\scala.bat
Scala -version > Scala code runner version 2.10.2 -- Copyright 2002-2013, LAMP/EPFL
Play - version >
play 2.2.0 built with Scala 2.10.2 (running Java 1.7.0_21), http://www.playframework.com
This is not a play application!
Use play new to create a new Play application in the current directory,
or go to an existing application and launch the development console using play.
You can also browse the complete documentation at http://www.playframework.com.
When I run at my play prompt > reload, update, I get following error
[error] Modules were resolved with conflicting cross-version suffixes in {file:/C:/<filepat>}<appname>:
[error] org.scala-stm:scala-stm _2.10, _2.10.0
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) Conflicting cross-version suffixes in: org.scala-stm:scala-stm
[error] Total time: 7 s, completed Oct 18, 2013 1:33:41 PM
[modelingApp] $
After adding the follwoing in Build.scala
"dependencyGroupId" %% "dependencyArtifactId" % "dependencyVersion" exclude("org.scala-stm", "scala-stm_2.10.0")
Get following error
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: dependencyGroupId#dependencyArtifactId_2.10;dependencyVersion: not found
[error] Total time: 8 s, completed Oct 18, 2013 1:22:18 PM
[modelingApp] $

The issue is that the only means of detecting scala version mismatch in sbt is via this artifact extension "_".
This particular issue is that the version of scala-stm that Play is depending on is declaring it is ONLY compatible with scala 2.10.0, whereas your build says it can take anything from the 2.10.x series. sbt is issuing a warning that these are different.
In practice, the scala-stm artifact is actually safe to use, it's just misconfigured on publish (documentation error at the time I believe). So in this case, it's safe to ignore the error. however, in general, this error should be taken seriously. It's very possible that different Scala binary version numbers declared on artifacts may lead to RUNTIME errors (not compile time) that insidiously sneak into your code.
You can use the conflictWarning key to control how this message is logged. I believe if you want to ignore the warnings completely (not recommended, as most should be legitimiate issues), then you can use this setting:
conflictWarning := ConflictWarning.disable
Also, I believe this is a duplicate of this question: Conflicting cross-version suffixes in: com.twitter:util-core

It is a known issue on Play:
Conflicting cross-version suffixes in: org.scala-stm:scala-stm
Maybe you use play slick that is not ready for Play 2.2.
Try
"com.typesafe.play" %% "play-slick" % "0.5.0.2-SNAPSHOT"
Or if it is another lib that has a dependency to Play 2.1.x, try
//replace the name and versions with that of your library
//since Scala 2.10.0 do not put the minor version into the artifact name:
//scala-stm_2.10 instead of scala-stm_2.10.0
"the lib vendor" %% "name" % "version" exclude("org.scala-stm", "scala-stm_2.10.0")

I had the same error when upgrading from Play 2.1.* to Play 2.2.*. The project included secureSocial which also needed to be updated to Play 2.2.
"securesocial" %% "securesocial" % "2.1.0"
to
"ws.securesocial" %% "securesocial" % "2.1.3"
See Secure Social Installation Documentation

It depend on your scala version, for example i use:
"com.typesafe.akka" % "akka-remote_2.11" % "2.3.6"
for scala 2.11.1.
You can find appropriate version from this link.

Related

No source file for Netaccel_link error on running program

I have an OCaml program that worked fine on Ubuntu 16 but when recompiled and run on Ubuntu 20 I get the following error:-
$ ocamldebug ./linearizer
OCaml Debugger version 4.08.1
(ocd) r
Loading program... done.
Time: 89534
Program end.
Uncaught exception: Sys_error "Illegal seek"
(ocd) b
Time: 89533 - pc: 624888 - module Netaccel_link
No source file for Netaccel_link.
I thought this was due to missing dev libraries but:-
$ sudo apt install libocamlnet-ocaml-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libocamlnet-ocaml-dev is already the newest version (4.1.6-1build6).
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
What setup step am I missing on Ubuntu 20?
This looks like a regression bug in libocamlnet and you should report an issue there or, I am a bit pessimistic that you will get any response, you can try to debug the issue yourself.
The problem that you are facing has nothing to do with missing libraries (they will be reported during installation or, if the package is broken, end up in linker errors). It may result, however, from some misconfiguration of the system. If that is true, then you're lucky as you can fix it yourself.
I will give you some advice that might help you in debugging this issue. For more, please try using discuss.ocaml.org as a more suitable media (SO doesn't favor this kind of a discussion and we might get deleted by admins).
The illegal seek exception is thrown when the seek operation is applied on a non-regular file, aka ESPIPE Unix error. So check your inputs. It could be that what was previously regarded as a file in Ubuntu is now a pipe or a socket.
Try to use ltrace or strace to pinpoint the culprit e.g.,
ltrace ./linearizer
or, if it overwhelms you, try strace
strace ./linearizer
Instead of using ocamldebug you can use plain gdb. You can use gdb's interfaces to provide the path to the source code (though most likely it won't work since ocamlnet is not compiled with debug information). I believe that it will give you a more meaningful backtrace.
Instead of using the system installation try using opam. Install your dependencies with opam and try older versions as well as newer versions of the OCaml compiler. Also, try different versions of ocamlnet. Ideally, try to reproduce the environment that used to work for you.
When nothing else works, you can use objdump -d and look at the disassembly of your binary. OCaml is using a pretty readable and intuitive name mangling scheme (<module_name>__<function_name>_<uid>), so you can easily find the source code (search for <module_name>.ml file and look for the <function_name> there)
Finally, just use docker or any other container to run your application. Consider switching from ocamlnet to something more modern and supported.

Openocd Error: invalid command name "dap" - can't connect Blue Pill via ST-Link/V2

I'm using a Blue Pill board (STM32F103CB with 128kB of flash according to st-info --probe) via a clone ST-Link/V2 like this one. I've also tested using a genuine ST-Link/V2 like this one. I get the same result, described below, with both programmers.
My system is Linux (Debian LXDE) and I've installed OpenOCD from Liviu Ionescu's releases here.
My OpenOCD installation is working. As well as the Blue Pill I have a ST-Nucleo-F103RB board, and I can connect to it using OpenOCD. The command
openocd -f board/st_nucleo_f103rb.cfg
using the standard .cfg file that ships with OpenOCD gives
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.271135
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
But I still haven't managed to connect to my Blue Pill using the ST-Link/V2 programmers. I've read everything I can find, including relevant sections of https://elinux.org/Category:OpenOCD and as much as I can personally digest of http://openocd.org/doc/. The following is where I've got to.
The .cfg file stm32f103c8_blue_pill.cfg doesn't work for me. It produces the output described below.
Based on what I've read I've prepared my own .cfg file at ../board/stm32f103.cfg. It says:
source [find interface/stlink.cfg]
transport select hla_swd
source [find target/stm32f1x.cfg]
#source [find board/stm32f103c8_blue_pill.cfg]
#reset_config srst_only
#reset_config none separate
Sources I've read suggest this should work, but it doesn't. Using my .cfg described above, it I can use either target/stm32f1x.cfg or board/stm32f103c7_blue_pill.cfg, and I still get the same output as described below. (In the case of both of those .cfg files I'm using the standard files, as shipped with OpenOCD.) I've tested with both of the reset_config variants shown above, and with neither. None of the combinations works.
The file interface/stlink.cfg that I'm using is modified. I've changed it to state the correct device_desc "ST-LINK/V2" and the correct vid_pid 0x0483 0x3748. (Both confirmed using lsusb.) So, ignoring commented lines, stlink.cfg reads
interface hla
hla_layout stlink
hla_device_desc "ST-LINK/V2"
hla_vid_pid 0x0483 0x3748
I've experimented with including the hla_serial of the programmer. Interestingly, lsusb can't find the full serial number. st-info --probe finds the serial number, but gives a slightly different number from the STLinkUpgrade firmware application. I've tried using both serial numbers. No difference.
Here's the command I give to OpenOCD:
openocd -s ~/stm32/openocd/scripts -f board/stm32f103.cfg
Notice that I have to set the path using -s for this command. With the ST-Nucleo-F103RB board, I don't have to do this. With the stm32f103.cfg file, however, if I don't set the path I get:
Error: Can't find board/stm32f103.cfg
in procedure 'script'
If I use the full command shown above, with -s to set the path, I get:
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
/[..]stm32/openocd/scripts/target/stm32f1x.cfg:47: Error: invalid command name "dap"
in procedure 'script'
at file "embedded:startup.tcl", line 60
at file "/[..]stm32/openocd/scripts/board/stm32f103.cfg", line 18
at file "/[..]stm32/openocd/scripts/target/stm32f1x.cfg", line 47
Here's the offending line 47 of stm32f1x.cfg:
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
I've searched for items on Stackoverflow/ similar about Error: invalid command name "dap". Using the OpenOCD documentation I understand that the dap create command exists, and roughly what it does. The most similar reported error I've found documented is at https://elinux.org/OpenOCD_Troubleshooting:_Invalid_Command_Name_JTAG, and the solution suggested there doesn't seem to be applicable because I'm not invoking interface/stlink.cfg from the command line.
I can't see what I'm doing wrong, and I'm now completely stuck. If someone can give me a steer I'd be really grateful. Sorry it's such a long post.
I just encountered this problem too. Officially there are no binaries provided, only source code. But there are two sites which release binaries was recommended by OpenOCD official:
1. Maintained by Freddie Chopin.
2. Maintained by Liviu Ionescu in Github.
I tried the latest version(OpenOCD 0.10.0 commit date: 2017-01-22 20:31:28 build date: 2017-01-23) released from Freddie Chopin's site, and I encountered this Error: invalid command name "dap" problem. But all *.cfg files I referenced had ran normally in my another computer with another OpenOCD binary(although I forgot where did I download that binary).
Not sure what went wrong, so I turned to the latest version(gnu-mcu-eclipse-openocd-0.10.0-11-20190118-1134-win64.zip) released by GNU MCU Eclipse(maintained by Liviu Ionescu), the error was gone, problem solved.
PS: I'm not saying there is a bug in Freddie Chopin's build, but if someone encountered this problem, maybe you can solve it by trying the version which is currently under actively maintained.
Agree with Wulfric, using standard install for OpenOCD
sudo apt install openocd
gave the "dap" error.
However the github version openocd-xpack worked correctly.
Using:
Linux clamps 4.15.0-66-generic #75-Ubuntu SMP ... as remote, Windows 8/10 as client target MIMXRT1010-EVK

Why does Visual Studio 2017 fail to generate REST API client for Swagger Petstore?

I'm playing around with using Swagger / OpenAPI docs/specs to generate REST API client code in C#, but I'm running into several problems.
Most notably - when trying to use the Swagger.io Petstore example as a starting point:
Using the VS 2017 Add > REST API client option in VS 2017, I don't get any code produced - instead an error is shown:
Generating client code and adding to project started
Generate client code for REST API with following parameters:
REST API Name: OpenApiClientClient, Base namespace: OpenApiClient, Metadata file path: C:\Users\Marc\AppData\Local\Temp\WebToolsAutoRest\OpenApiClientClient\201807162213351660\swagger.json
[Info]AutoRest Core 0.16.0.0
[Info]Initializing modeler.
[Info]Initializing modeler.
[Info]Parsing swagger json file.
[Info]Generating client model from swagger model.
[Fatal]Error generating client model: Collection format "multi" is not supported (in parameter 'status').
Exception: There was an error during code generation when trying to add a client for the REST API
Generating client code and adding to project failed
Adding REST API client for failed
So if the Swagger sample app isn't compatible - how will others be?? (and I tried a few others, all with the same results, unfortunately).
What's wrong here? Am I missing something, do I need to add some extra tooling to VS 2017 to make this work?
UPDATE:
OK, so I now tried to install Autorest using npm directly:
npm install -g autorest
This appears to work - no errors shown or anything.
But trying to run Autorest - with a set of command line parameters, or even just on its own - results in an error:
AutoRest -CodeGenerator CSharp -Modeler Swagger
-Input https://petstore.swagger.io/v2/swagger.json
-Namespace Services.UserServiceClient -OutputDirectory d:\projects
-AddCrendentials true
or just
AutoRest <kbd>Enter</kbd>
results in:
AutoRest code generation utility [version: 2.0.4280; node: v9.9.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Failure:
Error: Unable to start AutoRest Core from C:\Users\Marc.autorest\#microsoft.azure_autorest-core#2.0.4280\node_modules\#microsoft.azure\autorest-core
Error: Unable to start AutoRest Core from C:\Users\Marc.autorest\#microsoft.azure_autorest-core#2.0.4280\node_modules\#microsoft.azure\autorest-core
at main (C:\Users\Marc\AppData\Roaming\npm\node_modules\autorest \dist\app.js:232:19)
at
Any further ideas?
Visual Studio 2017 is using a very old version of AutoRest. The issue you are seeing is this one which was fixed in AutoRest v. 1.0. As explained in the comments in that issue:
Are you referring to the autorest version that's built-into visual studio? -- That's incredibly old, and we didn't update that (we've changed the whole way autorest works).
You are going to need to install node and use autorest from the command line.
Looks like it's not possible to update AutoRest used by Visual Studio 2017, so you'll need to call AutoRest directly.
I also had this problem so I built a tool for it called REST API Client Code Generator. I worked in teams where we used tools like AutoRest, NSwag, and Swagger Codegen to generate our REST API Clients and it always annoyed me that the "Add New - REST API Client..." tooling in Visual Studio didn't always work and was very troublesome when it was time to re-generate the client
This would add the OpenAPI specification file (Swagger.json) to the project and set a custom tool so that every time changes are made to it the REST API Client code is re-generated. You can also right click on the Swagger.json file and switch code generators
I built the tool mainly for personal use and for use within my teams but if you find it useful and think it lacks something you really need then please reach out
Try running autorest --reset. This worked on windows with node v8.12.0. Prior to running that command I was getting the same error.

Error while compiling workspace-d

I tried to install workspace-d on Windows 10 using Administrator privilege but failed.
Here is the error message.I haved installed dmd, dub and git.
PS C:\Users\U\Desktop\workspace-d-installer> .\workspace-d-installer.exe
Welcome to the workspace-d installation guide.
Make sure, you have dmd, dub and git installed.
Which external components do you want to install?
[1] DCD - auto completion
[2] DScanner - code linting
[3] dfmt - code formatting
Enter a comma separated list of numbers
Selected [all]:
Cloning workspace-d into C:\Users\U\AppData\Local\Temp\workspaced-install-635958600835730563
Checking out v2.6.0
Compiling...
Error: Error writing file '..\..\..\..\..\..\U\AppData\Roaming\dub\packages\painlesstraits-0.1.0\.dub\build\library-release-windows-x86-dmd_2071-92537C3AEFB87AC450BFCCEE2ECBED44\painlesstraits.lib'
dmd failed with exit code 1.
Error while compiling workspace-d.
This is a bug with workspace-d-installer. Even though it just runs the shell commands, it has some permission problems on windows. I have opened an issue on the project page if you want to do anything on it: https://github.com/Pure-D/workspace-d-installer/issues/2
The only solution right now is to manually clone each repository (workspace-d, dfmt, dscanner, dcd) and follow their build instructions. I'm trying to fix that issue so you can use workspace-d-installer.

What information is required in boot.properties?

I want to specify the Clojure version for my project that uses Boot. According to the Boot Wiki, the way to do this is by providing a value for BOOT_CLOJURE_VERSION in a boot.properties file in my project root. So I did that:
$ cat boot.properties
BOOT_CLOJURE_VERSION=1.7.0
It seems to work just fine:
$ tail -2 ~/.boot/boot.properties
BOOT_VERSION=2.5.5
BOOT_CLOJURE_VERSION=1.8.0
$ cat build.boot
(deftask version []
(println "Clojure" (clojure-version))
(println "Boot core" *boot-version*)
(println "Boot app" *app-version*))
$ boot version
Clojure 1.7.0
Boot core 2.5.5
Boot app 2.5.5
However, that same wiki page specifically says to create the boot.properties file like this:
$ boot -V > boot.properties
This adds two lines at the beginning, which look like comments to me, and one at the end that specifies the Boot version. I have no problem with specifying the Boot version for my project, but the wiki page makes it sound as if it's required:
Note: When using boot.properties file you have to also pin the project to specific Boot version as the file must specify both variables.
I'm a bit confused about why the page specifically says to add these three lines to boot.properties when omitting them doesn't seem to cause any problems. Additionally, if I'm using revision control, I see no need to put a timestamp in boot.properties. Is it OK to omit these lines? If not, why are they needed?
This is most likely a case of outdated wiki information. From the source:
// BOOT_VERSION is decided by the loader; it will respect the
// boot.properties files, env vars, system properties, etc.
// or it will use the latest installed version.
I guess you could consider it good practice to lock both the Clojure and Boot version per project as this will prevent any future problems that may arise from incompatible versions.
The 2 comment lines added by Boot are just for information purposes and can be safely omitted.