gclient issue when building Chromium on Windows - chromium

I'm following steps on https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md to build Chromium on Windows, when it comes to run gclient, it gives following usage information, it seems something is wrong, any suggestion is appreciated.
C:\Users\Test>gclient
Usage: gclient.py [options]
Meta checkout dependency manager for Git.
Commands are:
config creates a .gclient file in the current directory
diff displays local diff for every dependencies
fetch fetches upstream commits for all modules
flatten flattens the solutions into a single DEPS file
getdep gets revision information and variable values from a DEPS file
grep greps through git repos managed by gclient
help prints list of commands or help for a specific command
metrics reports, and optionally modifies, the status of metric collection
pack generates a patch which can be applied at the root of the tree
recurse operates [command args ...] on all the dependencies
revert reverts all modifications in every dependencies
revinfo outputs revision info mapping for the client and its dependencies
root outputs the solution root (or current dir if there isn't one)
runhooks runs hooks for files that have been modified in the local working copy
setdep modifies dependency revisions and variable values in a DEPS file
status shows modification status for every dependencies
sync checkout/update all modules
validate validates the .gclient and DEPS syntax
verify verifies the DEPS file deps are only from allowed_hosts
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-j JOBS, --jobs=JOBS Specify how many SCM commands can run in parallel;
defaults to 8 on this machine
-v, --verbose Produces additional output for diagnostics. Can be
used up to three times for more logging info.
--gclientfile=CONFIG_FILENAME
Specify an alternate .gclient file
--spec=SPEC create a gclient file containing the provided string.
Due to Cygwin/Python brokenness, it can't contain any
newlines.
--no-nag-max Ignored for backwards compatibility.

When I try it in a clean system, it works.

Related

Vercel ignore build step according to folder of committed files

i'm using vercel's ignore build step field to disable preview deploys (IE - only deploy if the branch is main)
I'm doing this with the following bash script:
if [[ "$VERCEL_GIT_COMMIT_REF" == "main" ]] ; then
# Proceed with the build
echo "✅ - Build can proceed"
exit 1;
else
# Don't build
echo "🛑 - Build canceled"
exit 0;
fi
Now, another requirement I have is to only deploy if the changed files belong to a specific folder. Can I somehow combine these two requirements in the same script?
How do I access the paths of the committed files in this bash script?
Thanks!
Vercel has added some docs that address this exact situation:
git diff HEAD^ HEAD --quiet ./packages/frontend/
If changes were commited to ./packages/frontend/, the command will yield a non-empty response, allowing the build to proceed.
I also use a similar setup, but call a node script (check it out here) as my Ignored Build Step option.

singularity extract, edit, and rebuild image

I have a singularity container that has been made for me (to run tensorflow on comet GPU nodes) but I need to modify the keras install for my purposes.
I understand that .simg files are not editable (and that the writable .img format is deprecated), so the process of converting to an .img file, editing, and then converting back to .simg is discouraged:
sudo singularity build --writable development.img production.simg
## make changes
sudo singularity build production2.img development.simg
It seems to me the best way might be to extract the contents (say into a sandbox), edit them, and then rebuild the sandbox into an .simg image.
I know how to do the second conversion (singularity build new-sif sandbox), but how can I do the first?
I have tried the following, but the command never finishes:
sudo singularity build tf_gpu tensorflow-gpu.simg
WARNING: Authentication token file not found : Only pulls of public images will succeed
Build target already exists. Do you want to overwrite? [N/y] y
2018/10/12 08:39:54 bufio.Scanner: token too long
INFO: Starting build...
You can easily convert between a sandbox and a production build using the following:
sudo singularity build lolcow.sif docker://godlovedc/lolcow # pulls and builds an example container
sudo singularity build --sandbox lolcow_sandbox/ lolcow.sif # converts from container to a writable sandbox
sudo singularity build lolcow2 lolcow_sandbox/ # converts from sandbox to container
So, you can edit the sandbox and then rebuild accordingly.

How to directly execute cmake script without -P?

I know -P is used to execute a cmake script file. But I don't want create a file for a simple logic. I want to execute statement like this:
cmake "if(foo) do_something endif()"
The reason I want this feature is that I want to use if/else in add_custom_target and add_custom_command to execute some command according to whether a CMAKE variable is defined.
Finally I got a good solution to this. Now describe as follows.
Let's say I want to add two targets, whose aim are to create docker images and upload to remote repository when issuing make images and make publish. I use VERSION , GIT_COMMIT and PATCH to compose an image tag. GIT_COMMIT can be obtained from git log by using execute_process, and I need to pass newer VERSION and PATCH from command line every time I want to create images. (But if I don't plan to create, they won't be given)
So the complete statements are like this:
execute_process(COMMAND git log --pretty=format:%h -n 1 OUTPUT_VARIABLE GIT_COMMIT)
set(DOCKER_CERBERUS_URL "docker-registry.com/db/cerberus:${VERSION}-${GIT_COMMIT}.${PATCH}")
add_custom_target(images
COMMENT "Creating docker images ..."
# clean the cache
COMMAND rm -f CMakeCache.txt # important !
# if VERSION and PATCH are not given, don't build it
COMMAND /bin/sh -c "if [ x${VERSION} != x -a x${PATCH} != x ]; then docker build -t ${DOCKER_CERBERUS_URL} ${CMAKE_CURRENT_SOURCE_DIR}/docker/; fi"
DEPENDS cerberus
VERBATIM )
add_custom_target(publish
COMMENT "Uploading images ..."
COMMAND docker push ${DOCKER_CERBERUS_URL}
DEPENDS images )
Then every time I want to create or publish with newer version number and patch number, I use cmake .. -DVERSION=xxx -DPATCH=xxx, make images or make publish.
There's something which may be strange. When I first issue cmake .. -DVERSION=xxx -DPATCH=xxx, then make images, sh command will be executed. Then I issue make images again, sh command will not be executed. My guess is: in the first run of make images, cmake will first load variable from CMakeCache.txt into memory, then sh command can get variables's value from memory, and at this time CMakeCache.txt has been deleted. So in the second run, the variables have no value.

How to install PHP extensions on Cloudbees?

I need to install mbstring (and a few other extensions) for PHP on Cloudbees. Is this possible?
Note that I'm using an updated PHP version as described here:
https://developer.cloudbees.com/bin/view/DEV/PHP+Builds
I don't think scripts have sudo access, so I can't simply use the package manager. I don't think these extensions exist as PEAR packages either. So I'm stumped.
Here is the response from Cloudbees support. Seems to work fine, just make sure you don't have any spaces in your Jenkins build path!
Our provided PHP versions don't have mbstring module activated. You will need to build your own PHP version to get it. To be sure your custom PHP build works on Cloudbees slave, you can build it with a Jenkins job on your instance (with various --with-XXX or --without-XXX options).
We are ourselves doing something like this with a script like
# Download
regex='.*(RC|alpha|beta).*'
if [[ $version =~ $regex ]]; then
wget http://downloads.php.net/dsp/php-${version}.tar.bz2
else
wget http://us3.php.net/distributions/php-${version}.tar.bz2
fi
# Unpack
tar xjf php-${version}.tar.bz2
# Build
cd php-${version}
./configure --prefix=/home/jenkins/tools/php/${php_name} \
--with-curl --with-openssl
make && make install
As a side node, you should also take care of specifying a good installation prefix with --prefix. I would choose something like /home/jenkins/tools/php/5.4/.
To store compiled php engine you could generate a tar.gz//bz2 file of target installation directory. Then, store it in your WebDAV directory, which is accessible in /private/{account}/ during a build when "Mount CloudBees DEV#cloud Private WebDav Repository" is checked.
You should add a first step to jobs requiring PHP to extract this archive. As Jenkins workspace is usually cached on DEV#Cloud, you can extract the archive only if it's not already there. That will speed up your build.

How to build docker image from github repository

In official docs we can see:
# docker build github.com/creack/docker-firefox
It just works fine to me. docker-firefox is a repository and has Dockerfile within root dir.
Then I want to buid redis image and exact version 2.8.10 :
# docker build github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10
2014/11/05 16:20:32 Error trying to use git: exit status 128 (Initialized empty Git repository in /tmp/docker-build-git067001920/.git/
error: The requested URL returned error: 403 while accessing https://github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10/info/refs
fatal: HTTP request failed
)
I got error above. What's the right format with build docker image from github repos?
docker build url#ref:dir
Git URLs accept context configuration in their fragment section,
separated by a colon :. The first part represents the reference that
Git will check out, this can be either a branch, a tag, or a commit
SHA. The second part represents a subdirectory inside the repository
that will be used as a build context.
For example, run this command to use a directory called docker in the
branch container:
docker build https://github.com/docker/rootfs.git#container:docker
https://docs.docker.com/engine/reference/commandline/build/
The thing you specified as repo URL is not a valid git repository. You will get error when you will try
git clone github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10
Valid URL for this repo is github.com/docker-library/redis. So you may want to try following:
docker build github.com/docker-library/redis
But this will not work too. To build from github, docker requires Dockerfile in repository root, howerer, this repo doesn't provide this one. So, I suggest, you only have to clone this repo and build image using local Dockerfile.
One can use the following example which sets up a Centos 7 container for testing ORC file format. Make sure to escape the # sign:
$ docker build https://github.com/apache/orc.git\#:docker/centos7 -t orc-centos7