gclient runhooks fails - build-process

I'm trying to build Chrome under windows, I got the chromium trunk using tortoiseSVN and I believe I got everything correctly, but when I run "gclient runhooks" I get the error: "Error: client not configured; see 'gclient config'".
Now, I know that it happens because I don't have a ".gclient" file on the same directory, but I couldn't find .gclient file anywhere in the project. I tried to create .gclient file myself but it says there's a solution missing.
I'm probably missing something, can anyone help me with that? I'm pretty stuck!
Thanks!

gclient config http://src.chromium.org/svn/trunk/src
gclient runhooks
Or make a .gclient file with the following content, which skips the huge amount of webkit layout tests
solutions = [
{ "name" : "src",
"url" : "http://src.chromium.org/svn/trunk/src",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
"src/third_party/WebKit/LayoutTests": None,
"src/chrome_frame/tools/test/reference_build/chrome": None,
"src/chrome/tools/test/reference_build/chrome_mac": None,
"src/chrome/tools/test/reference_build/chrome_win": None,
"src/chrome/tools/test/reference_build/chrome_linux": None,
},
"safesync_url": "",
},
]

The above solution is out-dated. Running with the SVN repository results in:
Error:
The chromium code repository has migrated completely to git.
Your SVN-based checkout is now obsolete; you need to create a brand-new
git checkout by following these instructions:
http://www.chromium.org/developers/how-tos/get-the-code
Now you need to create a .gclient file like this
solutions = [
{
"managed": False,
"name": "src",
"url": "https://chromium.googlesource.com/chromium/src.git",
"custom_deps": {},
"deps_file": ".DEPS.git",
"safesync_url": "",
},
]
and do:
gclient sync

Chromium does not include a preconfigured .gclient file for the Chromium build and does not automatically handle Visual Studio versioning changes and default Deploy toolkit hints. After you have successfully downloaded the deploy tools and the chromium source code as provided at chromium.org perform the following in the root directory where your deploy_tools and src code is located.
NOTE : If you receive errors try to start a new command prompt session and try again.
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION = 2015
gclient config https://chromium.googlesource.com/chromium/src.git
gclient sync
gclient runhooks
cd src
ninja -C out\Debug chrome
The build will take some time gclient runhooks should generate the build folder.

Related

Publishing zip from TeamCity to Artifactory using FileSpec, does it even work?

I've tried everything I can think of to get this to work but in every attempt NO errors are returned (the logs say everything succeeded and one file was uploaded) but in artifactory, although the build info is published, nothing appears in the target repo.
I tried using powershell and the rest api to publish, but that just gave me (502 gateway error). Again, no matter what combination of values I used, always this useless error.
I have been forced to revert to using the 'legacy patterns' because this is the only thing that works AT ALL.
The pattern I am using is:
%ProjectPublishDir%\**\*.* => path/to/my/APP/%Major-Version%.%Minor-Version%/%ArtifactNamePrefix%/%ArtifactFileName%
Where all these values are parameters defined in TeamCity. This works like a charm.
However, if I add this at the end of my powershell to create the artifact:
#Write-Host "##teamcity[publishArtifacts '%ProjectPublishDir%\**\*.* => %ArtifactsDir%\%ArtifactFileName%']"
Then I replace legacy patterns with file specs for my powershell step, then I use this file spec:
{
"files": [
{
"pattern": "%ArtifactsDir%\%ArtifactFileName%",
"target": "my_repo_name/path/to/my/APP/%Major-Version%.%Minor-Version%/%ArtifactNamePrefix%/",
"props": "type=zip;status=ready"
}
]
}
The log says the artifact was generated (which I verified on the build agent is true) and that it was sent to Artifactory successfully, but when I check in artifactory, the build info is there but the artifact is missing.
Every example everywhere I can find is too simple and from the basic examples out there, what I have above should work. So what are the docs missing that I am not doing/doing incorrectly?

Parsing error : Cannot find module 'next/babel'

