How to require a specific commit of a Drupal project? - composer-php

I know this had been asked several times, but the other solutions don't work for me so the problem may be somewhere else.
In a dependent project I require a package like this:
"require": {
"drupal/security_review": "dev-8.x-1.x#35ebae44"
}
but composer update fails with the reason:
package/name dev-master requires drupal/security_review dev-8.x-1.x#35ebae44
-> no matching package found.
For research purposes I fetched package info:
[local]$ composer show --all drupal/security_review
name : drupal/security_review
descrip. : Site security and configuration review module.
keywords :
versions : 1.x-dev, dev-1.x
type : drupal-module
source : [git] https://git.drupal.org/project/security_review 9a3bdf82a645dabb9801f73d2d76acf8c3081d88
support
source : http://cgit.drupalcode.org/security_review
requires
drupal/core ~8.0
and then tried to use the version in place of branch omitting "dev-" part from the version as it goes as prefix:
"require": {
"drupal/security_review": "dev-1.x#35ebae44"
}
And this went differently:
[local]$ composer update
...
- Installing drupal/security_review (dev-1.x 9a3bdf8): Cloning 9a3bdf82a6
As you see it fetches commit #9a3bdf8 instead of the requested - #35ebae44.
Any ideas?

Needed to figure out this too, it's 1.x-dev and not dev-1.x
For example:
composer require drupal/security_review:1.x-dev#35ebae44
1/2: http://packagist.org/p/provider-latest$00ceddb9dc4b7174d6c84c3e2ac454ccd6a6cb952ab70c1ab623371566d63754.json
2/2: http://packagist.org/p/provider-2018-04$1ce22045b6ddc998c850721c3db7f2902d0d37ae5989b30f0fb40ebfa5e91833.json
Finished: success: 2, skipped: 0, failure: 0, total: 2
./composer.json has been updated
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
- Installing drupal/security_review (dev-1.x 35ebae44): Gathering patches for dependencies. This might take a minute.
Cloning 35ebae44 from cache
Writing lock file
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles

Related

RStudio package "digest" cannot be used, loaded, or installed

trying to follow the quanteda tutorial, I'm running into problems here with the programme; executing the following code, I get error messages hinting at problems with packages I cannot resolve.
> require(quanteda)
> require(quanteda.corpora)
> require(ggplot2)
> corp_tweets <- download(url = 'https://www.dropbox.com/s/846skn1i5elbnd2/data_corpus_sampletweets.rds?dl=1')
Error in loadNamespace(name) : there is no package called ‘digest’
As the package seems to be missing, I tried loading it and get:
> require("digest")
Loading required package: digest
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘digest’
Now, I try installing it - again, without success.
> install.packages("digest")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/digest_0.6.20.zip'
Content type 'application/zip' length 223139 bytes (217 KB)
downloaded 217 KB
package ‘digest’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘digest’
The downloaded binary packages are in
C:\Users\my_username\AppData\Local\Temp\Rtmpaunnzu\downloaded_packages
Does anyone know how to take it from here? Help is much appreciated.
P.S.: This (unanswered) question did not help me either.
The only "solution" I could find was to re-install RStudio.

Git dependency errors when using Composer with private VCS repository on IBM i

