Commit Graph

50 Commits

Author SHA1 Message Date
jcmdln
21f9e7f5e5 Fix Linux release pipeline which expects to bundle libLLVM*.so 2023-10-16 16:33:26 -04:00
jcmdln
51248270e1 Remove [[ for POSIX shell support 2023-10-15 12:18:51 -04:00
jcmdln
d0037fcf6b Allow running in POSIX shells 2023-10-14 22:01:38 -04:00
jcmdln
b25fba6175 Fix typo in GIT_SHA collection 2023-10-14 18:10:42 -04:00
jcmdln
afcdbf1ba6 Don't implicitly try 'llvm-config-14', try fallback or set LLVM_CONFIG; Restore FreeBSD llvm-config discovery 2023-10-14 18:07:20 -04:00
jcmdln
8eff75a484 Hoist GIT_SHA discovery 2023-10-14 17:51:28 -04:00
jcmdln
e232cabfab Remove extra newlines 2023-10-14 17:46:34 -04:00
jcmdln
e5ed388191 Ensure user defined LLVM_CONFIG is respected 2023-10-14 17:45:27 -04:00
jcmdln
c0ac3de272 Hunt for supported 'llvm-config' executable 2023-10-14 17:41:19 -04:00
jcmdln
abde9a99c3 Fix typos in references to OS_ARCH, OS_NAME 2023-10-14 17:32:41 -04:00
jcmdln
bdc74a03c0 Refactor to improve handling of LLVM_VERSION checks 2023-10-14 16:58:34 -04:00
jcmdln
fa2b68dac6 Fix MAX_LLVM_VERSION panic messages 2023-10-12 01:47:51 -04:00
jcmdln
bd86cb22e0 Support LLVM >=17.0.1 on Darwin and Linux 2023-10-11 21:06:42 -04:00
Hasan Yasin Ozturk
963eeee361 Fix dropped "dev-" prefix from version tag
In commit c3a31666, "dev-" prefix was dropped unintentionally. This commit fixes
that.
2023-07-31 17:46:45 +03:00
Hasan Yasin Ozturk
3d16880d95 Set version date to commit date instead of build date
Fixes #2688

This commit updates `build_odin.sh` and `build.bat` so that date of the commit
is used for the version tag, instead of the build time.
2023-07-31 17:29:56 +03:00
Simon Rowe
d167d18bb3 Update build_odin.sh to better support optimisation on Arm CPUs
The `build_odin` flags include the option `release-native`.

The current `EXTRAFLAGS` set however don't work for Arm CPUs as they dont support `-march=native`.

Added code to detect CPU and either set the preferred flag for Arm CPUs (ie `-mcpu=native`) or keep the current default.

Information on preferred Arm CPU optimisation flag taken from here: https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu

Changes tested on an Apple Silicon M1 CPU (arm64) using HomeBrew installed llvm as follows:

```
Homebrew clang version 14.0.6                                                                                                                    
Target: arm64-apple-darwin22.5.0                                                                                                                 
Thread model: posix                                                                                                                              
InstalledDir: /opt/homebrew/opt/llvm@14/bin
```
2023-05-28 15:08:14 +01:00
Colin Davidson
8233f49beb Revert "Fix: header directories in Unix build script" 2023-05-08 20:13:33 -07:00
Jan Prukner
19097bc5bc add redirect to /dev/null 2023-04-25 07:06:36 +02:00
Jan Prukner
dbebe9e92c Fix which command check
The function have_witch failed because which is an alias in my environment.

This change makes the function work even if which command is an alias.
2023-04-24 21:47:27 +02:00
Peter Lef
8d951ab7f1 Fix: header directories in Unix build script 2023-04-16 04:16:31 -04:00
Meghan
1bf4a6f711 build_odin.sh: fix typo introduced in detection of llvm-config-11-64
appeared in b22d71a74e
2023-04-12 12:18:11 -07:00
TryAngle
b5784bc2ef Fix: Unable to find LLVM-config on Ubuntu
appends a check for llvm-config-14 on linux
2023-04-11 15:08:31 +02:00
Jeroen van Rijn
b42bb5be26 Only try to parse git hash if .git is present
Closes 2451
2023-04-11 11:55:29 +02:00
kamil-beker
b22d71a74e build_odin.sh - fix build on darwin arm64
Done:
- use ARCH variable properly
- refactor have_which() to use POSIX compliant command - ref
- use command instead of which for the same reason as above.
- run shfmt for consistency.
2023-04-08 08:54:53 +02:00
Colin Davidson
5f27f2dd7f move to work-stealing threadpool 2022-12-28 21:44:17 -08:00
Jeroen van Rijn
d19ae37af1 Panic if LLVM > 14. 2022-10-27 02:39:18 +02:00
Jeroen van Rijn
f58f922487 Detect which and complain if not found. 2022-10-25 16:45:38 +02:00
Felipe Lavratti
99894686cf Change llvm-copy-to-zip path to use real one, instead of link 2022-09-28 16:08:05 +01:00
Felipe Lavratti
5e9ff85fa8 Changed nightly build for linux to include the llvm library file 2022-09-21 00:50:34 +01:00
Jeroen van Rijn
4c857bf031 FreeBSD: Autodetect LLVM version. 2022-09-03 16:59:58 +02:00
cui fliter
dc8b7a0eb8 fix some typos
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-08-05 20:10:20 +08:00
gingerBill
8e50a6c61b Merge pull request #1876 from mohd-akram/build-config-opts
Allow passing config options to build script
2022-08-01 14:33:35 +01:00
Ronald1985
4cb4173ced Updated shabang in build_odin.sh so it runs on OpenBSD
This change doesn't break compatibility on Linux or Darwin
2022-07-22 23:01:38 +01:00
Mohamed Akram
a8b44f33bd Allow passing config options to build script 2022-07-08 16:14:54 +04:00
Jeroen van Rijn
63331ef731 Revert "Merge pull request #1702 from Kelimion/filename_generation"
This reverts commit a40a53b104, reversing
changes made to 5422a3b17e.
2022-04-24 19:53:36 +02:00
Jeroen van Rijn
3cab2592c3 Compiler: Add early error for output path being a directory.
- Introduce new `Path` type and an array of build paths on the build context.
- Resolve input and output paths/files early (before parsing).
- Error early if inputs are missing or outputs are directories.
- Plumb new file path generation into linker stage instead of its adhoc method.

TODO:
- Remove more adhoc file path generation in parser and linker stage.
- Make intermediate object file generation use new path system.
- Round out and robustify Path helper functions.
2022-04-24 13:37:26 +02:00
Jeroen van Rijn
ad0a413b40 Give build/run/check/test/doc a -file flag.
A package has canonically always been a directory, but odin allowing you to build a single-file package confused newcomers who didn't understand why they could then not access variables and procedures from another file in the same directory.

This change disallows building single-file packages by default, requiring the `-file` flag to acknowledge you understand the nuance.

`-help` for these commands also clarifies the difference.

```
W:\Odin>odin build -help
odin is a tool for managing Odin source code
Usage:
        odin build [arguments]

        build   Compile directory of .odin files as an executable.
                One must contain the program's entry point, all must be in the same package.
                Use `-file` to build a single file instead.
                Examples:
                        odin build .                    # Build package in current directory
                        odin build <dir>                # Build package in <dir>
                        odin build filename.odin -file  # Build single-file package, must contain entry point.

        Flags

        -file
                Tells `odin build` to treat the given file as a self-contained package.
                This means that `<dir>/a.odin` won't have access to `<dir>/b.odin`'s contents.
```

```
W:\Odin>odin run examples\demo\demo.odin
ERROR: `odin run` takes a package as its first argument.
Did you mean `odin run examples\demo\demo.odin -file`?
The `-file` flag tells it to treat a file as a self-contained package.
```
2022-04-05 20:26:18 +02:00
Colin Davidson
8605833781 core out Makefile, add freebsd building 2022-03-14 05:23:48 -07:00
Colin Davidson
2652c2d7a5 normalize version parser 2022-03-09 07:42:38 -08:00
Colin Davidson
a2250a5d49 lower minimum llvm version 2022-03-09 07:24:49 -08:00
Colin Davidson
1306c53fb1 more build tweaks? 2022-03-09 07:21:19 -08:00
Colin Davidson
7adaa4dc2b refix make, adjust build for CI weirdness 2022-03-09 07:15:08 -08:00
Colin Davidson
c543ecd64c Try to find llvm-config-11 on goofy misconfigured CI box 2022-03-09 06:57:59 -08:00
Colin Davidson
9aea990184 clean up osx semver handling in build 2022-03-09 06:49:52 -08:00
Colin Davidson
d5b0632e4f add handling for too many args 2022-03-09 06:27:52 -08:00
Colin Davidson
db169a4334 Cleanup build mode selection 2022-03-09 06:26:25 -08:00
Colin Davidson
f5cc8bd7bf only build odin for report when necessary 2022-03-09 06:14:30 -08:00
Colin Davidson
005d52cab7 more spacing issues 2022-03-09 06:08:48 -08:00
Colin Davidson
d1477bcfa7 Fix wonky copied space issues 2022-03-09 06:07:19 -08:00
Colin Davidson
3092fb2ff3 Add initial cut of build script 2022-03-09 06:01:40 -08:00