Update 1 : Updated the latest working solution to #Jeevan Rupacha answer, please scroll below to check it out.
I have been encountering this error on every single new Next.js project that I create. The page can be compiled without any problem, it just keeps on showing as error on the first line in every js file.
Parsing error: Cannot find module 'next/babel'
Require stack:
D:\app\next_app\ratu-seo\node_modules\next\dist\compiled\babel\bundle.js
D:\app\next_app\ratu-seo\node_modules\next\dist\compiled\babel\eslint-parser.js
D:\app\next_app\ratu-seo\node_modules\eslint-config-next\parser.js
D:\app\next_app\ratu-seo\node_modules#eslint\eslintrc\lib\config-array-factory.js
D:\app\next_app\ratu-seo\node_modules#eslint\eslintrc\lib\index.js
D:\app\next_app\ratu-seo\node_modules\eslint\lib\cli-engine\cli-engine.js
D:\app\next_app\ratu-seo\node_modules\eslint\lib\cli-engine\index.js
D:\app\next_app\ratu-seo\node_modules\eslint\lib\api.js
c:\Users\Admin.vscode\extensions\dbaeumer.vscode-eslint-2.1.23\server\out\eslintServer.js
Create file called .babelrc in your root directory and add this code:
{
"presets": ["next/babel"],
"plugins": []
}
And in .eslintrc, replace the existing code with:
{
"extends": ["next/babel","next/core-web-vitals"]
}
I had this same problem - but only when I wasn't opening the project folder directly. It appears to be related to how ESLint needs to be configured for workspaces.
In addition, the currently accepted answer works for VSCode but breaks npm run lint for me.
TL;DR - see this answer which points to this blog. This fixed it for me.
Some Details
For example, if I have:
~
| -- some_folder
| | -- project_1
| | -- project_2
| ...files relating to both projects...
I'll often just cd ~/some_folder && code .
But then I get the same error you're experiencing. However, if I cd ~/some_folder/project_1 && code . then everything works fine.
If that's the case for you as well, then what you need (as described in the links above) is to:
Create a workspace config
Specify folders where you need ESLint to run
You can do this easily from VSCode. The net result (following my example above) is a file named ~/some_folder/.vscode/settings.json with contents
{
"eslint.workingDirectories": [
"./project_1",
"./project_2"
]
}
Note: You don't need to create extra .babelrc file
In your NextJS Project you have this file , named .eslintrc.json,
In this file
You have following code
{
"extends": "next/core-web-vitals"
}
Replace it with
{
"extends": ["next/babel","next/core-web-vitals"]
}
Note: If you only replace with
{
"extends": ["next/babel"]
}
The red error sign will go but the code won't compile and gives compile error.
For Nextjs 12 add prettier in .eslintrc.json file inside your root folder.
{
"extends": ["next/core-web-vitals", "prettier"]
}
In my case, the issue occurs when I code in VSCode and use pnpm as the package manager, I tried lots of methods in StackOverflow, and finally, I find out that it's the duty of the VSCode ESLint plugin.
So, to fix the problem without uninstalling the plugin, add the following configuration in the .vscode/settings.json and reload your editor.
{
"eslint.packageManager": "pnpm"
}
Using Next.js, TypeScript, and Tailwind CSS, I updated the .eslintrc.json file with:
{
"extends": ["next/babel", "next/core-web-vitals"]
}
then ctrl + shift + p and search for ESLint: Restart ESLint Server.
It worked for me by just adding prettier in .eslintrc file.
{
"extends": ["next", "prettier"]
}
Try updating the .eslintrc.json file to
{
"extends": ["next", "prettier","next/core-web-vitals"],
"plugins": ["prettier"]
}
Also install prettier plugin if you don't have it already
npm install eslint-plugin-prettier#latest --save-dev
Don't have to include .babelrc file as it will replace Nextjs SWC compiler
S
I had this same problem - Close the IDE and reopen it with the project folder !!
My Problem
I found this error in project with PNPM, ESLint, and Monorepo architecture using Turborepo.
My Solution
add this into the ESLint config file:
parserOptions: {
babelOptions: {
presets: [require.resolve('next/babel')],
},
},
You can also always try updating React and then Next. I had the same error message then updated them both and now my app is working fine.
Upgrade React version to latest
Most applications already use the latest version of React, with Next.js 11 the minimum React version has been updated to 17.0.2.
To upgrade you can run the following command:
npm install react#latest react-dom#latest
Or using yarn:
yarn add react#latest react-dom#latest
Upgrade Next.js version to latest
To upgrade you can run the following command in the terminal:
npm install next#latest
or
yarn add next#latest
Just had this issue with the Nextjs app and the following worked for me. I no longer have issue with next/babel and I can run yarn lint.
Add prettier to your project
yarn add --dev eslint-config-prettier
Update your eslint config as follows
{
"extends": ["prettier", "next/core-web-vitals"]
}
Add global vscode settings and include your project path
{
"eslint.workingDirectories": ["./your-project"]
}
In my case I had to disable VSCode ESLint extension.
Unfortunately when I added ["next/babel"] in extends, the npm run lint stopped working and Eslint in vscode did not underlining any abnormalities.
ctrl + shift + p
TypeScript: Restart TS server
Really, just adding prettier to "extends": ["next/core-web-vitals] to have something like ==> {"extends": ["next/core-web-vitals", "prettier"]}, gets rid of the error, without having to create an extra .babelrc file. But another research that needs to be done, is to know, if there are any downsides to doing it, and i think the answer is NO
In my project, i just run yarn add #babel/core and run
ctrl + shift + p in vscode, excute ESLint: Restart ESlint Server
ESLint: Restart ESlint Server
it works, and npm run lint works fine too.
> Executing task: yarn run lint <
✔ No ESLint warnings or errors
In my case, the problem is that I added "eslint.packageManager": "yarn" to the setting.json of VSCode before, and I tried to use the same setup within a new project managed with pnpm. After adding "eslint.packageManager": "pnpm" for the new workspace, and reload window, than the issue's gone.
I've tried adding "extends": ["next/babel", "next/core-web-vitals", "prettier"] to .eslintrc.js, it will fix the error only within VSCode, but will cause the other error when building my Next.js app.

Unable to build project that includes a custom worker file

I'm facing a very strange issue with next-pwa. Whenever I try to build a next-pwa project that includes a custom worker js file, the build fails with the following error:
info - Creating an optimized production build ..buffer.js:333
throw new ERR_INVALID_ARG_TYPE(
^
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
at Function.from (buffer.js:333:9)
at writeOut (C:\Users\sdqui\Desktop\next-pwa\examples\custom-worker\node_modules\next\dist\compiled\webpack\bundle4.js:56716:26)
at C:\Users\sdqui\Desktop\next-pwa\examples\custom-worker\node_modules\next\dist\compiled\webpack\bundle4.js:56735:7
at arrayIterator (C:\Users\sdqui\Desktop\next-pwa\examples\custom-worker\node_modules\next\dist\compiled\neo-async\async.js:1:14270)
at timesSync (C:\Users\sdqui\Desktop\next-pwa\examples\custom-worker\node_modules\next\dist\compiled\neo-async\async.js:1:5037)
at Object.eachLimit (C:\Users\sdqui\Desktop\next-pwa\examples\custom-worker\node_modules\next\dist\compiled\neo-async\async.js:1:14216)
at emitFiles (C:\Users\sdqui\Desktop\next-pwa\examples\custom-worker\node_modules\next\dist\compiled\webpack\bundle4.js:56617:13)
at C:\Users\sdqui\Desktop\next-pwa\examples\custom-worker\node_modules\next\dist\compiled\webpack\bundle4.js:36508:26
at FSReqCallback.oncomplete (fs.js:184:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
I have tried several things so far to fix this issue:
Clone the repo and updated all dependencies (i thought the issue might be webpack related)
Building the project without a custom worker file (works fine)
Downgrade to Node 10, 12, 14, 15, and re-install dependencies.
I've also tried the to use the code provided in the /example folder of the repo, but the same issue occurs there as well.
I'm not the only one facing this issue so i would appreciate help.
You can test it yourself using Gitpod, just open this link and navigate to the example, install dependencies and try yarn build.
Are you using webpack 5 or 4.x? I faced the same issue with webpack > 5 and fixed the same by passing the future object to withPWA " future: { webpack5: true }".
module.exports = withPWA({ future: { webpack5: true },
pwa: {
disable: false,
dest: "public",
//register: false,
skipWaiting: false,
runtimeCaching
}
})

JavaFX-11 in VSCode: Error: Could not find or load main class Files\Java\javafx-sdk-11.0.2\lib

I have been trying to set up JavaFX-11 in Visual Studio Code.
I found this post JavaFX-11 with VSCode, which explained how to do so, and followed the steps.
However, I need to include the module-path to the JavaFX SDK by adding an entry for the vmArgs in the launch.json file:
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - Main",
"request": "launch",
"vmArgs": "--module-path C:\\Program Files\\Java\\javafx-sdk-11.0.2\\lib --add-modules javafx.controls,javafx.fxml",
"mainClass": "hellofx.Main",
"projectName": "hellofx"
}
]
}
As you can see in the vmArgs entry, is my local path to the JavaFX SDK. However, when I try to run the program I get the following error:
Error: Could not find or load main class
Files\Java\javafx-sdk-11.0.2\lib Caused by:
java.lang.ClassNotFoundException: Files\Java\javafx-sdk-11.0.2\lib
For the past hours I have trying to figure out why it doesn't work. Am I writing the arguments wrong? I saw there are .jmods files. Should I download those files? Is there any other way to specify the module path?
Is worth to mention that I am running Visual Studio Code in Windows 10, so I have to use escape sequence to use backslashes.
As you can see by the error you have posted:
Error: Could not find or load main class Files\Java\javafx-sdk-11.0.2\lib
it is clear that the issue is related to the space you have in Program Files.
Solutions
As a possible solution, you could move your JavaFX SDK to a folder without spaces in its path, and set your vmArgs accordingly, like:
"vmArgs": "--module-path C:\\Java\\javafx-sdk-11.0.2\\lib --add-modules javafx.controls,javafx.fxml",
While that works, if you still want to keep your current approach, you have to find a way to set the path with spaces.
Based on a similar issue, you can find that:
Paths containing spaces should be surrounded by (escaped) double quotes
So this will be the solution in your case:
"vmArgs": "--module-path \"C:\\Program Files\\Java\\javafx-sdk-11.0.2\\lib\" --add-modules javafx.controls,javafx.fxml",
Note this doesn't apply to the path added in the .classpath file with the JavaFX jars, that will be like this:
<classpathentry kind="lib" path="C:\\Program Files\\Java\\javafx-sdk-11.0.2\\lib\\javafx.base.jar"/>
Adding double quotes surrounding my environment variable in IntelliJ solved for me:
PATH_TO_FX="C:\Program Files\Java\javafx-sdk-11.0.2\lib"
** If you are having this error on Eclipse**
"Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found"
Remove the JavaFX SDK library from the build path of the project!!