More details below, but I'm running into the following error when I issue a composer install or composer update command on a project which uses a custom VCS repository for an included project. This is on an IBM i v7r3 system via SSH session. I've run out of ideas on how to troubleshoot further, so here I am. Has anyone ever seen this error or have any ideas on how to troubleshoot further?
Error:
bash-4.4$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 113 installs, 0 updates, 0 removals
- Installing sshUser/myPackage (v1.0.26): Cloning a2db0666b1
[RuntimeException]
Failed to clone gitUser:/opt/git/myPackage.git, git was not found, check that
it is installed and in your PATH env.
Could not load program git:
Dependent module /usr/local/zendphp7/lib/libz.so.1(shr_64.o) could not be loaded.
File /usr/local/zendphp7/lib/libz.so.1 is not an
archive or the file could not be read properly.
System error: Exec format error
I have a remote IBM i server which has two users. The first user "gitUser" is used for my private Git repositories (headless). I then have another user "sshUser" which is used to SSH in with and do my typical work. I have SSH keys configured to simplify connections for both users and the "gitUser" ssh key doesn't require a password, so I can use it for automated scripting.
I have a private VCS repository included in my composer.json file for a project. So long as I have the entry in the "repository" section I'm getting the above error. This occurs even if I'm not requireing a package from the repository.
Repository Entry:
"repositories": [
{
"type": "vcs",
"url": "gitUser:/opt/git/myPackage.git"
}
]
Composer on the IBM i is up to date at 1.7.2.
It's clear the issue lies with git and the inability to find a dependency in libz.so.1.
However, if I follow the chain of dependencies for the version of Git in my path, all the appropriate files exist with adequate permissions:
bash-4.4$ which git
/QOpenSys/pkgs/bin/git
bash-4.4$ dump -X64 -H /QOpenSys/pkgs/bin/git
/QOpenSys/pkgs/bin/git:
***Loader Section***
Loader Header Information
VERSION# #SYMtableENT #RELOCent LENidSTR
0x00000001 0x000000df 0x0000433f 0x0000009d
#IMPfilID OFFidSTR LENstrTBL OFFstrTBL
0x00000006 0x00044910 0x00000a18 0x000449ad
***Import File Strings***
INDEX PATH BASE MEMBER
0 /QOpenSys/pkgs/lib:/QOpenSys/usr/lib
1 libz.so.1 shr_64.o
2 libiconv.so.2 shr_64.o
3 libcrypto.so.1.0.0 shr_64.o
4 libpthread.a shr_xpg5_64.o
5 libc.a shr_64.o
bash-4.4$
I can confirm there are no permission failures through out all of this. So this doesn't seem to be the result of inadequate permissions. Also, I do not think the issue lies within the user profile gitUser as if I issue a composer install or composer update from another machine (with appropriate keys), everything works flawlessly. So it seems to be specific to the IBM i and the sshUser profile.
I'm starting to think Composer is using a different git executable and the dependencies of that executable do not exist. Though I assume Composer would just use my path.
Note*: I tried specifying my LIBPATH in my ./.profile with the following. But it doesn't seem to make any difference:
LIBPATH=/usr/local/zendphp7/lib
LIBPATH=$LIBPATH:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib
export LIBPATH
When echoing:
bash-4.4$ echo $LIBPATH
/usr/local/zendphp7/lib:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib
bash-4.4$
If I don't add the above to my ./.profile, then echo $LIBPATH prints a blank line to screen.
Solution:
I just changed the symlink in the ZENDPHP7 directory structure to the repo version. Alternatively you can manipulate your library path, but I couldn't figure out the proper way to do it on IBM i.
bash-4.4$ pwd
/usr/local/zendphp7/lib
bash-4.4$ ln -s /QOpenSys/pkgs/lib/libz.so.1 ./libz.so.1
bash-4.4$ ls -la /usr/local/zendphp7/lib/libz.so.1
lrwxrwxrwx 1 dl 0 56 Oct 11 14:21 /usr/local/zendphp7/lib/libz.so.1 -> /QOpenSys/pkgs/lib/libz.so.1
bash-4.4$
I'm guessing something is off with your path when you do the install. Is it maybe looking at the Zend PHP libraries rather than the expected ones in /usr/lib?
Notice that the errors shows a path of /usr/local/zendphp7/lib/ libz.so.1(shr_64.o) while your git dump instead shows /QOpenSys/pkgs/lib:/QOpenSys/usr/lib.

Julia Error Building Mongo.jl Package on Windows 10

