What this means when two versions are together in yarn.lock like url-parse#^1.4.3, url-parse#^1.5.9 - yarn-workspaces

I have yarn.lock file which have two versions of single package like
url-parse#^1.4.3, url-parse#^1.5.9:
version "1.5.10"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2"
integrity sha512-WypcfiR==
dependencies:
querystringify "^2.1.1"
requires-port "^1.0.0"
So what does it means url-parse#^1.4.3, url-parse#^1.5.9 ? Will application be used both versions ?

Related

Why "Run cargo install ..." fails with "error: edition 2021 is unstable" though 'edition 2018' was specified?

Though this was working last week, suddenly now while building docker image for my rust application the following command fails-
RUN cargo install --target x86_64-unknown-linux-musl --path .
with errors-
Compiling ed25519 v1.4.0
error: edition 2021 is unstable and only available with -Z unstable-options.
error: failed to compile config-client v0.1.0 (/home/rust/src), intermediate artifacts can be found at /home/rust/src/target
Caused by:
could not compile ed25519
Following is my Cargo.toml file:
[package]
name = "application-xyz"
version = "0.1.0"
authors = ["Dev Team <dev#abc.com>"]
edition = "2018"
[dependencies]
anyhow = "1.0"
bytes = "1.0.1"
clap = "2.33.3"
log = "0.4.14"
log4rs = "1.0.0"
mustache = "0.9.0"
nats = "0.9.7"
prost = "0.7"
prost-types = "0.7"
reqwest = { version = "0.11.3", features = ["blocking", "json"] }
serde = { version = "1.0.125", features = ["derive"] }
[build-dependencies]
prost-build = "0.7"
My docker file is:
FROM containers.abc.com/rust-musl-builder:1.51 as builder
#Add protobuf sources as well as app source code.
COPY model/src ./model/src
COPY application-xyz:/build.rs ./build.rs
COPY application-xyz:/Cargo.toml ./Cargo.toml
COPY application-xyz:/src ./src
COPY application-xyz:/src/protobuf ./src/protobuf
RUN cargo install --target x86_64-unknown-linux-musl --path .
Any fix for this? Why cargo tries to download from 'edition 2021' though 'edition 2018' was specified? And why it downloads almost all the libraries though it has not been specified anywhere?
Editions are separately chosen by each crate being compiled. The current revision of the ed25519 crate requires a compiler that supports the 2021 edition. (You can find this out through docs.rs's handy source view: https://docs.rs/crate/ed25519/1.4.0/source/Cargo.toml.orig)
If you're trying to compile Rust binaries using a fixed compiler version (or an older version that might be in your distro package manager), then it's important to include a Cargo.lock file in your project/container configuration. The lock file specifies exact versions of each crate, so that your build cannot be broken by new library versions requiring newer compiler features.
However, there's a catch: cargo install ignores the lock file by default. So, you'll also need to change your command to pass the --locked flag to cargo install.
(You should also consider using a newer Rust compiler version, so that you don't have to use old versions of libraries that may have known bugs.)

Including a directory as a search path during compilation with CocoaPods

I'm trying to create an iOS project that includes C code that is shared across other platforms (Android). Some of the third party libraries I'm compiling rely on having certain directories included as search paths. However, no matter what I've tried, I've been unable to the CocoaPods .podspec file to include a given directory in the compilation search path. I'm using CocoaPods 1.8.4.
Whilst this is a Flutter plugin, it's my understanding that this is an issue with CocoaPods/Xcode, since Flutter has merely set up the project files. However, it's worth noting that Flutter sets up an example workspace, which I do not want to modify. I want the Plugin itself to be modified to compile in the requisite code, not the example workspace/project. In other words, I want only the ios/repro_cocoapods_issue.podspec file to be modified.
In case it matters, I used the following Flutter command to create the project:
flutter create -t plugin -i objc -a java repro_cocoapods_issue
I have a full repro up on GitHub here. To reproduce, open the workspace at example/ios/Runner.xcworkspace in Xcode and try to build.
These are the things I've tried in the ios/repro_cocoapods_issue.podspec file:
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.user_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.user_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.pod_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.compiler_flags = '-Iexternal/'
s.preserve_paths = 'external/**'
s.preserve_paths = '${PROJECT_DIR}/external/**'
In all cases, I get:
'external_dir.c' file not found
If I change the code to #include ../external/external_dir.c then it works, but this does not help with my actual use case.
How can I configure my podspec so that a specified directory is included in the search path during compilation?
Output of pod env
Stack
CocoaPods : 1.8.4
Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
RubyGems : 2.5.2.3
Host : Mac OS X 10.14.6 (18G95)
Xcode : 11.1 (11A1027)
Git : git version 2.23.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git # d13a0869021d940f32f0543a03500755b39be998
Installation Source
Executable Path: /usr/local/bin/pod
Plugins
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.1.0
cocoapods-trunk : 1.4.1
cocoapods-try : 1.1.0
Answering my own question after finally figuring it out.
Something is aggressively caching the "output" of .podspec files. What was causing the issue is that I was changing the .podspec and cleaning+rebuilding, expecting that to be sufficient to pick up my changes, but it was not. If I instead do a git clean -xdf and then build, my changes are picked up.
I ended up using the properties I expected should work (with slight tweaks to the above that were easy to figure out once the options were actually being used):
s.source_files = [
'Classes/**/*',
'shared_c/**/*'
]
s.public_header_files = [
'Classes/**/*.h',
'shared_c/*.h'
]
s.xcconfig = {
'HEADER_SEARCH_PATHS' => [
'"${PODS_TARGET_SRCROOT}/shared_c/"'
],
'GCC_PREPROCESSOR_DEFINITIONS' => 'SOME_SYMBOL_FOR_THIRD_PARTY_CODE=1 SOME_OTHER_SYMBOL=1'
}
s.dependency 'Flutter'
s.ios.deployment_target = '9.0'
As for why the files are being so aggressively cached, I need to chase that up with the Flutter team (and I'm expecting them to say it's a CocoaPods/XCode issue).
Make sure that every edit to the podspec file also increases its version.
CocoaPods podspecs versions are assumed to be immutable and cached as such. See pod cache list and pod cache clean.

bower: no suitable angular version

Maybe I don't understand SemVer syntax or maybe I don't understand bower (I have version 1.4.1), but I have an app whose bower.json is:
{
"name": "MyApp",
"description": "My AngularJS Project....",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "1.3.x",
"angular-route": "1.3.x",
"angular-loader": "1.3.x",
"angular-mocks": "~1.3.x",
"angular-ui-grid": "~3.0.0-rc.20",
"angular-spinkit": "~0.3.3",
"angular-bootstrap": "0.13.0",
"bootstrap": "3.3.4",
"angular-animate": "~1.3.x",
"file-saver.js": "~1.20150507.2"
},
"resolutions": {
}
}**
When I do a 'bower update', it is “unable to find a suitable version for angular”, but I don't understand why not. Here's the output (#1 seems to be the problem):
Unable to find a suitable version for angular, please choose one:
1) angular#>=1.2.16 <=1.3.x which resolved to 1.2.28 and is required by angular-ui-grid#3.0.0-rc.22
2) angular#1.3.16 which resolved to 1.3.16 and is required by angular-animate#1.3.16, angular-loader#1.3.16, angular-mocks#1.3.16, angular-route#1.3.16
3) angular#1.3.x which resolved to 1.3.16 and is required by MyApp
4) angular#>=1.3.0 which resolved to 1.3.16 and is required by angular-bootstrap#0.13.0
5) angular#* which resolved to 1.3.16 and is required by angular-spinkit#0.3.3
So my reading of that output is that all packages would be happy with version 1.3.16 of angular, except for angular-ui-grid (“resolved to 1.2.28”) But why? Isn't 1.3.16 >=1.2.16 <=1.3.x ? And so isn't version 1.3.16 of Angular a suitable version? isn't it the ONLY suitable version? or maybe I'm misunderstanding what bower is trying to tell me.
I do understand that I can select one of the choices and even add a '!' to persist my choice, but I don't understand why a choice is needed.
Thanks
c0bra - thanks for setting up that plunker - it helped me to easily verify what I believe I finally (after lots of digging) determined is the problem:
there seems to be a bug in older versions of semver.js - I traced down, down, down into the code and the <=1.3.x gets morphed into <=1.3.0-0, and that means that 1.3.16 fails that test.
But that bug has been fixed in the NPM-delivered semver module - I was able to use your plunker to demonstrate to myself that 1.3.16 passes the test with 'latest' semver code, just as you set it up, but fails when I switch to older versions of semver (e.g. "^2.3.0", which seems to be what the bower package requires in its packages.json).
But even the latest bower on github seems to have that ^2.3.0 dependency for semver. So I'll see if I can submit a request to whoever maintains bower to get that upgraded. But I do not see much activity on bower/github of late.
In the meantime, I guess I'm stuck with being forced to answer the question above, since I'm using NPM to get bower, I don't think I can easily override it's semver dependency.