JavaFX-11 with VSCode

I must be missing something obvious here... I am experimenting with VSCode (coming from Eclipse), but I am unable to get VSCode to see the JavaFX11 libraries. In the import statements, all references to JavaFX components are marked:
[Java] The import javafx cannot be resolved
In Eclipse, this is handled with a "User Library", which generates an entry in .classpath
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFX11">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
While VSCode seemingly understands the rest of the .classpath from Eclipse, it does not understand this. Replacing the path attribute with the actual location on disk also does not work.
For clarity:
This question is specifically about Java 11. In earlier Java versions, JavaFX was part of the JDK. In Java 11, it has been moved to a set of external modules.
I do not want to use Maven or Gradle. I need to directly reference the modules without using a build tool.
For extra points, it would be nice if VSCode could also directly execute the JavaFX application. However, it is acceptable if I have to start the application from the command line with explicit module- and class-paths
I'm going to run the HelloFX sample for Eclipse from the OpenJFX samples.
After I open the sample with VSCode, I see the reported error: [Java] The import javafx cannot be resolved [268435846].
This obviously means that JavaFX classes are not resolved, and even if there is an entry in the .classpath file:
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFX11"/>
this library can't be resolved.
Solving JavaFX SDK
So I'm going to replace that variable with the actual jars from my local JavaFX SDK:
<classpathentry kind="lib" path="/Users/<user>/Downloads/javafx-sdk-11.0.2/lib/javafx.base.jar"/>
<classpathentry kind="lib" path="/Users/<user>/Downloads/javafx-sdk-11.0.2/lib/javafx.graphics.jar"/>
<classpathentry kind="lib" path="/Users/<user>/Downloads/javafx-sdk-11.0.2/lib/javafx.controls.jar"/>
<classpathentry kind="lib" path="/Users/<user>/Downloads/javafx-sdk-11.0.2/lib/javafx.fxml.jar"/>
After refreshing the project, I can see under JAVA DEPENDENCIES these jars.
While the error seems solved, the project still fails to build.
Solving JRE
We need to set JDK 11 for the project, so download it from here. Then open Eclipse and add it to the installed JREs. I see under Java -> Installed JREs -> Execution Environments that the name for the 11 version is JavaSE-11.
The .classpath file from the helloFX project also contains a reference to the JRE:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/
org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK11">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
so I'm going to replace JDK11 with JavaSE-11, and refresh the project. I can see under JAVA DEPENDENCIES that there is a reference to JRE System Library [JavaSE-11].
Solving JAVA_HOME
We need to set the java.home in VSCode.
This can be done in the settings.json from `Preferences->Settings->Workspace Settings:
{
"java.dependency.packagePresentation": "hierarchical",
"java.home":"/Users/<user>/Downloads/jdk-11.0.2.jdk/Contents/Home"
}
After modifying it, you'll get a popup with the message Java Language Server configuration changed, please restart VS Code., so restart it.
Trying it out
We can see that there are no errors, there is even a bin folder with the result of the build that automatically VSCode does.
Can we run it? If we try it out, we'll get an error:
Error: JavaFX runtime components are missing, and are required to run this application
This is the error you get when using JavaFX 11 without specifying the module-path.
Solving VM arguments
The final step consist on adding the required vm arguments.
This can be done in the launch.json file. It contains a default configuration, that we can modify adding a new entry for the vmArgs including the --module-path with the local path to the JavaFX SDK and --add-modules with the required JavaFX modules:
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - Main",
"request": "launch",
"vmArgs": "--module-path /Users/<user>/Downloads/javafx-sdk-11.0.2/lib
--add-modules javafx.controls,javafx.fxml",
"mainClass": "hellofx.Main",
"projectName": "hellofx"
}
]
}
Now we have everything set.
Run the project again and it should work.
Note that I'm a first time user of VSCode, so I may have missed something obvious, and maybe some of these steps could be avoided or simplified.
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"request": "launch",
"vmArgs": "--module-path /Volumes/Data/kits/installations/javafx-sdk-15.0.1/lib --add-modules=javafx.controls,javafx.fxml,javafx.graphics",
"mainClass": "application.Main",
"name": "Launch Main",
"projectName": "GooDay"
}
]
}
add this to settings json
"java.dependency.packagePresentation": "hierarchical",
"java.home":"/Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home"
I think I've found a simpler answer!
Start the executable that installs your JDK
e.g.: jdk-8u201-windows-x64
Reinstall and choose to have the extra features including JavaFX installed locally.
Once the installer was done Visual Studio was able to see the files and access was no longer restricted.
If this doesn't work, I did two other things before while I was trouble-shooting (neither of these solved the problem, but one of them could've affected the result of reinstalling the JDK):
I appended a slash to the end of path to the JDK
e.g.: "C:\Program Files\Java\jdk1.8.0_201\"
Before reinstalling the JDK I connected eclipse to it and added a non-restricted access rule

Resources