I installed Julia v0.6.2 on Windows 10.
Every other package was installed without a problem, but Mongo.jl give me this error while building it.
Pkg.build("Mongo")
INFO: Building LibBSON
===============================[ ERROR: LibBSON ]===============================
LoadError: None of the selected providers can install dependency libbson.
Use BinDeps.debug(package_name) to see available providers
while loading C:\Users\"user"\.julia\v0.6\LibBSON\deps\build.jl, in expression starting on line 27
================================================================================
INFO: Building Mongo
================================[ ERROR: Mongo ]================================
LoadError: None of the selected providers can install dependency libmongoc.
Use BinDeps.debug(package_name) to see available providers
while loading C:\Users\"user"\.julia\v0.6\Mongo\deps\build.jl, in expression starting on line 26
================================================================================
================================[ BUILD ERRORS ]================================
WARNING: LibBSON and Mongo had build errors.
- packages with build errors remain installed in C:\Users\ciko9\.julia\v0.6
- build the package(s) and all dependencies with Pkg.build("LibBSON", "Mongo")
- build a single package by running its deps/build.jl script
================================================================================
I already opened an issue on github, but I'd like to fix it asap. Any idea on how to solve this problem?
The solution is first to install manually the mongo c drivers.
Second, to copy the mongo-c-drivers folder to the mongo e libbson folder inside julia, then make a new file deps.jl for each package and write this:
# Macro to load a library
macro checked_lib(libname, path)
((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
quote const $(esc(libname)) = $path end
end
# Load dependencies
#checked_lib libbson "C:\\Users\\"userName"\\.julia\\v0.6\\LibBSON\\mongo-c-driver\\bin\\libbson-1.0.dll"
# Load-hooks

Suddenly unable to install package 'mfx'

I have been blithely using R for some time when suddenly I'm having trouble installing packages, specifically mfx. It appears to be downloading. But then when I input library(mfx), I get this: Loading required package: sandwich
Loading required package: lmtest
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
Loading required package: MASS
Loading required package: betareg
Error in get(".packageName", where) :
cannot open file 'C:/Users/Mary Graybeal/Documents/R/win-library/3.2/modeltools/R/modeltools.rdb': No such file or directory
Error: package ‘betareg’ could not be loaded
As part of my efforts to resolve it, I uninstalled and reinstalled; no help there. I use RStudio, but the same thing happens in R, and so the problem is not RStudio. Am I overlooking something really obvious here?
You have to re-install the previous package, in this case MODELTOOLS
install.packages("modeltools")
Loading required package: MASS Loading required package: betareg Error in get(".packageName", where) : cannot open file 'C:/Users/Mary Graybeal/Documents/R/win-library/3.2/modeltools/R/modeltools.rdb': No such file or directory Error: package ‘betareg’ could not be loaded
Maybe an another errors appear, you have to do the same step with each package.

APT: Pinning package origin & apt proxy on packages resources list

I try to configure priority pinning with APT on Debian 8, to force a package installation from a specific repository.
My servers are configured to use an apt proxy, specified on each lines of /etc/apt/sources.list:
deb http://<my-apt-cacher-ng-proxy>:9999/ftp.fr.debian.org/debian/ jessie main
deb http://<my-apt-cacher-ng-proxy>:9999/ftp.igh.cnrs.fr/pub/mariadb/repo/10.0/debian sid main
I would like to use 'MariaDB' repository for a specific package 'libmysqlclient18'.
The recommended way is to add an apt preference, indicating that origin "ftp.igh.cnrs.fr" weight more than default repos, for example like this:
/etc/apt/preferences.d/libmysqlclient18.conf
Package: libmysqlclient18
Pin: origin ftp.igh.cnrs.fr
Pin-Priority: 1001
But as I use a proxy, every origins in my conf refers to <my-apt-cacher-ng-proxy>...
Is there a way to force the repos .?
I tried some alternatives with no success:
Pin: release o=MariaDB
Pin: release l=MariaDB
...
I even tried to indicate that Debian base package should not be installed, with no success either:
Package: libmysqlclient18
Pin: release n=Jessie
# OR: Pin: release o=Debian
Pin-Priority: -10
Same result every time: the two repos. keep the same 500 priority
$ aptitude versions libmysqlclient18
Paquet libmysqlclient18 :
p 5.5.42-1 testing 500
p 10.0.17+maria-1~sid <NULL> 500
Thanks a lot
I found a workaround, by asking apt to consider everything comming from MariaDB as more important... this is ok as this repository only contains 4 or 5 packages, but is not the ideal solution!
Package: *
Pin: release o=MariaDB
Pin-Priority: 999
If I only indicate one package instead of '*', it stops working. Even 'Package: libmysql*' does not work.

Resources