Unable to find suitable version for underscore

I get the following error:
Message:
Unable to find suitable version for underscore
Details:
code: ECONFLICT
picks: [object Object],[object Object],[object Object]
With the following bower file, this error I have never come across before. I cannot use the interactive shell, as this gets deployed to continuous integration. We also prefer to use Github repo links (don't ask me why) over bower packages.
{
"name": "Nightbird",
"version": "0.0.1",
"main": "src/css/style.scss",
"dependencies": {
"backbone": "git#github.com:jashkenas/backbone.git#1.1.2",
"underscore": "git#github.com:jashkenas/underscore.git#1.6.0",
"aisis-bootstrap-theme": "git#github.com:AdamKyle/Aisis-Bootstrap-Theme.git#0.5.0",
"selectize.js": "git#github.com:brianreavis/selectize.js.git#0.8",
"underscore.string": "git#github.com:epeli/underscore.string.git#v2.3.2",
"jquery-bootpag": "git#github.com:botmonster/jquery-bootpag.git#1.0.5",
"underscore.inflection": "git#github.com:jeremyruppel/underscore.inflection.git",
"moment": "git#github.com:moment/moment.git",
"bootstrap-markdown": "git#github.com:toopay/bootstrap-markdown.git#2.5.0",
"markdown-js": "git#github.com:evilstreak/markdown-js.git#v0.5.0",
"to-markdown": "git#github.com:domchristie/to-markdown.git#v0.0.2",
"font-awesome": "git#github.com:FortAwesome/Font-Awesome.git#4.2.0",
"react-bower": "git#github.com:reactjs/react-bower.git#0.11.1",
"showdown": "git#github.com:coreyti/showdown.git#0.3.1",
"pure": "git#github.com:yahoo/pure.git#0.5.0"
}
}
Any idea whats going on? Is this a bug? or just a developer being dumb?
You have a conflict between 3 different versions of underscore.
The reason for this is that underscore is required by 3 of your dependencies: Nightbird, backbone and underscore.inflection.
Using the latest version of Bower you can see the following information:
Unable to find a suitable version for underscore, please choose one:
1) underscore#1.6.0 which resolved to 1.6.0 and is required by Nightbird
2) underscore#>=1.5.0 which resolved to 1.6.0 and is required by backbone#1.1.2
3) underscore#~1.7.0 which resolved to 1.7.0 and is required by underscore.inflection#1.2.0
You can force bower to use a specific version in case of resolution by adding the following to your bower.json. In this example it will force using 1.6.0:
"resolutions": {
"underscore": "1.6.0"
}

