-
-
Notifications
You must be signed in to change notification settings - Fork 174
ansible: update gn and ninja for V8 builds #4233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Building gn requires ninja. | ||
| dependencies: | ||
| - role: ninja-build | ||
| when: arch == 'ppc64' or arch == 's390x' | ||
| vars: | ||
| ninja_dest_dir: "{{ gn_dest_dir }}" | ||
| ninja_git_dir: "{{ tools_git_dir }}/ninja" | ||
| ninja_user: "{{ tools_user }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| argument_specs: | ||
| main: | ||
| short_description: The main task for compiling ninja from source. | ||
| options: | ||
| ninja_dest_dir: | ||
| description: The location to place the symlink to the ninja binary. | ||
| required: yes | ||
| type: "str" | ||
| ninja_git_dir: | ||
| description: The location to put the git checkout. | ||
| required: yes | ||
| type: "str" | ||
| ninja_user: | ||
| default: "{{ server_user|default(omit) }}" | ||
| description: The user to install ninja under. | ||
| type: "str" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| - name: install ninja build dependencies | ||
| include_tasks: "{{ v8deps_include }}" | ||
| loop_control: | ||
| loop_var: v8deps_include | ||
| with_first_found: | ||
| - files: | ||
| - "{{ role_path }}/tasks/partials/{{ os }}-{{ arch }}.yml" | ||
| - "{{ role_path }}/tasks/partials/{{ os }}.yml" | ||
| - "{{ role_path }}/tasks/partials/{{ os|stripversion }}.yml" | ||
| skip: true | ||
|
|
||
| - name: check existing ninja | ||
| ansible.builtin.command: "{{ ninja_dest_dir }}/ninja --version" | ||
| changed_when: no | ||
| failed_when: no | ||
| register: ninja_installed_version | ||
|
|
||
| # `ninja --version` does not include the 'v' prefix. | ||
| - name: check if ninja needs to be rebuilt | ||
| ansible.builtin.set_fact: | ||
| rebuild_ninja: "{{ not ninja_installed_version.stdout|default('') is search(ninja_version[1:]) }}" | ||
|
|
||
| - name: clone/update ninja repository | ||
| ansible.builtin.git: | ||
| dest: "{{ ninja_git_dir }}" | ||
| repo: "{{ ninja_git_repository }}" | ||
| version: "{{ ninja_version|default(omit) }}" | ||
| become: "{{ ninja_user|default(omit)|bool }}" | ||
| become_user: "{{ ninja_user|default(omit) }}" | ||
| register: ninja_git | ||
| when: rebuild_ninja | ||
|
|
||
| - name: clean git checkout | ||
| ansible.builtin.shell: git clean -fdX | ||
| args: | ||
| chdir: "{{ ninja_git_dir }}" | ||
| become: "{{ ninja_user|default(omit)|bool }}" | ||
| become_user: "{{ ninja_user|default(omit) }}" | ||
| when: rebuild_ninja | ||
|
|
||
| - name: build ninja | ||
| ansible.builtin.shell: | | ||
| {{ ninja_select_compiler }} && \ | ||
| ./configure.py --bootstrap | ||
| args: | ||
| chdir: "{{ ninja_git_dir }}" | ||
| become: "{{ ninja_user|default(omit)|bool }}" | ||
| become_user: "{{ ninja_user|default(omit) }}" | ||
| environment: | ||
| CC: gcc | ||
| CXX: g++ | ||
| when: rebuild_ninja | ||
|
|
||
| - name: create symlink | ||
| ansible.builtin.file: | ||
| dest: "{{ ninja_dest_dir }}/ninja" | ||
| src: "{{ ninja_git_dir }}/ninja" | ||
| state: link | ||
| become: "{{ ninja_user|default(omit)|bool }}" | ||
| become_user: "{{ ninja_user|default(omit) }}" | ||
| when: rebuild_ninja |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| # Install ninja build dependencies for RHEL 8 | ||
|
|
||
| - name: install ninja build dependencies for {{ os }}-{{ arch }} | ||
| package: | ||
| name: "{{ package }}" | ||
| state: present | ||
| use: dnf | ||
| loop_control: | ||
| loop_var: package | ||
| notify: package updated | ||
| with_items: | ||
| # ansible doesn't like empty lists | ||
| - "{{ packages[os+'_'+arch]|default('[]') }}" | ||
| - "{{ packages[os]|default('[]') }}" | ||
| - "{{ packages[os|stripversion]|default('[]') }}" | ||
|
richardlau marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
|
|
||
| compiler: { | ||
| 'rhel8': '. /opt/rh/gcc-toolset-12/enable' | ||
| } | ||
|
|
||
| ninja_git_repository: 'https://github.com/ninja-build/ninja' | ||
| ninja_select_compiler: '{{ compiler[os]|default(compiler[os|stripversion])|default("true") }}' | ||
| ninja_version: 'v1.13.2' | ||
|
|
||
| packages: { | ||
| 'rhel8': 'gcc-toolset-12' | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.