installing modules from git zendframework 2

Is there any way to install modules by directly downloading from git-hub without php composer.phar. Because my php composer is not working.
this is the error
$ php composer.phar require webino/webino-image-thumb:2.*
./composer.json has been updated
Loading composer repositories with package information
Ignoring unknown parameter "server role"
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: zf-commons/zfc-admin[v0.1.0, dev-master].
- Can only install one of: zf-commons/zfc-admin[v0.1.0, dev-master].
- Installation request for zf-commons/zfc-admin 0.1.0 -> satisfiable by zf-commons/zfc-admin[v0.1.0].
- Installation request for zf-commons/zfc-admin == 9999999-dev -> satisfiable by zf-commons/zfc-admin[dev-master].
Installation failed, reverting ./composer.json to its original content.
My composer.json looks like this:
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [ "framework", "zf2" ],
"minimum-stability": "dev",
"homepage": "framework.zend.com/",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.2.0",
"webino/webino-image-thumb": "1.*",
"zf-commons/zfc-admin":"0.1.0"
}
}
There are three ways you can typically install Zend 2 Modules.
Through the file system
Git
Composer
You could just run:
https://github.com/ZF-Commons/ZfcAdmin.git
to get the module. But I am unsure if it is going to work since you likely have a dependency issue that needs resolving. I would recommend sticking with composer. Please post your whole composer.json file and I'm sure that the issue can be solved.
I cannot reproduce your error.
I copy your composer.json file into an empty directory and execute composer install there. Works.
I then issue composer require webino/webino-image-thumb:2.*, and it downloads that version (2.0.0-RC1) just fine.

Resources